cryptospore / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone
0a122b
From ac25e461b9f69a91349aa00531e42dea604b92a7 Mon Sep 17 00:00:00 2001
0a122b
From: Kevin Wolf <kwolf@redhat.com>
0a122b
Date: Mon, 17 Mar 2014 13:29:27 +0100
0a122b
Subject: [PATCH 3/6] qcow2: Keep option in qcow2_invalidate_cache()
0a122b
0a122b
RH-Author: Kevin Wolf <kwolf@redhat.com>
0a122b
Message-id: <1395062967-16867-3-git-send-email-kwolf@redhat.com>
0a122b
Patchwork-id: 58112
0a122b
O-Subject: [RHEL-7.0 qemu-kvm PATCH 2/2] qcow2: Keep option in qcow2_invalidate_cache()
0a122b
Bugzilla: 1048575
0a122b
RH-Acked-by: Max Reitz <mreitz@redhat.com>
0a122b
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
0a122b
RH-Acked-by: Fam Zheng <famz@redhat.com>
0a122b
0a122b
Instead of manually building a list of all options from BDRVQcowState
0a122b
values just reuse the options that were used to open the image.
0a122b
qcow2_open() won't fully use all of the options in the QDict, but that's
0a122b
okay.
0a122b
0a122b
This fixes all of the driver-specific options in qcow2, except for
0a122b
lazy-refcounts, which was special cased before.
0a122b
0a122b
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
0a122b
Reviewed-by: Max Reitz <mreitz@redhat.com>
0a122b
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
0a122b
(cherry picked from commit d475e5acd2f4679d6ce458369ee658dbd60227e9)
0a122b
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
0a122b
---
0a122b
 block/qcow2.c | 5 +----
0a122b
 1 file changed, 1 insertion(+), 4 deletions(-)
0a122b
0a122b
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
0a122b
---
0a122b
 block/qcow2.c |    5 +----
0a122b
 1 files changed, 1 insertions(+), 4 deletions(-)
0a122b
0a122b
diff --git a/block/qcow2.c b/block/qcow2.c
0a122b
index e9bd9c9..18e136e 100644
0a122b
--- a/block/qcow2.c
0a122b
+++ b/block/qcow2.c
0a122b
@@ -1178,11 +1178,8 @@ static void qcow2_invalidate_cache(BlockDriverState *bs)
0a122b
 
0a122b
     bdrv_invalidate_cache(bs->file);
0a122b
 
0a122b
-    options = qdict_new();
0a122b
-    qdict_put(options, QCOW2_OPT_LAZY_REFCOUNTS,
0a122b
-              qbool_from_int(s->use_lazy_refcounts));
0a122b
-
0a122b
     memset(s, 0, sizeof(BDRVQcowState));
0a122b
+    options = qdict_clone_shallow(bs->options);
0a122b
     qcow2_open(bs, options, flags, NULL);
0a122b
 
0a122b
     QDECREF(options);
0a122b
-- 
0a122b
1.7.1
0a122b