From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55110) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V2HR8-00075T-K1 for qemu-devel@nongnu.org; Thu, 25 Jul 2013 05:02:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V2HR6-0000l2-15 for qemu-devel@nongnu.org; Thu, 25 Jul 2013 05:02:14 -0400 Received: from mx1.redhat.com ([209.132.183.28]:1607) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V2HR5-0000ku-PO for qemu-devel@nongnu.org; Thu, 25 Jul 2013 05:02:11 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r6P92BFP029776 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 25 Jul 2013 05:02:11 -0400 From: Fam Zheng Date: Thu, 25 Jul 2013 17:01:39 +0800 Message-Id: <1374742906-4489-2-git-send-email-famz@redhat.com> In-Reply-To: <1374742906-4489-1-git-send-email-famz@redhat.com> References: <1374742906-4489-1-git-send-email-famz@redhat.com> Subject: [Qemu-devel] [PATCH 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, pbonzini@redhat.com, famz@redhat.com, stefanha@redhat.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.2