From: Kevin Wolf Date: Tue, 11 Mar 2014 16:42:41 +0000 (+0100) Subject: qcow2: Keep option in qcow2_invalidate_cache() X-Git-Tag: Tizen_Studio_1.3_Release_p2.3.1~386^2~42^2~93^2~8 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d475e5acd2f4679d6ce458369ee658dbd60227e9;p=sdk%2Femulator%2Fqemu.git qcow2: Keep option in qcow2_invalidate_cache() 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 Reviewed-by: Max Reitz Signed-off-by: Stefan Hajnoczi --- diff --git a/block/qcow2.c b/block/qcow2.c index b5b1e8c1b9..ec23cc47e4 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -1178,11 +1178,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);