From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40840) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VCfyx-0001L0-0t for qemu-devel@nongnu.org; Thu, 22 Aug 2013 21:16:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VCfyr-0001mG-1Q for qemu-devel@nongnu.org; Thu, 22 Aug 2013 21:16:06 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48102) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VCfyq-0001ln-QO for qemu-devel@nongnu.org; Thu, 22 Aug 2013 21:16:00 -0400 From: Fam Zheng Date: Fri, 23 Aug 2013 09:14:44 +0800 Message-Id: <1377220491-19954-2-git-send-email-famz@redhat.com> In-Reply-To: <1377220491-19954-1-git-send-email-famz@redhat.com> References: <1377220491-19954-1-git-send-email-famz@redhat.com> Subject: [Qemu-devel] [PATCH v6 1/8] vvfat: use bdrv_new() to allocate BlockDriverState List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, famz@redhat.com, jcody@redhat.com, stefanha@redhat.com, pbonzini@redhat.com, xiawenc@linux.vnet.ibm.com we need bdrv_new() to properly initialize BDS, don't allocate memory manually. Signed-off-by: Fam Zheng --- block/vvfat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/vvfat.c b/block/vvfat.c index cd3b8ed..a827d91 100644 --- a/block/vvfat.c +++ b/block/vvfat.c @@ -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; -- 1.8.3.1