qemu/block
Kevin Wolf 86fae10c64 mirror: Fail gracefully for source == target
blockdev-mirror with the same node for source and target segfaults
today: A node is in its own backing chain, so mirror_start_job() decides
that this is an active commit. When adding the intermediate nodes with
block_job_add_bdrv(), it starts the iteration through the subchain with
the backing file of source, though, so it never reaches target and
instead runs into NULL at the base.

While we could fix that by starting with source itself, there is no
point in allowing mirroring a node into itself and I wouldn't be
surprised if this caused more problems later.

So just check for this scenario and error out.

Cc: qemu-stable@nongnu.org
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
2018-08-15 12:50:39 +02:00
..
accounting.c
backup.c block: Fix typos in comments (found by codespell) 2018-07-23 16:50:43 +02:00
blkdebug.c qstring: Move qstring_from_substr()'s @end one to the right 2018-07-28 09:09:58 +02:00
blklogwrites.c block: Use BdrvChild to discard 2018-07-10 16:01:52 +02:00
blkreplay.c block: Use BdrvChild to discard 2018-07-10 16:01:52 +02:00
blkverify.c qstring: Move qstring_from_substr()'s @end one to the right 2018-07-28 09:09:58 +02:00
block-backend.c block: Remove deprecated -drive option serial 2018-08-15 12:50:39 +02:00
bochs.c
cloop.c
commit.c
copy-on-read.c block: Use BdrvChild to discard 2018-07-10 16:01:52 +02:00
create.c
crypto.c luks: Allow share-rw=on 2018-08-15 12:50:39 +02:00
crypto.h block/crypto: Simplify block_crypto_{open,create}_opts_init() 2018-06-29 14:20:56 +02:00
curl.c block: Fix typos in comments (found by codespell) 2018-07-23 16:50:43 +02:00
dirty-bitmap.c dirty-bitmap: fix double lock on bitmap enabling 2018-07-04 02:12:49 -04:00
dmg-bz2.c
dmg.c
dmg.h
file-posix.c file-posix: Fix write_zeroes with unmap on block devices 2018-07-30 15:35:37 +02:00
file-win32.c block: Prefix file driver trace points with "file_" 2018-07-10 16:01:51 +02:00
gluster.c block: Fix typos in comments (found by codespell) 2018-07-23 16:50:43 +02:00
io.c block: Use common write req handling in truncate 2018-07-10 16:46:22 +02:00
iscsi-opts.c
iscsi.c block: Add copy offloading trace points 2018-07-10 16:01:52 +02:00
linux-aio.c linux-aio: properly bubble up errors from initialization 2018-06-27 13:06:34 +01:00
Makefile.objs block: Add blklogwrites 2018-07-05 10:29:19 +02:00
mirror.c mirror: Fail gracefully for source == target 2018-08-15 12:50:39 +02:00
nbd-client.c nbd/client: Add x-dirty-bitmap to query bitmap from server 2018-07-02 15:27:38 -05:00
nbd-client.h nbd/client: Add x-dirty-bitmap to query bitmap from server 2018-07-02 15:27:38 -05:00
nbd.c qstring: Move qstring_from_substr()'s @end one to the right 2018-07-28 09:09:58 +02:00
nfs.c block: Convert .bdrv_truncate callback to coroutine_fn 2018-06-29 14:20:56 +02:00
null.c
nvme.c
parallels.c parallels: Switch to byte-based calls 2018-06-29 14:20:56 +02:00
parallels.h
qapi.c block/qapi: Fix memory leak in qmp_query_blockstats() 2018-08-15 12:50:39 +02:00
qcow.c qcow: fix a reference leak 2018-07-30 15:35:37 +02:00
qcow2-bitmap.c qcow2: add overlap check for bitmap directory 2018-07-09 19:43:24 +02:00
qcow2-cache.c
qcow2-cluster.c qcow2: Free allocated clusters on write error 2018-06-29 14:20:56 +02:00
qcow2-refcount.c Block layer patches: 2018-07-10 17:28:29 +01:00
qcow2-snapshot.c
qcow2.c qcow2: A grammar fix in conflicting cache sizing error message 2018-07-30 15:35:37 +02:00
qcow2.h qcow2: add overlap check for bitmap directory 2018-07-09 19:43:24 +02:00
qed-check.c
qed-cluster.c
qed-l2-cache.c
qed-table.c
qed.c block: Convert .bdrv_truncate callback to coroutine_fn 2018-06-29 14:20:56 +02:00
qed.h
quorum.c block: Add block-specific QDict header 2018-06-15 14:49:44 +02:00
raw-format.c Block layer patches: 2018-07-10 17:28:29 +01:00
rbd.c block: Convert .bdrv_truncate callback to coroutine_fn 2018-06-29 14:20:56 +02:00
replication.c replication: Switch to byte-based calls 2018-06-29 14:20:56 +02:00
sheepdog.c block: Convert .bdrv_truncate callback to coroutine_fn 2018-06-29 14:20:56 +02:00
snapshot.c block: Add block-specific QDict header 2018-06-15 14:49:44 +02:00
ssh.c block: Convert .bdrv_truncate callback to coroutine_fn 2018-06-29 14:20:56 +02:00
stream.c
throttle-groups.c throttle-groups: Don't allow timers without throttled requests 2018-08-15 12:50:39 +02:00
throttle.c block: Use BdrvChild to discard 2018-07-10 16:01:52 +02:00
trace-events block: Add copy offloading trace points 2018-07-10 16:01:52 +02:00
vdi.c vdi: Use definitions from "qemu/units.h" 2018-07-02 14:45:23 +02:00
vhdx-endian.c
vhdx-log.c
vhdx.c block: Fix typos in comments (found by codespell) 2018-07-23 16:50:43 +02:00
vhdx.h
vmdk.c vmdk: Fix possible segfault with non-VMDK backing 2018-07-09 19:43:24 +02:00
vpc.c block: Factor out qobject_input_visitor_new_flat_confused() 2018-06-15 14:49:44 +02:00
vvfat.c block/vvfat: Disable debug message by default 2018-07-23 16:50:43 +02:00
vxhs.c block: Add block-specific QDict header 2018-06-15 14:49:44 +02:00
win32-aio.c
write-threshold.c