cryptospore / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone

Blame SOURCES/kvm-vvfat-use-bdrv_new-to-allocate-BlockDriverState.patch

0a122b
From e02cdc5fccb977bde5162af586a8cc4dcaf7c5f4 Mon Sep 17 00:00:00 2001
0a122b
From: Fam Zheng <famz@redhat.com>
0a122b
Date: Fri, 17 Jan 2014 03:07:46 +0100
0a122b
Subject: [PATCH 03/34] vvfat: use bdrv_new() to allocate BlockDriverState
0a122b
0a122b
RH-Author: Fam Zheng <famz@redhat.com>
0a122b
Message-id: <1389928083-8921-2-git-send-email-famz@redhat.com>
0a122b
Patchwork-id: 56763
0a122b
O-Subject: [RHEL-7 qemu-kvm PATCH 01/18] vvfat: use bdrv_new() to allocate BlockDriverState
0a122b
Bugzilla: 1041301
0a122b
RH-Acked-by: Jeffrey Cody <jcody@redhat.com>
0a122b
RH-Acked-by: Kevin Wolf <kwolf@redhat.com>
0a122b
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
0a122b
0a122b
we need bdrv_new() to properly initialize BDS, don't allocate memory
0a122b
manually.
0a122b
0a122b
Signed-off-by: Fam Zheng <famz@redhat.com>
0a122b
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
0a122b
(cherry picked from commit 3d34c6cd99f434126365150c2535bbf93b94f891)
0a122b
Signed-off-by: Fam Zheng <famz@redhat.com>
0a122b
---
0a122b
 block/vvfat.c | 2 +-
0a122b
 1 file changed, 1 insertion(+), 1 deletion(-)
0a122b
0a122b
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
0a122b
---
0a122b
 block/vvfat.c |    2 +-
0a122b
 1 files changed, 1 insertions(+), 1 deletions(-)
0a122b
0a122b
diff --git a/block/vvfat.c b/block/vvfat.c
0a122b
index cb45687..2c7970d 100644
0a122b
--- a/block/vvfat.c
0a122b
+++ b/block/vvfat.c
0a122b
@@ -2951,7 +2951,7 @@ static int enable_write_target(BDRVVVFATState *s)
0a122b
     unlink(s->qcow_filename);
0a122b
 #endif
0a122b
 
0a122b
-    s->bs->backing_hd = calloc(sizeof(BlockDriverState), 1);
0a122b
+    s->bs->backing_hd = bdrv_new("");
0a122b
     s->bs->backing_hd->drv = &vvfat_write_target;
0a122b
     s->bs->backing_hd->opaque = g_malloc(sizeof(void*));
0a122b
     *(void**)s->bs->backing_hd->opaque = s;
0a122b
-- 
0a122b
1.7.1
0a122b