[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v5 19/42] block: Use CAF in bdrv_co_rw_vmstate()
From: |
Max Reitz |
Subject: |
[Qemu-devel] [PATCH v5 19/42] block: Use CAF in bdrv_co_rw_vmstate() |
Date: |
Thu, 13 Jun 2019 00:09:41 +0200 |
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 <address@hidden>
---
block/io.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/block/io.c b/block/io.c
index 659ea0c52a..14f99e1c00 100644
--- a/block/io.c
+++ b/block/io.c
@@ -2395,6 +2395,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);
@@ -2407,8 +2408,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);
--
2.21.0
- Re: [Qemu-devel] [PATCH v5 34/42] block: Inline bdrv_co_block_status_from_*(), (continued)
- [Qemu-devel] [PATCH v5 36/42] iotests: Add tests for mirror @replaces loops, Max Reitz, 2019/06/12
- [Qemu-devel] [PATCH v5 35/42] block: Fix check_to_replace_node(), Max Reitz, 2019/06/12
- [Qemu-devel] [PATCH v5 38/42] iotests: Let complete_and_wait() work with commit, Max Reitz, 2019/06/12
- [Qemu-devel] [PATCH v5 39/42] iotests: Add filter commit test cases, Max Reitz, 2019/06/12
- [Qemu-devel] [PATCH v5 37/42] block: Leave BDS.backing_file constant, Max Reitz, 2019/06/12
- [Qemu-devel] [PATCH v5 40/42] iotests: Add filter mirror test cases, Max Reitz, 2019/06/12
- [Qemu-devel] [PATCH v5 41/42] iotests: Add test for commit in sub directory, Max Reitz, 2019/06/12
- [Qemu-devel] [PATCH v5 42/42] iotests: Test committing to overridden backing, Max Reitz, 2019/06/12
- [Qemu-devel] [PATCH v5 19/42] block: Use CAF in bdrv_co_rw_vmstate(),
Max Reitz <=
- Re: [Qemu-devel] [PATCH v5 00/42] block: Deal with filters, Vladimir Sementsov-Ogievskiy, 2019/06/13