[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v3 01/25] block/mirror: Small absolute-paths simplif
From: |
Max Reitz |
Subject: |
[Qemu-devel] [PATCH v3 01/25] block/mirror: Small absolute-paths simplification |
Date: |
Wed, 30 Nov 2016 02:18:27 +0100 |
When invoking drive-mirror in absolute-paths mode, the target's backing
BDS is assigned to it in mirror_complete(). The current logic only does
so if the target does not have that backing BDS already; but it actually
cannot have a backing BDS at all (the BDS is opened with O_NO_BACKING in
qmp_drive_mirror()), so just assert that and assign the new backing BDS
unconditionally.
Signed-off-by: Max Reitz <address@hidden>
---
block/mirror.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/block/mirror.c b/block/mirror.c
index 301ba92..4ece624 100644
--- a/block/mirror.c
+++ b/block/mirror.c
@@ -888,9 +888,9 @@ static void mirror_complete(BlockJob *job, Error **errp)
if (s->backing_mode == MIRROR_SOURCE_BACKING_CHAIN) {
BlockDriverState *backing = s->is_none_mode ? src : s->base;
- if (backing_bs(target) != backing) {
- bdrv_set_backing_hd(target, backing);
- }
+
+ assert(!target->backing);
+ bdrv_set_backing_hd(target, backing);
}
s->should_complete = true;
--
2.10.2
- [Qemu-devel] [PATCH v3 00/25] block: Fix some filename generation issues, Max Reitz, 2016/11/29
- [Qemu-devel] [PATCH v3 01/25] block/mirror: Small absolute-paths simplification,
Max Reitz <=
- [Qemu-devel] [PATCH v3 02/25] block: Use children list in bdrv_refresh_filename, Max Reitz, 2016/11/29
- [Qemu-devel] [PATCH v3 03/25] block: Add BDS.backing_overridden, Max Reitz, 2016/11/29
- [Qemu-devel] [PATCH v3 06/25] block: bdrv_get_full_backing_filename_from_...'s ret. val., Max Reitz, 2016/11/29
- [Qemu-devel] [PATCH v3 05/25] block: Make path_combine() return the path, Max Reitz, 2016/11/29
- [Qemu-devel] [PATCH v3 07/25] block: bdrv_get_full_backing_filename's ret. val., Max Reitz, 2016/11/29
- [Qemu-devel] [PATCH v3 08/25] block: Add bdrv_make_absolute_filename(), Max Reitz, 2016/11/29
- [Qemu-devel] [PATCH v3 04/25] block: Respect backing bs in bdrv_refresh_filename, Max Reitz, 2016/11/29
- [Qemu-devel] [PATCH v3 09/25] block: Fix bdrv_find_backing_image(), Max Reitz, 2016/11/29
- [Qemu-devel] [PATCH v3 10/25] block: Add bdrv_dirname(), Max Reitz, 2016/11/29
- [Qemu-devel] [PATCH v3 13/25] block/nbd: Implement bdrv_dirname(), Max Reitz, 2016/11/29