qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] qcow2: Keep option in qcow2_invalidate_cache()
@ 2014-03-11 16:42 Kevin Wolf
  2014-03-11 18:32 ` Max Reitz
  2014-03-11 18:44 ` Stefan Hajnoczi
  0 siblings, 2 replies; 3+ messages in thread
From: Kevin Wolf @ 2014-03-11 16:42 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf, stefanha

Instead of manually building a list of all options from BDRVQcowState
values just reuse the options that were used to open the image.
qcow2_open() won't fully use all of the options in the QDict, but that's
okay.

This fixes all of the driver-specific options in qcow2, except for
lazy-refcounts, which was special cased before.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 block/qcow2.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/block/qcow2.c b/block/qcow2.c
index da82646..945c9d6 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -1180,11 +1180,8 @@ static void qcow2_invalidate_cache(BlockDriverState *bs)
 
     bdrv_invalidate_cache(bs->file);
 
-    options = qdict_new();
-    qdict_put(options, QCOW2_OPT_LAZY_REFCOUNTS,
-              qbool_from_int(s->use_lazy_refcounts));
-
     memset(s, 0, sizeof(BDRVQcowState));
+    options = qdict_clone_shallow(bs->options);
     qcow2_open(bs, options, flags, NULL);
 
     QDECREF(options);
-- 
1.8.1.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] qcow2: Keep option in qcow2_invalidate_cache()
  2014-03-11 16:42 [Qemu-devel] [PATCH] qcow2: Keep option in qcow2_invalidate_cache() Kevin Wolf
@ 2014-03-11 18:32 ` Max Reitz
  2014-03-11 18:44 ` Stefan Hajnoczi
  1 sibling, 0 replies; 3+ messages in thread
From: Max Reitz @ 2014-03-11 18:32 UTC (permalink / raw)
  To: Kevin Wolf, qemu-devel; +Cc: stefanha

On 11.03.2014 17:42, Kevin Wolf wrote:
> Instead of manually building a list of all options from BDRVQcowState
> values just reuse the options that were used to open the image.
> qcow2_open() won't fully use all of the options in the QDict, but that's
> okay.
>
> This fixes all of the driver-specific options in qcow2, except for
> lazy-refcounts, which was special cased before.
>
> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
> ---
>   block/qcow2.c | 5 +----
>   1 file changed, 1 insertion(+), 4 deletions(-)

Reviewed-by: Max Reitz <mreitz@redhat.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] qcow2: Keep option in qcow2_invalidate_cache()
  2014-03-11 16:42 [Qemu-devel] [PATCH] qcow2: Keep option in qcow2_invalidate_cache() Kevin Wolf
  2014-03-11 18:32 ` Max Reitz
@ 2014-03-11 18:44 ` Stefan Hajnoczi
  1 sibling, 0 replies; 3+ messages in thread
From: Stefan Hajnoczi @ 2014-03-11 18:44 UTC (permalink / raw)
  To: Kevin Wolf; +Cc: qemu-devel, stefanha

On Tue, Mar 11, 2014 at 05:42:41PM +0100, Kevin Wolf wrote:
> Instead of manually building a list of all options from BDRVQcowState
> values just reuse the options that were used to open the image.
> qcow2_open() won't fully use all of the options in the QDict, but that's
> okay.
> 
> This fixes all of the driver-specific options in qcow2, except for
> lazy-refcounts, which was special cased before.
> 
> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
> ---
>  block/qcow2.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)

Thanks, applied to my block tree:
https://github.com/stefanha/qemu/commits/block

Stefan

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-03-11 18:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-11 16:42 [Qemu-devel] [PATCH] qcow2: Keep option in qcow2_invalidate_cache() Kevin Wolf
2014-03-11 18:32 ` Max Reitz
2014-03-11 18:44 ` Stefan Hajnoczi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).