[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 13/15] iotests: Attach new devices to node in non-de
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PATCH 13/15] iotests: Attach new devices to node in non-default iothread |
Date: |
Thu, 23 May 2019 18:01:02 +0200 |
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 <address@hidden>
---
tests/qemu-iotests/051 | 24 ++++++++++++++++++++++++
tests/qemu-iotests/051.out | 3 +++
tests/qemu-iotests/051.pc.out | 27 +++++++++++++++++++++++++++
3 files changed, 54 insertions(+)
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
@@ -191,6 +191,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
diff --git a/tests/qemu-iotests/051.out b/tests/qemu-iotests/051.out
index 9f1cf22608..8993835b94 100644
--- a/tests/qemu-iotests/051.out
+++ b/tests/qemu-iotests/051.out
@@ -137,6 +137,9 @@ QEMU X.Y.Z monitor - type 'help' for more information
(qemu) QEMU_PROG: -drive if=virtio: Device needs media, but drive is empty
+=== Attach to node in non-default iothread ===
+
+
=== Read-only ===
Testing: -drive file=TEST_DIR/t.qcow2,if=virtio,readonly=on
diff --git a/tests/qemu-iotests/051.pc.out b/tests/qemu-iotests/051.pc.out
index c4743cc31c..2d811c166c 100644
--- a/tests/qemu-iotests/051.pc.out
+++ b/tests/qemu-iotests/051.pc.out
@@ -173,6 +173,33 @@ QEMU X.Y.Z monitor - type 'help' for more information
(qemu) QEMU_PROG: -device scsi-hd,drive=disk: Device needs media, but drive is
empty
+=== Attach to node in non-default iothread ===
+
+Testing: -drive file=TEST_DIR/t.qcow2,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 -device
ide-hd,drive=disk,share-rw=on
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) QEMU_PROG: -device ide-hd,drive=disk,share-rw=on: Cannot change
iothread of active block backend
+
+Testing: -drive file=TEST_DIR/t.qcow2,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 -device
virtio-blk-pci,drive=disk,share-rw=on
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) QEMU_PROG: -device virtio-blk-pci,drive=disk,share-rw=on: Cannot change
iothread of active block backend
+
+Testing: -drive file=TEST_DIR/t.qcow2,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 -device
lsi53c895a,id=lsi0 -device scsi-hd,bus=lsi0.0,drive=disk,share-rw=on
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) QEMU_PROG: -device scsi-hd,bus=lsi0.0,drive=disk,share-rw=on: HBA does
not support iothreads
+
+Testing: -drive file=TEST_DIR/t.qcow2,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 -device
virtio-scsi,id=virtio-scsi1 -device
scsi-hd,bus=virtio-scsi1.0,drive=disk,share-rw=on
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) QEMU_PROG: -device scsi-hd,bus=virtio-scsi1.0,drive=disk,share-rw=on:
Cannot change iothread of active block backend
+
+Testing: -drive file=TEST_DIR/t.qcow2,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 -device
virtio-blk-pci,drive=disk,iohtread=iothread0,share-rw=on
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) QEMU_PROG: -device
virtio-blk-pci,drive=disk,iohtread=iothread0,share-rw=on: Cannot change
iothread of active block backend
+
+Testing: -drive file=TEST_DIR/t.qcow2,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 -device
virtio-scsi,id=virtio-scsi1,iothread=thread0 -device
scsi-hd,bus=virtio-scsi1.0,drive=disk,share-rw=on
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) quit
+
+
=== Read-only ===
Testing: -drive file=TEST_DIR/t.qcow2,if=floppy,readonly=on
--
2.20.1
- [Qemu-devel] [PATCH 09/15] block: Move node without parents to main AioContext, (continued)
- [Qemu-devel] [PATCH 09/15] block: Move node without parents to main AioContext, Kevin Wolf, 2019/05/23
- [Qemu-devel] [PATCH 02/15] block: Add Error to blk_set_aio_context(), Kevin Wolf, 2019/05/23
- [Qemu-devel] [PATCH 10/15] blockdev: Use bdrv_try_set_aio_context() for monitor commands, Kevin Wolf, 2019/05/23
- [Qemu-devel] [PATCH 06/15] block: Adjust AioContexts when attaching nodes, Kevin Wolf, 2019/05/23
- [Qemu-devel] [PATCH 05/15] scsi-disk: Use qdev_prop_drive_iothread, Kevin Wolf, 2019/05/23
- [Qemu-devel] [PATCH 14/15] test-bdrv-drain: Use bdrv_try_set_aio_context(), Kevin Wolf, 2019/05/23
- [Qemu-devel] [PATCH 11/15] block: Remove wrong bdrv_set_aio_context() calls, Kevin Wolf, 2019/05/23
- [Qemu-devel] [PATCH 01/15] test-block-iothread: Check filter node in test_propagate_mirror, Kevin Wolf, 2019/05/23
- [Qemu-devel] [PATCH 12/15] virtio-scsi-test: Test attaching new overlay with iothreads, Kevin Wolf, 2019/05/23
- [Qemu-devel] [PATCH 13/15] iotests: Attach new devices to node in non-default iothread,
Kevin Wolf <=
- [Qemu-devel] [PATCH 15/15] block: Remove bdrv_set_aio_context(), Kevin Wolf, 2019/05/23
- [Qemu-devel] [PATCH 08/15] test-block-iothread: BlockBackend AioContext across root node change, Kevin Wolf, 2019/05/23
- [Qemu-devel] [PATCH 07/15] test-block-iothread: Test adding parent to iothread node, Kevin Wolf, 2019/05/23
- [Qemu-devel] [PATCH 03/15] block: Add BlockBackend.ctx, Kevin Wolf, 2019/05/23
- [Qemu-devel] [PATCH 04/15] block: Add qdev_prop_drive_iothread property type, Kevin Wolf, 2019/05/23
- Re: [Qemu-devel] [PATCH 00/15] block: AioContext management, part 2, no-reply, 2019/05/23
- [Qemu-devel] [PATCH 1.5/15] nbd-server: Call blk_set_allow_aio_context_change(), Kevin Wolf, 2019/05/24