[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 07/10] mirror: Move open_backing_file to exit_common
From: |
Kevin Wolf |
Subject: |
[PULL 07/10] mirror: Move open_backing_file to exit_common |
Date: |
Fri, 9 Apr 2021 18:15:45 +0200 |
From: Max Reitz <mreitz@redhat.com>
This is a graph change and therefore should be done in job-finalize
(which is what invokes mirror_exit_common()).
Signed-off-by: Max Reitz <mreitz@redhat.com>
Message-Id: <20210409120422.144040-2-mreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
block/mirror.c | 22 ++++++++--------------
1 file changed, 8 insertions(+), 14 deletions(-)
diff --git a/block/mirror.c b/block/mirror.c
index d7e54c0ff7..f1f936bf1a 100644
--- a/block/mirror.c
+++ b/block/mirror.c
@@ -689,6 +689,14 @@ static int mirror_exit_common(Job *job)
ret = -EPERM;
}
}
+ } else if (!abort && s->backing_mode == MIRROR_OPEN_BACKING_CHAIN) {
+ assert(!bdrv_backing_chain_next(target_bs));
+ ret = bdrv_open_backing_file(bdrv_skip_filters(target_bs), NULL,
+ "backing", &local_err);
+ if (ret < 0) {
+ error_report_err(local_err);
+ local_err = NULL;
+ }
}
if (s->to_replace) {
@@ -1107,9 +1115,6 @@ immediate_exit:
static void mirror_complete(Job *job, Error **errp)
{
MirrorBlockJob *s = container_of(job, MirrorBlockJob, common.job);
- BlockDriverState *target;
-
- target = blk_bs(s->target);
if (!s->synced) {
error_setg(errp, "The active block job '%s' cannot be completed",
@@ -1117,17 +1122,6 @@ static void mirror_complete(Job *job, Error **errp)
return;
}
- if (s->backing_mode == MIRROR_OPEN_BACKING_CHAIN) {
- int ret;
-
- assert(!bdrv_backing_chain_next(target));
- ret = bdrv_open_backing_file(bdrv_skip_filters(target), NULL,
- "backing", errp);
- if (ret < 0) {
- return;
- }
- }
-
/* block all operations on to_replace bs */
if (s->replaces) {
AioContext *replace_aio_context;
--
2.30.2
- [PULL 00/10] Block layer fixes for 6.0-rc3, Kevin Wolf, 2021/04/09
- [PULL 01/10] block/rbd: fix memory leak in qemu_rbd_connect(), Kevin Wolf, 2021/04/09
- [PULL 02/10] block/rbd: fix memory leak in qemu_rbd_co_create_opts(), Kevin Wolf, 2021/04/09
- [PULL 03/10] iotests/qsd-jobs: Filter events in the first test, Kevin Wolf, 2021/04/09
- [PULL 04/10] iotests: add test for removing persistent bitmap from backing file, Kevin Wolf, 2021/04/09
- [PULL 09/10] job: Allow complete for jobs on standby, Kevin Wolf, 2021/04/09
- [PULL 07/10] mirror: Move open_backing_file to exit_common,
Kevin Wolf <=
- [PULL 06/10] hw/block/fdc: Fix 'fallback' property on sysbus floppy disk controllers, Kevin Wolf, 2021/04/09
- [PULL 08/10] mirror: Do not enter a paused job on completion, Kevin Wolf, 2021/04/09
- [PULL 05/10] iotests: Test mirror-top filter permissions, Kevin Wolf, 2021/04/09
- [PULL 10/10] test-blockjob: Test job_wait_unpaused(), Kevin Wolf, 2021/04/09
- Re: [PULL 00/10] Block layer fixes for 6.0-rc3, Peter Maydell, 2021/04/10