From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46835) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V7jWW-0002Is-8L for qemu-devel@nongnu.org; Fri, 09 Aug 2013 06:02:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V7jWQ-000766-Ab for qemu-devel@nongnu.org; Fri, 09 Aug 2013 06:02:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34931) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V7jWQ-00075x-3u for qemu-devel@nongnu.org; Fri, 09 Aug 2013 06:02:14 -0400 From: Fam Zheng Date: Fri, 9 Aug 2013 18:01:54 +0800 Message-Id: <1376042521-12293-2-git-send-email-famz@redhat.com> In-Reply-To: <1376042521-12293-1-git-send-email-famz@redhat.com> References: <1376042521-12293-1-git-send-email-famz@redhat.com> Subject: [Qemu-devel] [PATCH v5 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