Block patches for 2.11.0-rc1
The following changes since commit 191b5fbfa66e5b23e2150f3c6981d30eb84418a9:
Merge remote-tracking branch 'remotes/stefanha/tags/block-pull-request' into staging (2017-11-14 16:11:19 +0000)
are available in the git repository at:
git://github.com/XanClic/qemu.git tags/pull-block-2017-11-14
for you to fetch changes up to 8b2d7c364d9a2491f7501f6688cd722045cf808a:
qemu-iotests: update unsupported image formats in 194 (2017-11-14 18:06:26 +0100)
----------------------------------------------------------------
Block patches for 2.11.0-rc1
----------------------------------------------------------------
Alberto Garcia (8):
qcow2: Prevent allocating refcount blocks at offset 0
qcow2: Prevent allocating L2 tables at offset 0
qcow2: Prevent allocating compressed clusters at offset 0
qcow2: Don't open images with header.refcount_table_clusters == 0
qcow2: Add iotest for an image with header.refcount_table_offset == 0
qcow2: Add iotest for an empty refcount table
qcow2: Assert that the crypto header does not overlap other metadata
qcow2: Check that corrupted images can be repaired in iotest 060
Eric Blake (1):
iotests: Use new-style NBD connections
Fam Zheng (1):
iotests: 077: Filter out 'resume' lines
Jeff Cody (4):
block/vhdx.c: Don't blindly update the header block/parallels: Do not update header or truncate image when INMIGRATE block/parallels: add migration blocker
qemu-iotests: update unsupported image formats in 194
Max Reitz (5):
iotests: Make 030 less flaky
iotests: Add missing 'blkdebug::' in 040
iotests: Make 055 less flaky
iotests: Make 083 less flaky
iotests: Make 136 less flaky
Vladimir Sementsov-Ogievskiy (1):
block/snapshot: dirty all dirty bitmaps on snapshot-switch
block/parallels.c | 22 ++++++--- block/qcow2-cluster.c | 8 ++++ block/qcow2-refcount.c | 14 ++++++ block/qcow2.c | 7 +++ block/snapshot.c | 14 ++++++ block/vhdx.c | 7 --- tests/qemu-iotests/030 | 8 +++- tests/qemu-iotests/040 | 2 +- tests/qemu-iotests/055 | 25 +++++++---- tests/qemu-iotests/060 | 59 +++++++++++++++++++++++++ tests/qemu-iotests/060.out | 103 +++++++++++++++++++++++++++++++++++++++++++ tests/qemu-iotests/077 | 3 +- tests/qemu-iotests/077.out | 16 ------- tests/qemu-iotests/083 | 4 +- tests/qemu-iotests/136 | 14 +++++- tests/qemu-iotests/194 | 2 +- tests/qemu-iotests/common.rc | 2 +- 17 files changed, 265 insertions(+), 45 deletions(-)
Signature · 1 line
2.13.6
[Qemu-devel] [PULL 01/20] qcow2: Prevent allocating refcount blocks at offset 0
From: Alberto Garcia <[email protected]>
Each entry in the qcow2 cache contains an offset field indicating the location of the data in the qcow2 image. If the offset is 0 then it means that the entry contains no data and is available to be used when needed.
Because of that it is not possible to store in the cache the first cluster of the qcow2 image (offset = 0). This is not a problem because that cluster always contains the qcow2 header and we're not using this cache for that.
However, if the qcow2 image is corrupted it can happen that we try to allocate a new refcount block at offset 0, triggering this assertion and crashing QEMU:
qcow2_cache_entry_mark_dirty: Assertion `c->entries[i].offset != 0' failed
This patch adds an explicit check for this scenario and a new test case.
This problem was originally reported here:
https://bugs.launchpad.net/qemu/+bug/1728615
Message-id: 92a2fadd10d58b423f269c1d1a309af161cdc73f.1509718618.git.berto@igalia.com
--- block/qcow2-refcount.c | 7 +++++++ tests/qemu-iotests/060 | 11 +++++++++++ tests/qemu-iotests/060.out | 8 ++++++++ 3 files changed, 26 insertions(+)
block/qcow2-refcount.c +7 -0
@@ -367,6 +367,13 @@ static int alloc_refcount_block(BlockDriverState *bs,return new_block; } +/* If we're allocating the block at offset 0 then something is wrong */ +if (new_block ==0 ) { +qcow2_signal_corruption (bs, true,-1 ,-1 ,"Preventing invalid " +"allocation of refcount block at offset 0" ); +return -EIO ; + } +#ifdef DEBUG_ALLOC2 fprintf(stderr, "qcow2: Allocate refcount block %d for %" PRIx64 " at %" PRIx64 "\n",
tests/qemu-iotests/060 +11 -0
@@ -242,6 +242,17 @@ poke_file "$TEST_IMG" "$(($l2_offset+8))" "\x80\x00\x00\x00\x00\x06\x2a\x00" # Should emit two error messages $QEMU_IO -c "discard 0 64k" -c "read 64k 64k" "$TEST_IMG" | _filter_qemu_io +echo +echo "=== Testing empty refcount table with valid L1 and L2 tables ===" +echo +_make_test_img 64M +$QEMU_IO -c "write 0 64k" "$TEST_IMG" | _filter_qemu_io +poke_file "$TEST_IMG" "$rt_offset" "\x00\x00\x00\x00\x00\x00\x00\x00" +# Since the first data cluster is already allocated this triggers an +# allocation with an explicit offset (using qcow2_alloc_clusters_at()) +# causing a refcount block to be allocated at offset 0 +$QEMU_IO -c "write 0 128k" "$TEST_IMG" | _filter_qemu_io + # success, all done echo "*** done" rm -f $seq.full
tests/qemu-iotests/060.out +8 -0
@@ -181,4 +181,12 @@ qcow2: Marking image as corrupt: Cluster allocation offset 0x62a00 unaligned (L2 discard 65536/65536 bytes at offset 0 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) read failed: Input/output error + +=== Testing empty refcount table with valid L1 and L2 tables === + +Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 +wrote 65536/65536 bytes at offset 0 +64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +qcow2: Marking image as corrupt: Preventing invalid allocation of refcount block at offset 0; further corruption events will be suppressed +write failed: Input/output error *** done
Signature · 1 line
2.13.6
[Qemu-devel] [PULL 02/20] qcow2: Prevent allocating L2 tables at offset 0
In reply to Max ReitzFrom: Alberto Garcia <[email protected]>
If the refcount data is corrupted then we can end up trying to allocate a new L2 table at offset 0 in the image, triggering an assertion in the qcow2 cache that would crash QEMU:
qcow2_cache_entry_mark_dirty: Assertion `c->entries[i].offset != 0' failed
This patch adds an explicit check for this scenario and a new test case.
Message-id: 92dac37191ae7844a2da22c122204eb493cc3133.1509718618.git.berto@igalia.com
--- block/qcow2-cluster.c | 8 ++++++++ tests/qemu-iotests/060 | 7 +++++++ tests/qemu-iotests/060.out | 6 ++++++ 3 files changed, 21 insertions(+)
block/qcow2-cluster.c +8 -0
@@ -278,6 +278,14 @@ static int l2_allocate(BlockDriverState *bs, int l1_index, uint64_t **table) goto fail; } +/* If we're allocating the table at offset 0 then something is wrong */ +if (l2_offset ==0 ) { +qcow2_signal_corruption (bs, true,-1 ,-1 ,"Preventing invalid " +"allocation of L2 table at offset 0" ); + ret = -EIO ; + goto fail; + } + ret =qcow2_cache_flush (bs, s->refcount_block_cache);if (ret <0 ) { goto fail;
tests/qemu-iotests/060 +7 -0
@@ -253,6 +253,13 @@ poke_file "$TEST_IMG" "$rt_offset" "\x00\x00\x00\x00\x00\x00\x00\x00" # causing a refcount block to be allocated at offset 0 $QEMU_IO -c "write 0 128k" "$TEST_IMG" | _filter_qemu_io +echo +echo "=== Testing empty refcount block ===" +echo +_make_test_img 64M +poke_file "$TEST_IMG" "$rb_offset" "\x00\x00\x00\x00\x00\x00\x00\x00" +$QEMU_IO -c "write 0 64k" "$TEST_IMG" | _filter_qemu_io + # success, all done echo "*** done" rm -f $seq.full
tests/qemu-iotests/060.out +6 -0
@@ -189,4 +189,10 @@ wrote 65536/65536 bytes at offset 0 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) qcow2: Marking image as corrupt: Preventing invalid allocation of refcount block at offset 0; further corruption events will be suppressed write failed: Input/output error + +=== Testing empty refcount block === + +Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 +qcow2: Marking image as corrupt: Preventing invalid allocation of L2 table at offset 0; further corruption events will be suppressed +write failed: Input/output error *** done
Signature · 1 line
2.13.6
[Qemu-devel] [PULL 03/20] qcow2: Prevent allocating compressed clusters at offset 0
In reply to Max ReitzFrom: Alberto Garcia <[email protected]>
If the refcount data is corrupted then we can end up trying to allocate a new compressed cluster at offset 0 in the image, triggering an assertion in qcow2_alloc_bytes() that would crash QEMU:
qcow2_alloc_bytes: Assertion `offset' failed.
This patch adds an explicit check for this scenario and a new test case.
Message-id: fb53467cf48e95ff3330def1cf1003a5b862b7d9.1509718618.git.berto@igalia.com
--- block/qcow2-refcount.c | 7 +++++++ tests/qemu-iotests/060 | 10 ++++++++++ tests/qemu-iotests/060.out | 8 ++++++++ 3 files changed, 25 insertions(+)
block/qcow2-refcount.c +7 -0
@@ -1082,6 +1082,13 @@ int64_t qcow2_alloc_bytes(BlockDriverState *bs, int size)return new_cluster; } +if (new_cluster ==0 ) { +qcow2_signal_corruption (bs, true,-1 ,-1 ,"Preventing invalid " +"allocation of compressed cluster " +"at offset 0" ); +return -EIO ; + } +if (!offset ||ROUND_UP (offset, s->cluster_size) != new_cluster) { offset = new_cluster; free_in_cluster = s->cluster_size;
tests/qemu-iotests/060 +10 -0
@@ -260,6 +260,16 @@ _make_test_img 64M poke_file "$TEST_IMG" "$rb_offset" "\x00\x00\x00\x00\x00\x00\x00\x00" $QEMU_IO -c "write 0 64k" "$TEST_IMG" | _filter_qemu_io +echo +echo "=== Testing empty refcount block with compressed write ===" +echo +_make_test_img 64M +$QEMU_IO -c "write 64k 64k" "$TEST_IMG" | _filter_qemu_io +poke_file "$TEST_IMG" "$rb_offset" "\x00\x00\x00\x00\x00\x00\x00\x00" +# The previous write already allocated an L2 table, so now this new +# write will try to allocate a compressed data cluster at offset 0. +$QEMU_IO -c "write -c 0k 64k" "$TEST_IMG" | _filter_qemu_io + # success, all done echo "*** done" rm -f $seq.full
tests/qemu-iotests/060.out +8 -0
@@ -195,4 +195,12 @@ write failed: Input/output error Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 qcow2: Marking image as corrupt: Preventing invalid allocation of L2 table at offset 0; further corruption events will be suppressed write failed: Input/output error + +=== Testing empty refcount block with compressed write === + +Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 +wrote 65536/65536 bytes at offset 65536 +64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +qcow2: Marking image as corrupt: Preventing invalid allocation of compressed cluster at offset 0; further corruption events will be suppressed +write failed: Input/output error *** done
Signature · 1 line
2.13.6
[Qemu-devel] [PULL 04/20] qcow2: Don't open images with header.refcount_table_clusters == 0
In reply to Max ReitzFrom: Alberto Garcia <[email protected]>
qcow2_do_open() is checking that header.refcount_table_clusters is not too large, but it doesn't check that it's greater than zero. Apart from the fact that an image like that is obviously corrupted, trying to use it crashes QEMU since we end up with a null s->refcount_table after qcow2_refcount_init().
These images can however be repaired, so allow opening them if the BDRV_O_CHECK flag is set.
Message-id: f9750f50c80359babba11062e88f5075a47e8e16.1509718618.git.berto@igalia.com
--- block/qcow2.c | 6 ++++++ tests/qemu-iotests/060 | 7 +++++++ tests/qemu-iotests/060.out | 5 +++++ 3 files changed, 18 insertions(+)
block/qcow2.c +6 -0
@@ -1280,6 +1280,12 @@ static int qcow2_do_open(BlockDriverState *bs, QDict *options, int flags, goto fail; } +if (header.refcount_table_clusters ==0 && !(flags &BDRV_O_CHECK )) { +error_setg (errp,"Image does not contain a reference count table" ); + ret = -EINVAL ; + goto fail; + } + ret =validate_table_offset (bs, s->refcount_table_offset, s->refcount_table_size,sizeof (uint64_t ));if (ret <0 ) {
tests/qemu-iotests/060 +7 -0
@@ -270,6 +270,13 @@ poke_file "$TEST_IMG" "$rb_offset" "\x00\x00\x00\x00\x00\x00\x00\x00" # write will try to allocate a compressed data cluster at offset 0. $QEMU_IO -c "write -c 0k 64k" "$TEST_IMG" | _filter_qemu_io +echo +echo "=== Testing zero refcount table size ===" +echo +_make_test_img 64M +poke_file "$TEST_IMG" "56" "\x00\x00\x00\x00" +$QEMU_IO -c "write 0 64k" "$TEST_IMG" 2>&1 | _filter_testdir | _filter_imgfmt + # success, all done echo "*** done" rm -f $seq.full
tests/qemu-iotests/060.out +5 -0
@@ -203,4 +203,9 @@ wrote 65536/65536 bytes at offset 65536 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) qcow2: Marking image as corrupt: Preventing invalid allocation of compressed cluster at offset 0; further corruption events will be suppressed write failed: Input/output error + +=== Testing zero refcount table size === + +Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 +can't open device TEST_DIR/t.IMGFMT: Image does not contain a reference count table *** done
Signature · 1 line
2.13.6
[Qemu-devel] [PULL 05/20] qcow2: Add iotest for an image with header.refcount_table_offset == 0
In reply to Max ReitzFrom: Alberto Garcia <[email protected]>
This patch adds a simple iotest in which we try to write to an image with the refcount table offset set to 0.
This scenario was already handled by the existing consistency checks, but we add an explicit test case for completeness.
Message-id: feeceada92486bb8790b90f303fc9fe82a27391a.1509718618.git.berto@igalia.com
--- tests/qemu-iotests/060 | 7 +++++++ tests/qemu-iotests/060.out | 6 ++++++ 2 files changed, 13 insertions(+)
tests/qemu-iotests/060 +7 -0
@@ -277,6 +277,13 @@ _make_test_img 64M poke_file "$TEST_IMG" "56" "\x00\x00\x00\x00" $QEMU_IO -c "write 0 64k" "$TEST_IMG" 2>&1 | _filter_testdir | _filter_imgfmt +echo +echo "=== Testing incorrect refcount table offset ===" +echo +_make_test_img 64M +poke_file "$TEST_IMG" "48" "\x00\x00\x00\x00\x00\x00\x00\x00" +$QEMU_IO -c "write 0 64k" "$TEST_IMG" | _filter_qemu_io + # success, all done echo "*** done" rm -f $seq.full
tests/qemu-iotests/060.out +6 -0
@@ -208,4 +208,10 @@ write failed: Input/output error Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 can't open device TEST_DIR/t.IMGFMT: Image does not contain a reference count table + +=== Testing incorrect refcount table offset === + +Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 +qcow2: Marking image as corrupt: Preventing invalid allocation of L2 table at offset 0; further corruption events will be suppressed +write failed: Input/output error *** done
Signature · 1 line
2.13.6
[Qemu-devel] [PULL 06/20] qcow2: Add iotest for an empty refcount table
In reply to Max ReitzFrom: Alberto Garcia <[email protected]>
This patch adds a simple iotest in which we try to write to an image with an empty refcount table (i.e. with all entries set to 0).
This scenario was already handled by the existing consistency checks, but we add an explicit test case for completeness.
Message-id: 7e48b0e2ae1a0a18e0ee303b3045f130feec0474.1509718618.git.berto@igalia.com
--- tests/qemu-iotests/060 | 7 +++++++ tests/qemu-iotests/060.out | 6 ++++++ 2 files changed, 13 insertions(+)
tests/qemu-iotests/060 +7 -0
@@ -243,6 +243,13 @@ poke_file "$TEST_IMG" "$(($l2_offset+8))" "\x80\x00\x00\x00\x00\x06\x2a\x00" $QEMU_IO -c "discard 0 64k" -c "read 64k 64k" "$TEST_IMG" | _filter_qemu_io echo +echo "=== Testing empty refcount table ===" +echo +_make_test_img 64M +poke_file "$TEST_IMG" "$rt_offset" "\x00\x00\x00\x00\x00\x00\x00\x00" +$QEMU_IO -c "write 0 64k" "$TEST_IMG" | _filter_qemu_io + +echo echo "=== Testing empty refcount table with valid L1 and L2 tables ===" echo _make_test_img 64M
tests/qemu-iotests/060.out +6 -0
@@ -182,6 +182,12 @@ discard 65536/65536 bytes at offset 0 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) read failed: Input/output error +=== Testing empty refcount table === + +Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 +qcow2: Marking image as corrupt: Preventing invalid write on metadata (overlaps with refcount table); further corruption events will be suppressed +write failed: Input/output error + === Testing empty refcount table with valid L1 and L2 tables === Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
Signature · 1 line
2.13.6
[Qemu-devel] [PULL 07/20] qcow2: Assert that the crypto header does not overlap other metadata
In reply to Max ReitzFrom: Alberto Garcia <[email protected]>
The crypto header is initialized only when QEMU is creating a new image, so there's no chance of this happening on a corrupted image.
If QEMU is really trying to allocate the header overlapping other existing metadata sections then this is a serious bug in QEMU itself so let's add an assertion.
Message-id: ae3d77f312fc0c5e0ac2bbd71676c0112eebe2e5.1509718618.git.berto@igalia.com
--- block/qcow2.c | 1 + 1 file changed, 1 insertion(+)
block/qcow2.c +1 -0
@@ -126,6 +126,7 @@ static ssize_t qcow2_crypto_hdr_init_func(QCryptoBlock *block, size_t headerlen,/* Zero fill remaining space in cluster so it has predictable * content in case of future spec changes */ clusterlen =size_to_clusters (s, headerlen) * s->cluster_size; +assert (qcow2_pre_write_overlap_check (bs,0 , ret, clusterlen) ==0 ); ret =bdrv_pwrite_zeroes (bs->file, ret + headerlen, clusterlen - headerlen,0 );
Signature · 1 line
2.13.6
[Qemu-devel] [PULL 09/20] iotests: Add missing 'blkdebug::' in 040
In reply to Max Reitz040 tries to invoke pause_drive() on a drive that does not use blkdebug. Good idea, but let's use blkdebug to make it actually work.
Message-id: [email protected]
--- tests/qemu-iotests/040 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tests/qemu-iotests/040 +1 -1
@@ -289,7 +289,7 @@ class TestSetSpeed(ImageCommitTestCase): qemu_img('create', '-f', iotests.imgfmt, '-o', 'backing_file=%s' % mid_img, test_img) qemu_io('-f', iotests.imgfmt, '-c', 'write -P 0x1 0 512', test_img) qemu_io('-f', iotests.imgfmt, '-c', 'write -P 0xef 524288 524288', mid_img) - self.vm = iotests.VM().add_drive(test_img) + self.vm = iotests.VM().add_drive('blkdebug::' + test_img) self.vm.launch() def tearDown(self):
Signature · 1 line
2.13.6
[Qemu-devel] [PULL 08/20] iotests: Make 030 less flaky
In reply to Max ReitzThis patch fixes two race conditions in 030:
1. The first is in TestENOSPC.test_enospc(). After resuming the job, querying it to confirm it is no longer paused may fail because in the meantime it might have completed already. The same was fixed in TestEIO.test_ignore() already (in commit 2c3b44da07d341557a8203cc509ea07fe3605e11).
2. The second is in TestSetSpeed.test_set_speed_invalid(): Here, a stream job is started on a drive without any break points, with a block-job-set-speed invoked subsequently. However, without any break points, the job might have completed in the meantime (on tmpfs at least); or it might complete before cancel_and_wait() which expects the job to still exist. This can be fixed like everywhere else by pausing the drive (installing break points) before starting the job and letting cancel_and_wait() resume it.
Message-id: [email protected]
--- tests/qemu-iotests/030 | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
tests/qemu-iotests/030 +6 -2
@@ -666,6 +666,7 @@ class TestENOSPC(TestErrors): if event['event'] == 'BLOCK_JOB_ERROR': self.assert_qmp(event, 'data/device', 'drive0') self.assert_qmp(event, 'data/operation', 'read') + error = True result = self.vm.qmp('query-block-jobs') self.assert_qmp(result, 'return[0]/paused', True)
@@ -676,9 +677,11 @@ class TestENOSPC(TestErrors): self.assert_qmp(result, 'return', {}) result = self.vm.qmp('query-block-jobs') + if result == {'return': []}: + # Race; likely already finished. Check. + continue self.assert_qmp(result, 'return[0]/paused', False) self.assert_qmp(result, 'return[0]/io-status', 'ok') - error = True elif event['event'] == 'BLOCK_JOB_COMPLETED': self.assertTrue(error, 'job completed unexpectedly') self.assert_qmp(event, 'data/type', 'stream')
@@ -792,13 +795,14 @@ class TestSetSpeed(iotests.QMPTestCase): self.assert_no_active_block_jobs() + self.vm.pause_drive('drive0') result = self.vm.qmp('block-stream', device='drive0') self.assert_qmp(result, 'return', {}) result = self.vm.qmp('block-job-set-speed', device='drive0', speed=-1) self.assert_qmp(result, 'error/class', 'GenericError') - self.cancel_and_wait() + self.cancel_and_wait(resume=True) if __name__ == '__main__': iotests.main(supported_fmts=['qcow2', 'qed'])
Signature · 1 line
2.13.6
[Qemu-devel] [PULL 10/20] iotests: Make 055 less flaky
In reply to Max ReitzFirst of all, test 055 does a valiant job of invoking pause_drive() sometimes, but that is worth nothing without blkdebug. So the first thing to do is to sprinkle a couple of "blkdebug::" in there -- with the exception of the transaction tests, because the blkdebug break points make the transaction QMP command hang (which is bad). In that case, we can get away with throttling the block job that it effectively is paused.
Then, 055 usually does not pause the drive before starting a block job that should be cancelled. This means that the backup job might be completed already before block-job-cancel is invoked; thus making the test either fail (currently) or moot if cancel_and_wait() ignored this condition. Fix this by pausing the drive before starting the job.
Message-id: [email protected]
--- tests/qemu-iotests/055 | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-)
tests/qemu-iotests/055 +16 -9
@@ -48,7 +48,7 @@ class TestSingleDrive(iotests.QMPTestCase): def setUp(self): qemu_img('create', '-f', iotests.imgfmt, blockdev_target_img, str(image_len)) - self.vm = iotests.VM().add_drive(test_img) + self.vm = iotests.VM().add_drive('blkdebug::' + test_img) self.vm.add_drive(blockdev_target_img, interface="none") if iotests.qemu_default_machine == 'pc': self.vm.add_drive(None, 'media=cdrom', 'ide')
@@ -65,10 +65,11 @@ class TestSingleDrive(iotests.QMPTestCase): def do_test_cancel(self, cmd, target): self.assert_no_active_block_jobs() + self.vm.pause_drive('drive0') result = self.vm.qmp(cmd, device='drive0', target=target, sync='full') self.assert_qmp(result, 'return', {}) - event = self.cancel_and_wait() + event = self.cancel_and_wait(resume=True) self.assert_qmp(event, 'data/type', 'backup') def test_cancel_drive_backup(self):
@@ -166,7 +167,7 @@ class TestSetSpeed(iotests.QMPTestCase): def setUp(self): qemu_img('create', '-f', iotests.imgfmt, blockdev_target_img, str(image_len)) - self.vm = iotests.VM().add_drive(test_img) + self.vm = iotests.VM().add_drive('blkdebug::' + test_img) self.vm.add_drive(blockdev_target_img, interface="none") self.vm.launch()
@@ -246,6 +247,8 @@ class TestSetSpeed(iotests.QMPTestCase): def test_set_speed_invalid_blockdev_backup(self): self.do_test_set_speed_invalid('blockdev-backup', 'drive1') +# Note: We cannot use pause_drive() here, or the transaction command +# would stall. Instead, we limit the block job speed here. class TestSingleTransaction(iotests.QMPTestCase): def setUp(self): qemu_img('create', '-f', iotests.imgfmt, blockdev_target_img, str(image_len))
@@ -271,7 +274,8 @@ class TestSingleTransaction(iotests.QMPTestCase): 'type': cmd, 'data': { 'device': 'drive0', 'target': target, - 'sync': 'full' }, + 'sync': 'full', + 'speed': 64 * 1024 }, } ])
@@ -289,12 +293,12 @@ class TestSingleTransaction(iotests.QMPTestCase): def do_test_pause(self, cmd, target, image): self.assert_no_active_block_jobs() - self.vm.pause_drive('drive0') result = self.vm.qmp('transaction', actions=[{ 'type': cmd, 'data': { 'device': 'drive0', 'target': target, - 'sync': 'full' }, + 'sync': 'full', + 'speed': 64 * 1024 }, } ]) self.assert_qmp(result, 'return', {})
@@ -302,7 +306,9 @@ class TestSingleTransaction(iotests.QMPTestCase): result = self.vm.qmp('block-job-pause', device='drive0') self.assert_qmp(result, 'return', {}) - self.vm.resume_drive('drive0') + result = self.vm.qmp('block-job-set-speed', device='drive0', speed=0) + self.assert_qmp(result, 'return', {}) + self.pause_job('drive0') result = self.vm.qmp('query-block-jobs')
@@ -461,7 +467,7 @@ class TestDriveCompression(iotests.QMPTestCase): pass def do_prepare_drives(self, fmt, args, attach_target): - self.vm = iotests.VM().add_drive(test_img) + self.vm = iotests.VM().add_drive('blkdebug::' + test_img) qemu_img('create', '-f', fmt, blockdev_target_img, str(TestDriveCompression.image_len), *args)
@@ -500,10 +506,11 @@ class TestDriveCompression(iotests.QMPTestCase): self.assert_no_active_block_jobs() + self.vm.pause_drive('drive0') result = self.vm.qmp(cmd, device='drive0', sync='full', compress=True, **args) self.assert_qmp(result, 'return', {}) - event = self.cancel_and_wait() + event = self.cancel_and_wait(resume=True) self.assert_qmp(event, 'data/type', 'backup') self.vm.shutdown()
Signature · 1 line
2.13.6
[Qemu-devel] [PULL 11/20] iotests: Make 083 less flaky
In reply to Max Reitz083 has (at least) two issues:
1. By launching the nbd-fault-injector in background, it may not be scheduled until the first grep on its output file is executed. However, until then, that file may not have been created yet -- so it either does not exist yet (thus making the grep emit an error), or it does exist but contains stale data (thus making the rest of the test case work connect to a wrong address).
Fix this by explicitly overwriting the output file before executing nbd-fault-injector.
2. The nbd-fault-injector prints things other than "Listening on...". It also prints a "Closing connection" message from time to time. We currently invoke sed on the whole file in the hope of it only containing the "Listening on..." line yet. That hope is sometimes shattered by the brutal reality of race conditions, so make the sed script more robust.
Message-id: [email protected]
--- tests/qemu-iotests/083 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
tests/qemu-iotests/083 +3 -1
@@ -86,6 +86,7 @@ EOF rm -f "$TEST_DIR/nbd.sock" + echo > "$TEST_DIR/nbd-fault-injector.out" $PYTHON nbd-fault-injector.py $extra_args "$nbd_addr" "$TEST_DIR/nbd-fault-injector.conf" >"$TEST_DIR/nbd-fault-injector.out" 2>&1 & # Wait for server to be ready
@@ -94,7 +95,8 @@ EOF done # Extract the final address (port number has now been assigned in tcp case) - nbd_addr=$(sed 's/Listening on \(.*\)$/\1/' "$TEST_DIR/nbd-fault-injector.out") + nbd_addr=$(sed -n 's/^Listening on //p' \ + "$TEST_DIR/nbd-fault-injector.out") if [ "$proto" = "tcp" ]; then nbd_url="nbd+tcp://$nbd_addr/$export_name"
Signature · 1 line
2.13.6
[Qemu-devel] [PULL 12/20] iotests: Make 136 less flaky
In reply to Max Reitz136 executes some AIO requests without a final aio_flush; then it advances the virtual clock and thus expects the last access time of the device to be less than the current time when queried (i.e. idle_time_ns to be greater than 0). However, without the aio_flush, some requests may be settled after the clock_step invocation. In that case, idle_time_ns would be 0 and the test fails.
Fix this by adding an aio_flush if any AIO request other than some other aio_flush has been executed.
Message-id: [email protected]
--- tests/qemu-iotests/136 | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-)
tests/qemu-iotests/136 +13 -1
@@ -238,6 +238,18 @@ sector = "%d" for i in range(failed_wr_ops): ops.append("aio_write %d 512" % bad_offset) + # We need an extra aio_flush to settle all outstanding AIO + # operations before we can advance the virtual clock, so that + # the last access happens before clock_step and idle_time_ns + # will be greater than 0 + extra_flush = 0 + if rd_ops + wr_ops + invalid_rd_ops + invalid_wr_ops + \ + failed_rd_ops + failed_wr_ops > 0: + extra_flush = 1 + + if extra_flush > 0: + ops.append("aio_flush") + if failed_wr_ops > 0: highest_offset = max(highest_offset, bad_offset + 512)
@@ -251,7 +263,7 @@ sector = "%d" self.total_wr_bytes += wr_ops * wr_size self.total_wr_ops += wr_ops self.total_wr_merged += wr_merged - self.total_flush_ops += flush_ops + self.total_flush_ops += flush_ops + extra_flush self.invalid_rd_ops += invalid_rd_ops self.invalid_wr_ops += invalid_wr_ops self.failed_rd_ops += failed_rd_ops
Signature · 1 line
2.13.6
[Qemu-devel] [PULL 13/20] iotests: Use new-style NBD connections
In reply to Max ReitzFrom: Eric Blake <[email protected]>
Old-style NBD is deprecated upstream (it is documented, but no longer implemented in the reference implementation), and it is severely limited (it cannot support structured replies, which means it cannot support efficient handling of zeroes), when compared to new-style NBD. We are better off having our iotests favor new-style everywhere (although some explicit tests, particularly 83, still cover old-style for back-compat reasons); this is as simple as supplying the empty string as the default export name, as it does not change the URI needed to connect a client to the server. This also gives us more coverage of the just-added structured reply code, when not overriding $QEMU_NBD to intentionally point to an older server.
Message-id: [email protected]
--- tests/qemu-iotests/common.rc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tests/qemu-iotests/common.rc +1 -1
@@ -242,7 +242,7 @@ _make_test_img() if [ $IMGPROTO = "nbd" ]; then # Pass a sufficiently high number to -e that should be enough for all # tests - eval "$QEMU_NBD -v -t -b 127.0.0.1 -p 10810 -f $IMGFMT -e 42 $TEST_IMG_FILE >/dev/null &" + eval "$QEMU_NBD -v -t -b 127.0.0.1 -p 10810 -f $IMGFMT -e 42 -x '' $TEST_IMG_FILE >/dev/null &" sleep 1 # FIXME: qemu-nbd needs to be listening before we continue fi
Signature · 1 line
2.13.6
[Qemu-devel] [PULL 14/20] qcow2: Check that corrupted images can be repaired in iotest 060
In reply to Max ReitzFrom: Alberto Garcia <[email protected]>
We just fixed a few bugs that caused QEMU to crash when trying to write to corrupted qcow2 images, and iotest 060 was expanded to test all those scenarios.
In almost all cases the corrupted images can be repaired using qemu-img, so this patch verifies that.
Message-id: 0b1b95340ecdfbc6927e36adf2fd42ae6198747a.1510143008.git.berto@igalia.com
--- tests/qemu-iotests/060 | 10 ++++++++ tests/qemu-iotests/060.out | 64 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 74 insertions(+)
tests/qemu-iotests/060 +10 -0
@@ -248,6 +248,8 @@ echo _make_test_img 64M poke_file "$TEST_IMG" "$rt_offset" "\x00\x00\x00\x00\x00\x00\x00\x00" $QEMU_IO -c "write 0 64k" "$TEST_IMG" | _filter_qemu_io +# Repair the image +_check_test_img -r all echo echo "=== Testing empty refcount table with valid L1 and L2 tables ==="
@@ -259,6 +261,8 @@ poke_file "$TEST_IMG" "$rt_offset" "\x00\x00\x00\x00\x00\x00\x00\x00" # allocation with an explicit offset (using qcow2_alloc_clusters_at()) # causing a refcount block to be allocated at offset 0 $QEMU_IO -c "write 0 128k" "$TEST_IMG" | _filter_qemu_io +# Repair the image +_check_test_img -r all echo echo "=== Testing empty refcount block ==="
@@ -266,6 +270,8 @@ echo _make_test_img 64M poke_file "$TEST_IMG" "$rb_offset" "\x00\x00\x00\x00\x00\x00\x00\x00" $QEMU_IO -c "write 0 64k" "$TEST_IMG" | _filter_qemu_io +# Repair the image +_check_test_img -r all echo echo "=== Testing empty refcount block with compressed write ==="
@@ -276,6 +282,8 @@ poke_file "$TEST_IMG" "$rb_offset" "\x00\x00\x00\x00\x00\x00\x00\x00" # The previous write already allocated an L2 table, so now this new # write will try to allocate a compressed data cluster at offset 0. $QEMU_IO -c "write -c 0k 64k" "$TEST_IMG" | _filter_qemu_io +# Repair the image +_check_test_img -r all echo echo "=== Testing zero refcount table size ==="
@@ -283,6 +291,8 @@ echo _make_test_img 64M poke_file "$TEST_IMG" "56" "\x00\x00\x00\x00" $QEMU_IO -c "write 0 64k" "$TEST_IMG" 2>&1 | _filter_testdir | _filter_imgfmt +# Repair the image +_check_test_img -r all echo echo "=== Testing incorrect refcount table offset ==="
tests/qemu-iotests/060.out +64 -0
93 lines not on this page · raw message
Signature · 1 line
2.13.6
[Qemu-devel] [PULL 15/20] block/snapshot: dirty all dirty bitmaps on snapshot-switch
In reply to Max ReitzFrom: Vladimir Sementsov-Ogievskiy <[email protected]>
Snapshot-switch actually changes active state of disk so it should reflect on dirty bitmaps. Otherwise next incremental backup using these bitmaps will be invalid.
Message-id: [email protected]
--- block/snapshot.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
block/snapshot.c +14 -0
@@ -181,10 +181,24 @@ int bdrv_snapshot_goto(BlockDriverState *bs, {BlockDriver *drv = bs->drv;int ret, open_ret; +int64_t len;if (!drv) {return -ENOMEDIUM ; } + + len =bdrv_getlength (bs); +if (len <0 ) { +return len; + } +/* We should set all bits in all enabled dirty bitmaps, because dirty +* bitmaps reflect active state of disk and snapshot switch operation +* actually dirties active state. +* TODO: It may make sense not to set all bits but analyze block status of +* current state and destination snapshot and do not set bits corresponding +* to both-zero or both-unallocated areas. */ +bdrv_set_dirty (bs,0 , len); +if (drv->bdrv_snapshot_goto) {return drv->bdrv_snapshot_goto (bs, snapshot_id); }
Signature · 1 line
2.13.6
[Qemu-devel] [PULL 20/20] qemu-iotests: update unsupported image formats in 194
In reply to Max ReitzFrom: Jeff Cody <[email protected]>
Test 194 checks for 'luks' to exclude as an unsupported format, However, most formats are unsupported, due to migration blockers.
Rather than specifying a blacklist of unsupported formats, whitelist supported formats (specifically, qcow2, qed, raw, dmg).
Message-id: 23ca18c7f843c86a28b1529ca9ac6db4b35ca0e4.1510059970.git.jcody@redhat.com
--- tests/qemu-iotests/194 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tests/qemu-iotests/194 +1 -1
@@ -21,7 +21,7 @@ import iotests -iotests.verify_image_format(unsupported_fmts=['luks']) +iotests.verify_image_format(supported_fmts=['qcow2', 'qed', 'raw', 'dmg']) iotests.verify_platform(['linux']) with iotests.FilePath('source.img') as source_img_path, \
Signature · 1 line
2.13.6
[Qemu-devel] [PULL 16/20] iotests: 077: Filter out 'resume' lines
In reply to Max ReitzFrom: Fam Zheng <[email protected]>
In the "Overlapping multiple requests" cases, the 3rd reqs (the break point B) doesn't wait for the 2nd, and once resumed the I/O will just continue. This is because the 2nd is already waiting for the 1st, and in wait_serialising_requests() there is:
/* If the request is already (indirectly) waiting for us, or
* will wait for us as soon as it wakes up, then just go on
* (instead of producing a deadlock in the former case). */
if (!req->waiting_for) {
/* actually break */
...
}Consequently, the following "sleep 100; resume A" command races with the completion of that request, and sometimes results in an unexpected order of output:
Review line 64
Quoted 11 lines
(quoted diff) +1
-1@@ -56,9 +56,9 @@ wrote XXX/XXX bytes at offset XXX XXX bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) blkdebug: Resuming request 'B' +blkdebug: Resuming request 'A' wrote XXX/XXX bytes at offset XXX XXX bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -blkdebug: Resuming request 'A' wrote XXX/XXX bytes at offset XXX XXX bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) wrote XXX/XXX bytes at offset XXX
Filter out the "Resuming request" lines to make the output deterministic.
Message-id: [email protected]
--- tests/qemu-iotests/077 | 3 ++- tests/qemu-iotests/077.out | 16 ---------------- 2 files changed, 2 insertions(+), 17 deletions(-)
tests/qemu-iotests/077 +2 -1
@@ -188,7 +188,8 @@ EOF test_io | $QEMU_IO | _filter_qemu_io | \ sed -e 's,[0-9/]* bytes at offset [0-9]*,XXX/XXX bytes at offset XXX,g' \ -e 's/^[0-9]* \(bytes\|KiB\)/XXX bytes/' \ - -e '/Suspended/d' + -e '/Suspended/d' \ + -e '/blkdebug: Resuming request/d' echo echo "== Verify image content =="
tests/qemu-iotests/077.out +0 -16
@@ -4,17 +4,14 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 == Some concurrent requests involving RMW == wrote XXX/XXX bytes at offset XXX XXX bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -blkdebug: Resuming request 'A' wrote XXX/XXX bytes at offset XXX XXX bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) wrote XXX/XXX bytes at offset XXX XXX bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -blkdebug: Resuming request 'A' wrote XXX/XXX bytes at offset XXX XXX bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) wrote XXX/XXX bytes at offset XXX XXX bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -blkdebug: Resuming request 'A' wrote XXX/XXX bytes at offset XXX XXX bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) wrote XXX/XXX bytes at offset XXX
@@ -31,51 +28,38 @@ wrote XXX/XXX bytes at offset XXX XXX bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) wrote XXX/XXX bytes at offset XXX XXX bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -blkdebug: Resuming request 'A' wrote XXX/XXX bytes at offset XXX XXX bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -blkdebug: Resuming request 'B' wrote XXX/XXX bytes at offset XXX XXX bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) wrote XXX/XXX bytes at offset XXX XXX bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -blkdebug: Resuming request 'B' wrote XXX/XXX bytes at offset XXX XXX bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -blkdebug: Resuming request 'A' wrote XXX/XXX bytes at offset XXX XXX bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) wrote XXX/XXX bytes at offset XXX XXX bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -blkdebug: Resuming request 'A' wrote XXX/XXX bytes at offset XXX XXX bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -blkdebug: Resuming request 'B' wrote XXX/XXX bytes at offset XXX XXX bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) wrote XXX/XXX bytes at offset XXX XXX bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -blkdebug: Resuming request 'B' wrote XXX/XXX bytes at offset XXX XXX bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -blkdebug: Resuming request 'A' wrote XXX/XXX bytes at offset XXX XXX bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) wrote XXX/XXX bytes at offset XXX XXX bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -blkdebug: Resuming request 'A' wrote XXX/XXX bytes at offset XXX XXX bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) wrote XXX/XXX bytes at offset XXX XXX bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -blkdebug: Resuming request 'A' -blkdebug: Resuming request 'C' wrote XXX/XXX bytes at offset XXX XXX bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -blkdebug: Resuming request 'B' wrote XXX/XXX bytes at offset XXX XXX bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -blkdebug: Resuming request 'A' wrote XXX/XXX bytes at offset XXX XXX bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) wrote XXX/XXX bytes at offset XXX
Signature · 1 line
2.13.6
[Qemu-devel] [PULL 17/20] block/vhdx.c: Don't blindly update the header
In reply to Max ReitzFrom: Jeff Cody <[email protected]>
The VHDX specification requires that before user data modification of the vhdx image, the VHDX header file and data GUIDs need to be updated. In vhdx_open(), if the image is set to RDWR, we go ahead and update the header.
However, just because the image is set to RDWR does not mean we can go ahead and write at this point - specifically, if the QEMU run state is INMIGRATE, the underlying file BS may be set to inactive via the BDS open flag of BDRV_O_INACTIVE. Attempting to write under this condition will cause an assert in bdrv_co_pwritev().
We can alternatively latch the first time the image is written. And lo and behold, we do just that, via vhdx_user_visible_write() in vhdx_co_writev(). This means the call to vhdx_update_headers() in vhdx_open() is likely just vestigial, and can be removed.
Message-id: 659e4cdba6ef4c651737852777c8c93d27b38040.1510059970.git.jcody@redhat.com
--- block/vhdx.c | 7 ------- 1 file changed, 7 deletions(-)
block/vhdx.c +0 -7
@@ -1008,13 +1008,6 @@ static int vhdx_open(BlockDriverState *bs, QDict *options, int flags, goto fail; } -if (flags &BDRV_O_RDWR ) { - ret =vhdx_update_headers (bs, s, false,NULL ); -if (ret <0 ) { - goto fail; - } - } -/* TODO: differencing files */ return 0 ;
Signature · 1 line
2.13.6
[Qemu-devel] [PULL 18/20] block/parallels: Do not update header or truncate image when INMIGRATE
In reply to Max ReitzFrom: Jeff Cody <[email protected]>
If we write or modify the image file while the QEMU run state is INMIGRATE, then the BDRV_O_INACTIVE BDS flag is set. This will cause an assert, since the image is marked inactive. Make sure we obey this flag.
Message-id: 3996c930fa8cde8570b7a63032720d76a28fd78b.1510059970.git.jcody@redhat.com
--- block/parallels.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
block/parallels.c +2 -5
@@ -708,7 +708,7 @@ static int parallels_open(BlockDriverState *bs, QDict *options, int flags, s->prealloc_mode =PRL_PREALLOC_MODE_FALLOCATE ; } -if (flags &BDRV_O_RDWR ) { +if ((flags &BDRV_O_RDWR ) && !(flags &BDRV_O_INACTIVE )) { s->header->inuse =cpu_to_le32 (HEADER_INUSE_MAGIC ); ret =parallels_update_header (bs);if (ret <0 ) {
@@ -741,12 +741,9 @@ static void parallels_close(BlockDriverState *bs) {BDRVParallelsState *s = bs->opaque; -if (bs->open_flags &BDRV_O_RDWR ) { +if ((bs->open_flags &BDRV_O_RDWR ) && !(bs->open_flags &BDRV_O_INACTIVE )) { s->header->inuse =0 ;parallels_update_header (bs); - } - -if (bs->open_flags &BDRV_O_RDWR ) {bdrv_truncate (bs->file, s->data_end <<BDRV_SECTOR_BITS ,PREALLOC_MODE_OFF ,NULL ); }
Signature · 1 line
2.13.6
[Qemu-devel] [PULL 19/20] block/parallels: add migration blocker
In reply to Max ReitzFrom: Jeff Cody <[email protected]>
Migration does not work for parallels, and has been broken for a while (see patch 'block/parallels: Do not update header or truncate image when
INMIGRATE'). The bdrv_invalidate_cache() method needs to be added for
migration to be supported. Until this is done, prohibit migration.
Message-id: 5e04a7c8a3089913fa58d484af42dab7993984ad.1510059970.git.jcody@redhat.com
--- block/parallels.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
block/parallels.c +15 -0
@@ -35,6 +35,7 @@#include "qemu/module.h" #include "qemu/bswap.h" #include "qemu/bitmap.h" +#include "migration/blocker.h" /**************************************************************/
@@ -100,6 +101,7 @@ typedef struct BDRVParallelsState {unsigned int tracks;unsigned int off_multiplier; +Error *migration_blocker; } BDRVParallelsState;
@@ -720,6 +722,16 @@ static int parallels_open(BlockDriverState *bs, QDict *options, int flags, s->bat_dirty_bmap =bitmap_new (DIV_ROUND_UP (s->header_size, s->bat_dirty_block)); +/* Disable migration until bdrv_invalidate_cache method is added */ +error_setg (&s->migration_blocker,"The Parallels format used by node '%s' " +"does not support live migration" , +bdrv_get_device_or_node_name (bs)); + ret =migrate_add_blocker (s->migration_blocker, &local_err); +if (local_err) { +error_propagate (errp, local_err); +error_free (s->migration_blocker); + goto fail; + }qemu_co_mutex_init (&s->lock);return 0 ;
@@ -750,6 +762,9 @@ static void parallels_close(BlockDriverState *bs)g_free (s->bat_dirty_bmap);qemu_vfree (s->header); + +migrate_del_blocker (s->migration_blocker); +error_free (s->migration_blocker); }static QemuOptsList parallels_create_opts = {
Signature · 1 line
2.13.6
Quoted 4 lines · Max Reitz
The following changes since commit
191b5fbfa66e5b23e2150f3c6981d30eb84418a9:Merge remote-tracking branch 'remotes/stefanha/tags/block-pull-request' into staging (2017-11-14 16:11:19 +0000)
Quoted 8 lines
are available in the git repository at:
git://github.com/XanClic/qemu.gittags/pull-block-2017-11-14for you to fetch changes up to
8b2d7c364d9a2491f7501f6688cd722045cf808a:qemu-iotests: update unsupported image formats in 194 (2017-11-14 18:06:26 +0100)
I can probably squeeze this into rc1, but 17:30 GMT on rc day is at least an hour later than you can reasonably rely on being able to get a pull request into the rc....
thanks
-- PMM
Quoted 9 lines · Peter Maydell
Quoted 8 lines · Max Reitz
The following changes since commit
191b5fbfa66e5b23e2150f3c6981d30eb84418a9:Merge remote-tracking branch 'remotes/stefanha/tags/block-pull-request' into staging (2017-11-14 16:11:19 +0000)
are available in the git repository at:
git://github.com/XanClic/qemu.gittags/pull-block-2017-11-14
Quoted 8 lines
Quoted 4 lines
for you to fetch changes up to
8b2d7c364d9a2491f7501f6688cd722045cf808a:qemu-iotests: update unsupported image formats in 194 (2017-11-14 18:06:26 +0100)
I can probably squeeze this into rc1, but 17:30 GMT on rc day is at least an hour later than you can reasonably rely on being able to get a pull request into the rc....
Sorry, I understand.
(I got two errors when testing the build, so I had to debug them and drop a series -- which is one reason why it got delayed so much. The other is that I wanted to see if Kevin would be around today so that he could do a combined pull request.)
I promise to do my build testing earlier next time...
Max
Peter Maydell
AppliedQuoted 6 lines · Max Reitz
The following changes since commit
191b5fbfa66e5b23e2150f3c6981d30eb84418a9:Merge remote-tracking branch 'remotes/stefanha/tags/block-pull-request' into staging (2017-11-14 16:11:19 +0000)
are available in the git repository at:
Quoted 8 lines
git://github.com/XanClic/qemu.gittags/pull-block-2017-11-14for you to fetch changes up to
8b2d7c364d9a2491f7501f6688cd722045cf808a:qemu-iotests: update unsupported image formats in 194 (2017-11-14 18:06:26 +0100)
----------------------------------------------------------------
Block patches for 2.11.0-rc1
Applied, thanks.
-- PMM