From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50328) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V44w0-0004NL-1Z for qemu-devel@nongnu.org; Tue, 30 Jul 2013 04:05:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V44kK-0004f4-OQ for qemu-devel@nongnu.org; Tue, 30 Jul 2013 03:54:40 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47221) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V44kK-0004eo-DL for qemu-devel@nongnu.org; Tue, 30 Jul 2013 03:53:28 -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 r6U7rRI2011880 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 30 Jul 2013 03:53:27 -0400 From: Fam Zheng Date: Tue, 30 Jul 2013 15:52:51 +0800 Message-Id: <1375170777-31457-2-git-send-email-famz@redhat.com> In-Reply-To: <1375170777-31457-1-git-send-email-famz@redhat.com> References: <1375170777-31457-1-git-send-email-famz@redhat.com> Subject: [Qemu-devel] [PATCH v2 1/7] 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, jcody@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.4