qemu/tests/qemu-iotests
Kevin Wolf d29d3d1f80 block: Relax restrictions for blockdev-snapshot
blockdev-snapshot returned an error if the overlay was already in use,
which it defined as having any BlockBackend parent. This is in fact both
too strict (some parents can tolerate the change of visible data caused
by attaching a backing file) and too loose (some non-BlockBackend
parents may not be happy with it).

One important use case that is prevented by the too strict check is live
storage migration with blockdev-mirror. Here, the target node is
usually opened without a backing file so that the active layer is
mirrored while its backing chain can be copied in the background.

The backing chain should be attached to the mirror target node when
finalising the job, just before switching the users of the source node
to the new copy (at which point the mirror job still has a reference to
the node). drive-mirror did this automatically, but with blockdev-mirror
this is the job of the QMP client, so it needs a way to do this.

blockdev-snapshot is the obvious way, so this patch makes it work in
this scenario. The new condition is that no parent uses CONSISTENT_READ
permissions. This will ensure that the operation will still be blocked
when the node is attached to the guest device, so blockdev-snapshot
remains safe.

(For the sake of completeness, x-blockdev-reopen can be used to achieve
the same, however it is a big hammer, performs the graph change
completely unchecked and is still experimental. So even with the option
of using x-blockdev-reopen, there are reasons why blockdev-snapshot
should be able to perform this operation.)

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Message-Id: <20200310113831.27293-3-kwolf@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Tested-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2020-03-11 15:54:38 +01:00
..
2019-10-14 17:12:48 +02:00
2020-01-06 13:43:06 +01:00
2019-07-30 12:25:43 +02:00
2019-11-19 10:01:34 +01:00
052
2019-09-03 14:56:06 +02:00
063
2020-01-06 13:43:07 +01:00
2020-01-06 13:43:07 +01:00
079
2020-01-06 13:43:07 +01:00
2019-07-12 15:42:23 +02:00
083
2019-10-28 11:22:31 +01:00
085
2020-01-06 13:43:07 +01:00
2020-01-06 13:43:07 +01:00
106
2020-01-06 13:43:07 +01:00
110
2020-01-06 13:43:07 +01:00
2020-01-06 13:43:07 +01:00
111
2020-01-06 13:43:07 +01:00
115
2020-01-06 13:43:07 +01:00
2019-08-16 10:25:16 +02:00
125
2020-01-06 13:43:07 +01:00
137
2020-01-06 13:43:07 +01:00
2020-01-06 13:43:07 +01:00
2019-05-07 17:14:21 +02:00
140
2019-10-28 11:22:31 +01:00
143
2019-10-28 11:22:31 +01:00
147
2020-02-20 16:43:42 +01:00
155
2020-02-18 11:55:40 +01:00
162
2019-10-10 12:13:23 +02:00
2019-10-10 12:13:23 +02:00
174
2020-01-06 13:43:07 +01:00
175
2020-01-06 13:43:07 +01:00
192
2019-10-28 11:22:31 +01:00
198
2020-01-06 13:43:07 +01:00
2020-01-06 13:43:07 +01:00
2019-06-24 16:01:04 +02:00
222
2020-02-07 15:15:16 +01:00
2019-10-10 10:56:18 +02:00
2019-02-25 15:11:27 +01:00
2019-03-19 15:49:29 +01:00
233
2019-06-13 08:50:47 -05:00
2019-02-01 13:46:44 +01:00
2019-02-01 13:46:44 +01:00
240
2019-10-28 11:22:31 +01:00
2019-03-19 15:49:29 +01:00
2019-06-04 16:55:58 +02:00
2019-08-16 16:28:03 -04:00
263
2019-09-16 15:37:12 +02:00
2019-09-16 15:37:12 +02:00
2019-10-22 20:51:31 -05:00
265
2020-01-06 13:43:07 +01:00
2019-11-18 16:01:31 -06:00
279
2020-02-20 16:43:42 +01:00
286
2020-02-20 16:43:42 +01:00
2020-02-18 11:55:41 +01:00

=== This is the QEMU I/O test suite ===

* Intro

This package contains a simple test suite for the I/O layer of qemu.
It does not require a guest, but only the qemu, qemu-img and qemu-io
binaries.  This does limit it to exercise the low-level I/O path only
but no actual block drivers like ide, scsi or virtio.

* Usage

Just run ./check to run all tests for the raw image format, or ./check
-qcow2 to test the qcow2 image format.  The output of ./check -h explains
additional options to test further image formats or I/O methods.

* Feedback and patches

Please send improvements to the test suite, general feedback or just
reports of failing tests cases to qemu-devel@nongnu.org with a CC:
to qemu-block@nongnu.org.