qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH v7 22/47] block: Use CAF in bdrv_co_rw_vmstate()


From: Andrey Shinkevich
Subject: Re: [PATCH v7 22/47] block: Use CAF in bdrv_co_rw_vmstate()
Date: Wed, 15 Jul 2020 16:39:46 +0300
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:68.0) Gecko/20100101 Thunderbird/68.9.0

On 25.06.2020 18:21, Max Reitz wrote:
If a node whose driver does not provide VM state functions has a
metadata child, the VM state should probably go there; if it is a
filter, the VM state should probably go there.  It follows that we
should generally go down to the primary child.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
---
  block/io.c | 5 +++--
  1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/block/io.c b/block/io.c
index 37057f13e0..9e802804bb 100644
--- a/block/io.c
+++ b/block/io.c
@@ -2646,6 +2646,7 @@ bdrv_co_rw_vmstate(BlockDriverState *bs, QEMUIOVector 
*qiov, int64_t pos,
                     bool is_read)
  {
      BlockDriver *drv = bs->drv;
+    BlockDriverState *child_bs = bdrv_primary_bs(bs);
      int ret = -ENOTSUP;
bdrv_inc_in_flight(bs);
@@ -2658,8 +2659,8 @@ bdrv_co_rw_vmstate(BlockDriverState *bs, QEMUIOVector 
*qiov, int64_t pos,
          } else {
              ret = drv->bdrv_save_vmstate(bs, qiov, pos);
          }
-    } else if (bs->file) {
-        ret = bdrv_co_rw_vmstate(bs->file->bs, qiov, pos, is_read);
+    } else if (child_bs) {
+        ret = bdrv_co_rw_vmstate(child_bs, qiov, pos, is_read);
      }
bdrv_dec_in_flight(bs);


Reviewed-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>




reply via email to

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