diff --git a/src/conf/domain_validate.c b/src/conf/domain_validate.c index 563558d920..ad3d17f0fd 100644 --- a/src/conf/domain_validate.c +++ b/src/conf/domain_validate.c @@ -1260,6 +1260,17 @@ virDomainControllerDefValidate(const virDomainControllerDef *controller) } } + if (controller->iothread != 0) { + if (controller->type != VIR_DOMAIN_CONTROLLER_TYPE_SCSI || + !(controller->model == VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VIRTIO_SCSI || + controller->model == VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VIRTIO_TRANSITIONAL || + controller->model == VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VIRTIO_NON_TRANSITIONAL)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("iothreads are supported only by 'virtio-scsi' controllers")); + return -1; + } + } + return 0; } diff --git a/tests/qemuxmlconfdata/controller-virtio-serial-iothread.x86_64-latest.err b/tests/qemuxmlconfdata/controller-virtio-serial-iothread.x86_64-latest.err new file mode 100644 index 0000000000..ac4d8b2370 --- /dev/null +++ b/tests/qemuxmlconfdata/controller-virtio-serial-iothread.x86_64-latest.err @@ -0,0 +1 @@ +XML error: 'iothread' attribute only supported for virtio scsi controllers diff --git a/tests/qemuxmlconfdata/controller-virtio-serial-iothread.xml b/tests/qemuxmlconfdata/controller-virtio-serial-iothread.xml new file mode 100644 index 0000000000..0b523093c7 --- /dev/null +++ b/tests/qemuxmlconfdata/controller-virtio-serial-iothread.xml @@ -0,0 +1,27 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219100 + 219100 + 1 + + hvm + + + + destroy + restart + destroy + + /usr/bin/qemu-system-x86_64 + + + + +
+ + + + + + diff --git a/tests/qemuxmlconftest.c b/tests/qemuxmlconftest.c index c271170d25..905b283f94 100644 --- a/tests/qemuxmlconftest.c +++ b/tests/qemuxmlconftest.c @@ -2824,6 +2824,8 @@ mymain(void) DO_TEST_CAPS_LATEST("virtio-options-rng-packed"); DO_TEST_CAPS_LATEST("virtio-options-video-packed"); + DO_TEST_CAPS_LATEST_PARSE_ERROR("controller-virtio-serial-iothread"); + DO_TEST_CAPS_LATEST("fd-memory-numa-topology"); DO_TEST_CAPS_LATEST("fd-memory-numa-topology2"); DO_TEST_CAPS_LATEST("fd-memory-numa-topology3");