On Thu, Mar 8, 2012 at 10:16 PM, Leonardo E. Reiter <lrei...@vbridges.com> 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