yeahuh / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone

Blame SOURCES/kvm-qcow2-Keep-option-in-qcow2_invalidate_cache.patch

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