diff options
author | Kevin Wolf <kwolf@redhat.com> | 2015-09-16 13:34:54 +0200 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2015-10-16 15:34:30 +0200 |
commit | 8ccb9569a976056c9594bb720ba33d84827648d9 (patch) | |
tree | 9f7114320fd8728d8164ad92efa425a1a3af246d /block | |
parent | dd62f1ca433ea60b06590884642ad2c8f8e539f2 (diff) |
blockjob: Store device name at job creation
Some block jobs change the block device graph on completion. This means
that the device that owns the job and originally was addressed with its
device name may no longer be what the corresponding BlockBackend points
to.
Previously, the effects of bdrv_swap() ensured that the job was (at
least partially) transferred to the target image. Events that contain
the device name could still use bdrv_get_device_name(job->bs) and get
the same result.
After removing bdrv_swap(), this won't work any more. Instead, save the
device name at job creation and use that copy for QMP events and
anything else identifying the job.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Alberto Garcia <berto@igalia.com>
Reviewed-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'block')
-rw-r--r-- | block/mirror.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/block/mirror.c b/block/mirror.c index 6247b27612..c277691e4d 100644 --- a/block/mirror.c +++ b/block/mirror.c @@ -645,8 +645,7 @@ static void mirror_complete(BlockJob *job, Error **errp) return; } if (!s->synced) { - error_setg(errp, QERR_BLOCK_JOB_NOT_READY, - bdrv_get_device_name(job->bs)); + error_setg(errp, QERR_BLOCK_JOB_NOT_READY, job->id); return; } |