qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 4/5] block: Virtual Bridges VERDE GOW disk image


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [PATCH 4/5] block: Virtual Bridges VERDE GOW disk image format, GOW version 2 and version 3 support implementation
Date: Fri, 9 Mar 2012 11:48:07 +0000

On Thu, Mar 8, 2012 at 10:16 PM, Leonardo E. Reiter
<address@hidden> wrote:
> +    s->full_block = calloc(1, GOW_BLOCKSIZE);

Please use g_malloc0(GOW_BLOCKSIZE) and g_free() instead of standard
library memory allocation functions.  The glib memory management
functions are a bit richer than the standard library functions and
include tracing which is useful for memory leak debugging.

There is a special function for allocating disk I/O buffers:
void *qemu_blockalign(BlockDriverState *bs, size_t size)

It honors memory alignment requirements which are necessary when
opening the image file with O_DIRECT.  You can use qemu_vfree() to
free such buffers.

Stefan



reply via email to

[Prev in Thread] Current Thread [Next in Thread]