]> git.proxmox.com Git - qemu.git/commitdiff
vvfat: use bdrv_new() to allocate BlockDriverState
authorFam Zheng <famz@redhat.com>
Fri, 23 Aug 2013 01:14:44 +0000 (09:14 +0800)
committerStefan Hajnoczi <stefanha@redhat.com>
Fri, 6 Sep 2013 13:25:08 +0000 (15:25 +0200)
we need bdrv_new() to properly initialize BDS, don't allocate memory
manually.

Signed-off-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
block/vvfat.c

index cd3b8edd9f5938e8e89b2aadec471ec9bb9c5ca3..a827d91cce5fa2a681eba508cfc6e92199f3bd17 100644 (file)
@@ -2943,7 +2943,7 @@ static int enable_write_target(BDRVVVFATState *s)
     unlink(s->qcow_filename);
 #endif
 
-    s->bs->backing_hd = calloc(sizeof(BlockDriverState), 1);
+    s->bs->backing_hd = bdrv_new("");
     s->bs->backing_hd->drv = &vvfat_write_target;
     s->bs->backing_hd->opaque = g_malloc(sizeof(void*));
     *(void**)s->bs->backing_hd->opaque = s;