[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 07/21] blkverify: Implement .bdrv_recurse_can_replace()
From: |
Max Reitz |
Subject: |
[PATCH v3 07/21] blkverify: Implement .bdrv_recurse_can_replace() |
Date: |
Thu, 30 Jan 2020 22:44:17 +0100 |
Signed-off-by: Max Reitz <address@hidden>
Reviewed-by: Vladimir Sementsov-Ogievskiy <address@hidden>
---
block/blkverify.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/block/blkverify.c b/block/blkverify.c
index 304b0a1368..0add3ab483 100644
--- a/block/blkverify.c
+++ b/block/blkverify.c
@@ -282,6 +282,20 @@ static bool
blkverify_recurse_is_first_non_filter(BlockDriverState *bs,
return bdrv_recurse_is_first_non_filter(s->test_file->bs, candidate);
}
+static bool blkverify_recurse_can_replace(BlockDriverState *bs,
+ BlockDriverState *to_replace)
+{
+ BDRVBlkverifyState *s = bs->opaque;
+
+ /*
+ * blkverify quits the whole qemu process if there is a mismatch
+ * between bs->file->bs and s->test_file->bs. Therefore, we know
+ * know that both must match bs and we can recurse down to either.
+ */
+ return bdrv_recurse_can_replace(bs->file->bs, to_replace) ||
+ bdrv_recurse_can_replace(s->test_file->bs, to_replace);
+}
+
static void blkverify_refresh_filename(BlockDriverState *bs)
{
BDRVBlkverifyState *s = bs->opaque;
@@ -328,6 +342,7 @@ static BlockDriver bdrv_blkverify = {
.is_filter = true,
.bdrv_recurse_is_first_non_filter = blkverify_recurse_is_first_non_filter,
+ .bdrv_recurse_can_replace = blkverify_recurse_can_replace,
};
static void bdrv_blkverify_init(void)
--
2.24.1
- [PATCH v3 00/21] block: Fix check_to_replace_node(), Max Reitz, 2020/01/30
- [PATCH v3 02/21] blockdev: Allow resizing everywhere, Max Reitz, 2020/01/30
- [PATCH v3 01/21] blockdev: Allow external snapshots everywhere, Max Reitz, 2020/01/30
- [PATCH v3 04/21] iotests: Let 041 use -blockdev for quorum children, Max Reitz, 2020/01/30
- [PATCH v3 03/21] block: Drop bdrv_is_first_non_filter(), Max Reitz, 2020/01/30
- [PATCH v3 05/21] quorum: Fix child permissions, Max Reitz, 2020/01/30
- [PATCH v3 07/21] blkverify: Implement .bdrv_recurse_can_replace(),
Max Reitz <=
- [PATCH v3 06/21] block: Add bdrv_recurse_can_replace(), Max Reitz, 2020/01/30
- [PATCH v3 08/21] quorum: Store children in own structure, Max Reitz, 2020/01/30
- [PATCH v3 09/21] quorum: Add QuorumChild.to_be_replaced, Max Reitz, 2020/01/30
- [PATCH v3 10/21] quorum: Implement .bdrv_recurse_can_replace(), Max Reitz, 2020/01/30
- [PATCH v3 11/21] block: Use bdrv_recurse_can_replace(), Max Reitz, 2020/01/30
- [PATCH v3 12/21] block: Remove bdrv_recurse_is_first_non_filter(), Max Reitz, 2020/01/30
- [PATCH v3 13/21] mirror: Double-check immediately before replacing, Max Reitz, 2020/01/30
- [PATCH v3 14/21] quorum: Stop marking it as a filter, Max Reitz, 2020/01/30
- [PATCH v3 16/21] iotests: Add VM.assert_block_path(), Max Reitz, 2020/01/30
- [PATCH v3 15/21] iotests: Use complete_and_wait() in 155, Max Reitz, 2020/01/30