blockjob: Store device name at job creation
authorKevin Wolf <kwolf@redhat.com>
Wed, 16 Sep 2015 11:34:54 +0000 (13:34 +0200)
committerKevin Wolf <kwolf@redhat.com>
Fri, 16 Oct 2015 13:34:30 +0000 (15:34 +0200)
commit8ccb9569a976056c9594bb720ba33d84827648d9
tree9f7114320fd8728d8164ad92efa425a1a3af246d
parentdd62f1ca433ea60b06590884642ad2c8f8e539f2
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>
block/mirror.c
blockjob.c
include/block/blockjob.h