aboutsummaryrefslogtreecommitdiff
path: root/tests/qemu-iotests/051
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2019-05-23 16:09:19 +0200
committerKevin Wolf <kwolf@redhat.com>2019-06-04 16:55:58 +0200
commit6c8705351ee5b3f2ede8337fc93de320b3d4add6 (patch)
tree493e2d2f8e5c9744fccf1c0ff1a6ac3f2a0b7d99 /tests/qemu-iotests/051
parentedbe36ad0f2fa8876b59bc77991ef00c969247a9 (diff)
iotests: Attach new devices to node in non-default iothread
This tests that devices refuse to be attached to a node that has already been moved to a different iothread if they can't be or aren't configured to work in the same iothread. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'tests/qemu-iotests/051')
-rwxr-xr-xtests/qemu-iotests/05124
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/qemu-iotests/051 b/tests/qemu-iotests/051
index a3deb1fcad..200660f977 100755
--- a/tests/qemu-iotests/051
+++ b/tests/qemu-iotests/051
@@ -192,6 +192,30 @@ case "$QEMU_DEFAULT_MACHINE" in
esac
echo
+echo === Attach to node in non-default iothread ===
+echo
+
+case "$QEMU_DEFAULT_MACHINE" in
+ pc)
+ iothread="-drive file=$TEST_IMG,if=none,node-name=disk -object iothread,id=thread0 -device virtio-scsi,iothread=thread0,id=virtio-scsi0 -device scsi-hd,bus=virtio-scsi0.0,drive=disk,share-rw=on"
+
+ # Can't add a device in the main thread while virtio-scsi0 uses the node
+ run_qemu $iothread -device ide-hd,drive=disk,share-rw=on
+ run_qemu $iothread -device virtio-blk-pci,drive=disk,share-rw=on
+ run_qemu $iothread -device lsi53c895a,id=lsi0 -device scsi-hd,bus=lsi0.0,drive=disk,share-rw=on
+ run_qemu $iothread -device virtio-scsi,id=virtio-scsi1 -device scsi-hd,bus=virtio-scsi1.0,drive=disk,share-rw=on
+
+ # virtio-blk enables the iothread only when the driver initialises the
+ # device, so a second virtio-blk device can't be added even with the
+ # same iothread. virtio-scsi allows this.
+ run_qemu $iothread -device virtio-blk-pci,drive=disk,iohtread=iothread0,share-rw=on
+ run_qemu $iothread -device virtio-scsi,id=virtio-scsi1,iothread=thread0 -device scsi-hd,bus=virtio-scsi1.0,drive=disk,share-rw=on
+ ;;
+ *)
+ ;;
+esac
+
+echo
echo === Read-only ===
echo