qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v10 7/9] stream: skip filters when writing backing file name


From: Vladimir Sementsov-Ogievskiy
Subject: Re: [PATCH v10 7/9] stream: skip filters when writing backing file name to QCOW2 header
Date: Wed, 7 Oct 2020 13:14:26 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.3.1

29.09.2020 15:38, Andrey Shinkevich wrote:
Avoid writing a filter JSON-name to QCOW2 image when the backing file
is changed after the block stream job.

Signed-off-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
---
  block/stream.c | 9 +++++----
  1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/block/stream.c b/block/stream.c
index e0540ee..b0719e9 100644
--- a/block/stream.c
+++ b/block/stream.c
@@ -65,6 +65,7 @@ static int stream_prepare(Job *job)
      BlockDriverState *bs = blk_bs(bjob->blk);
      BlockDriverState *unfiltered_bs = bdrv_skip_filters(bs);
      BlockDriverState *base = bdrv_filter_or_cow_bs(s->above_base);
+    BlockDriverState *base_metadata = bdrv_skip_filters(base);

Could we call it base_unfiltered in according with all such things?

      Error *local_err = NULL;
      int ret = 0;
@@ -73,10 +74,10 @@ static int stream_prepare(Job *job) if (bdrv_cow_child(unfiltered_bs)) {
          const char *base_id = NULL, *base_fmt = NULL;
-        if (base) {
-            base_id = s->backing_file_str;

Seems backing_file_str becomes unused and we should drop it. So, actually,
this patch fix two problems:

 - do not save backing_file_str at stream start (as base may change during the 
job)
 - avoid json filters in final qcow2 image metadata

-            if (base->drv) {
-                base_fmt = base->drv->format_name;
+        if (base_metadata) {
+            base_id = base_metadata->filename;
+            if (base_metadata->drv) {
+                base_fmt = base_metadata->drv->format_name;
              }
          }
          bdrv_set_backing_hd(unfiltered_bs, base, &local_err);



--
Best regards,
Vladimir



reply via email to

[Prev in Thread] Current Thread [Next in Thread]