qemu-kvm/kvm-iotests-Add-iothread-cases-to-155.patch

148 lines
5.7 KiB
Diff
Raw Normal View History

* Tue Mar 17 2020 Danilo Cesar Lemes de Paula <ddepaula@redhat.com> - 4.2.0-15.el8 - kvm-block-nbd-Fix-hang-in-.bdrv_close.patch [bz#1640894] - kvm-block-Generic-file-creation-fallback.patch [bz#1640894] - kvm-file-posix-Drop-hdev_co_create_opts.patch [bz#1640894] - kvm-iscsi-Drop-iscsi_co_create_opts.patch [bz#1640894] - kvm-iotests-Add-test-for-image-creation-fallback.patch [bz#1640894] - kvm-block-Fix-leak-in-bdrv_create_file_fallback.patch [bz#1640894] - kvm-iotests-Use-complete_and_wait-in-155.patch [bz#1790482 bz#1805143] - kvm-block-Introduce-bdrv_reopen_commit_post-step.patch [bz#1790482 bz#1805143] - kvm-block-qcow2-Move-bitmap-reopen-into-bdrv_reopen_comm.patch [bz#1790482 bz#1805143] - kvm-iotests-Refactor-blockdev-reopen-test-for-iothreads.patch [bz#1790482 bz#1805143] - kvm-block-bdrv_reopen-with-backing-file-in-different-Aio.patch [bz#1790482 bz#1805143] - kvm-block-Versioned-x-blockdev-reopen-API-with-feature-f.patch [bz#1790482 bz#1805143] - kvm-block-Make-bdrv_get_cumulative_perm-public.patch [bz#1790482 bz#1805143] - kvm-block-Relax-restrictions-for-blockdev-snapshot.patch [bz#1790482 bz#1805143] - kvm-iotests-Fix-run_job-with-use_log-False.patch [bz#1790482 bz#1805143] - kvm-iotests-Test-mirror-with-temporarily-disabled-target.patch [bz#1790482 bz#1805143] - kvm-block-Fix-cross-AioContext-blockdev-snapshot.patch [bz#1790482 bz#1805143] - kvm-iotests-Add-iothread-cases-to-155.patch [bz#1790482 bz#1805143] - kvm-qapi-Add-allow-write-only-overlay-feature-for-blockd.patch [bz#1790482 bz#1805143] - kvm-exec-rom_reset-Free-rom-data-during-inmigrate-skip.patch [bz#1809380] - Resolves: bz#1640894 (Fix generic file creation fallback for qemu-img nvme:// image creation support) - Resolves: bz#1790482 (bitmaps in backing images can't be modified) - Resolves: bz#1805143 (allow late/lazy opening of backing chain for shallow blockdev-mirror) - Resolves: bz#1809380 (guest hang during reboot process after migration from RHEl7.8 to RHEL8.2.0.)
2020-03-17 00:52:27 +00:00
From 2366cd9066e79d6c93a3a28710aea987b2c8f454 Mon Sep 17 00:00:00 2001
From: Kevin Wolf <kwolf@redhat.com>
Date: Fri, 13 Mar 2020 12:34:38 +0000
Subject: [PATCH 18/20] iotests: Add iothread cases to 155
RH-Author: Kevin Wolf <kwolf@redhat.com>
Message-id: <20200313123439.10548-13-kwolf@redhat.com>
Patchwork-id: 94289
O-Subject: [RHEL-AV-8.2.0 qemu-kvm PATCH v2 12/13] iotests: Add iothread cases to 155
Bugzilla: 1790482 1805143
RH-Acked-by: John Snow <jsnow@redhat.com>
RH-Acked-by: Daniel P. Berrange <berrange@redhat.com>
RH-Acked-by: Peter Krempa <pkrempa@redhat.com>
This patch adds test cases for attaching the backing chain to a mirror
job target right before finalising the job, where the image is in a
non-mainloop AioContext (i.e. the backing chain needs to be moved to the
AioContext of the mirror target).
This requires switching the test case from virtio-blk to virtio-scsi
because virtio-blk only actually starts using the iothreads when the
guest driver initialises the device (which never happens in a test case
without a guest OS). virtio-scsi always keeps its block nodes in the
AioContext of the the requested iothread without guest interaction.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Message-Id: <20200310113831.27293-7-kwolf@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
(cherry picked from commit 6a5f6403a11307794ec79d277a065c137cfc12b2)
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
tests/qemu-iotests/155 | 32 +++++++++++++++++++++++---------
tests/qemu-iotests/155.out | 4 ++--
2 files changed, 25 insertions(+), 11 deletions(-)
diff --git a/tests/qemu-iotests/155 b/tests/qemu-iotests/155
index 3053e50..b552d1f 100755
--- a/tests/qemu-iotests/155
+++ b/tests/qemu-iotests/155
@@ -49,11 +49,14 @@ target_img = os.path.join(iotests.test_dir, 'target.' + iotests.imgfmt)
# chain opened right away. If False, blockdev-add
# opens it without a backing file and job completion
# is supposed to open the backing chain.
+# use_iothread: If True, an iothread is configured for the virtio-blk device
+# that uses the image being mirrored
class BaseClass(iotests.QMPTestCase):
target_blockdev_backing = None
target_real_backing = None
target_open_with_backing = True
+ use_iothread = False
def setUp(self):
qemu_img('create', '-f', iotests.imgfmt, back0_img, '1440K')
@@ -69,7 +72,16 @@ class BaseClass(iotests.QMPTestCase):
'file': {'driver': 'file',
'filename': source_img}}
self.vm.add_blockdev(self.vm.qmp_to_opts(blockdev))
- self.vm.add_device('virtio-blk,id=qdev0,drive=source')
+
+ if self.use_iothread:
+ self.vm.add_object('iothread,id=iothread0')
+ iothread = ",iothread=iothread0"
+ else:
+ iothread = ""
+
+ self.vm.add_device('virtio-scsi%s' % iothread)
+ self.vm.add_device('scsi-hd,id=qdev0,drive=source')
+
self.vm.launch()
self.assertIntactSourceBackingChain()
@@ -182,24 +194,21 @@ class MirrorBaseClass(BaseClass):
def testFull(self):
self.runMirror('full')
- node = self.findBlockNode('target',
- '/machine/peripheral/qdev0/virtio-backend')
+ node = self.findBlockNode('target', 'qdev0')
self.assertCorrectBackingImage(node, None)
self.assertIntactSourceBackingChain()
def testTop(self):
self.runMirror('top')
- node = self.findBlockNode('target',
- '/machine/peripheral/qdev0/virtio-backend')
+ node = self.findBlockNode('target', 'qdev0')
self.assertCorrectBackingImage(node, back2_img)
self.assertIntactSourceBackingChain()
def testNone(self):
self.runMirror('none')
- node = self.findBlockNode('target',
- '/machine/peripheral/qdev0/virtio-backend')
+ node = self.findBlockNode('target', 'qdev0')
self.assertCorrectBackingImage(node, source_img)
self.assertIntactSourceBackingChain()
@@ -252,6 +261,9 @@ class TestBlockdevMirrorReopen(MirrorBaseClass):
backing="backing")
self.assert_qmp(result, 'return', {})
+class TestBlockdevMirrorReopenIothread(TestBlockdevMirrorReopen):
+ use_iothread = True
+
# Attach the backing chain only during completion, with blockdev-snapshot
class TestBlockdevMirrorSnapshot(MirrorBaseClass):
cmd = 'blockdev-mirror'
@@ -268,6 +280,9 @@ class TestBlockdevMirrorSnapshot(MirrorBaseClass):
overlay="target")
self.assert_qmp(result, 'return', {})
+class TestBlockdevMirrorSnapshotIothread(TestBlockdevMirrorSnapshot):
+ use_iothread = True
+
class TestCommit(BaseClass):
existing = False
@@ -283,8 +298,7 @@ class TestCommit(BaseClass):
self.vm.event_wait('BLOCK_JOB_COMPLETED')
- node = self.findBlockNode(None,
- '/machine/peripheral/qdev0/virtio-backend')
+ node = self.findBlockNode(None, 'qdev0')
self.assert_qmp(node, 'image' + '/backing-image' * 0 + '/filename',
back1_img)
self.assert_qmp(node, 'image' + '/backing-image' * 1 + '/filename',
diff --git a/tests/qemu-iotests/155.out b/tests/qemu-iotests/155.out
index 4fd1c2d..ed714d5 100644
--- a/tests/qemu-iotests/155.out
+++ b/tests/qemu-iotests/155.out
@@ -1,5 +1,5 @@
-.........................
+...............................
----------------------------------------------------------------------
-Ran 25 tests
+Ran 31 tests
OK
--
1.8.3.1