[libvirt] [PATCH 0/8] Add support for virtio-scsi-{pci, ccw} iothread support

Add support for virtio-scsi-{pci,ccw} iothreads. Each patch has details. John Ferlan (8): qemu: Add capability for virtio-scsi iothreads docs: clarify disk iothread support docs: Reformat the Controllers description conf: Move virDomainControllerModelTypeToString conf: Add disk iothread bus check in device post parse conf: Add support for virtio-scsi iothreads qemu: Use switch for qemuCheckIOThreads qemu: Add 'iothread' to command line for supported controller docs/formatdomain.html.in | 87 ++++++--- docs/schemas/domaincommon.rng | 3 + src/conf/domain_conf.c | 61 +++++-- src/conf/domain_conf.h | 1 + src/qemu/qemu_capabilities.c | 9 + src/qemu/qemu_capabilities.h | 1 + src/qemu/qemu_command.c | 115 ++++++++++-- tests/qemucapabilitiesdata/caps_1.2.2-1.replies | 80 +++++---- tests/qemucapabilitiesdata/caps_1.3.1-1.replies | 80 +++++---- tests/qemucapabilitiesdata/caps_1.4.2-1.replies | 88 +++++---- tests/qemucapabilitiesdata/caps_1.5.3-1.replies | 88 +++++---- tests/qemucapabilitiesdata/caps_1.6.0-1.replies | 88 +++++---- tests/qemucapabilitiesdata/caps_1.6.50-1.replies | 88 +++++---- tests/qemucapabilitiesdata/caps_2.1.1-1.replies | 88 +++++---- tests/qemucapabilitiesdata/caps_2.4.0-1.caps | 1 + tests/qemucapabilitiesdata/caps_2.4.0-1.replies | 177 ++++++++++++++---- tests/qemucapabilitiesdata/caps_2.5.0-1.caps | 1 + tests/qemucapabilitiesdata/caps_2.5.0-1.replies | 197 +++++++++++++++++---- tests/qemucapabilitiesdata/caps_2.6.0-1.caps | 1 + tests/qemucapabilitiesdata/caps_2.6.0-1.replies | 192 ++++++++++++++++---- .../qemuxml2argv-iothreads-virtio-scsi-ccw.args | 28 +++ .../qemuxml2argv-iothreads-virtio-scsi-ccw.xml | 39 ++++ .../qemuxml2argv-iothreads-virtio-scsi-pci.args | 32 ++++ .../qemuxml2argv-iothreads-virtio-scsi-pci.xml | 47 +++++ tests/qemuxml2argvtest.c | 6 + .../qemuxml2xmlout-iothreads-virtio-scsi-ccw.xml | 39 ++++ .../qemuxml2xmlout-iothreads-virtio-scsi-pci.xml | 51 ++++++ tests/qemuxml2xmltest.c | 7 + 28 files changed, 1314 insertions(+), 381 deletions(-) create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-iothreads-virtio-scsi-ccw.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-iothreads-virtio-scsi-ccw.xml create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-iothreads-virtio-scsi-pci.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-iothreads-virtio-scsi-pci.xml create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-iothreads-virtio-scsi-ccw.xml create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-iothreads-virtio-scsi-pci.xml -- 2.5.5

An iothread for virtio-scsi is a property of the controller. Add a lookup of the 'virtio-scsi-pci' and 'virtio-scsi-ccw' device properties and parse the output. For both, support for the iothread was added in qemu 2.4 while support for virtio-scsi in general was added in qemu 1.4. Modify the various mock capabilities replies (by hand) to reflect the when virtio-scsi was supported and then specifically when the iothread property was added. For versions prior to 1.4, use the no device error return for virtio-scsi. For versions 1.4 to before 2.4, add some data for virtio-scsi-pci even though it isn't complete we're not looking for anything specific there anyway. For 2.4 to 2.6, add a more complete reply. Signed-off-by: John Ferlan <jferlan@redhat.com> --- src/qemu/qemu_capabilities.c | 9 ++ src/qemu/qemu_capabilities.h | 1 + tests/qemucapabilitiesdata/caps_1.2.2-1.replies | 80 +++++---- tests/qemucapabilitiesdata/caps_1.3.1-1.replies | 80 +++++---- tests/qemucapabilitiesdata/caps_1.4.2-1.replies | 88 ++++++---- tests/qemucapabilitiesdata/caps_1.5.3-1.replies | 88 ++++++---- tests/qemucapabilitiesdata/caps_1.6.0-1.replies | 88 ++++++---- tests/qemucapabilitiesdata/caps_1.6.50-1.replies | 88 ++++++---- tests/qemucapabilitiesdata/caps_2.1.1-1.replies | 88 ++++++---- tests/qemucapabilitiesdata/caps_2.4.0-1.caps | 1 + tests/qemucapabilitiesdata/caps_2.4.0-1.replies | 177 ++++++++++++++++---- tests/qemucapabilitiesdata/caps_2.5.0-1.caps | 1 + tests/qemucapabilitiesdata/caps_2.5.0-1.replies | 197 +++++++++++++++++++---- tests/qemucapabilitiesdata/caps_2.6.0-1.caps | 1 + tests/qemucapabilitiesdata/caps_2.6.0-1.replies | 192 ++++++++++++++++++---- 15 files changed, 851 insertions(+), 328 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index de54788..c6226f9 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -325,6 +325,7 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST, "pxb", "pxb-pcie", /* 220 */ + "virtio-scsi-pci.iothread", ); @@ -1603,6 +1604,10 @@ static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsVirtioNet[] = { { "event_idx", QEMU_CAPS_VIRTIO_NET_EVENT_IDX }, }; +static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsVirtioSCSI[] = { + { "iothread", QEMU_CAPS_VIRTIO_SCSI_IOTHREAD }, +}; + static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsPCIAssign[] = { { "rombar", QEMU_CAPS_PCI_ROMBAR }, { "configfd", QEMU_CAPS_PCI_CONFIGFD }, @@ -1694,10 +1699,14 @@ static struct virQEMUCapsObjectTypeProps virQEMUCapsObjectProps[] = { ARRAY_CARDINALITY(virQEMUCapsObjectPropsVirtioBlk) }, { "virtio-net-pci", virQEMUCapsObjectPropsVirtioNet, ARRAY_CARDINALITY(virQEMUCapsObjectPropsVirtioNet) }, + { "virtio-scsi-pci", virQEMUCapsObjectPropsVirtioSCSI, + ARRAY_CARDINALITY(virQEMUCapsObjectPropsVirtioSCSI) }, { "virtio-blk-ccw", virQEMUCapsObjectPropsVirtioBlk, ARRAY_CARDINALITY(virQEMUCapsObjectPropsVirtioBlk) }, { "virtio-net-ccw", virQEMUCapsObjectPropsVirtioNet, ARRAY_CARDINALITY(virQEMUCapsObjectPropsVirtioNet) }, + { "virtio-scsi-ccw", virQEMUCapsObjectPropsVirtioSCSI, + ARRAY_CARDINALITY(virQEMUCapsObjectPropsVirtioSCSI) }, { "virtio-blk-s390", virQEMUCapsObjectPropsVirtioBlk, ARRAY_CARDINALITY(virQEMUCapsObjectPropsVirtioBlk) }, { "virtio-net-s390", virQEMUCapsObjectPropsVirtioNet, diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index 83b8be3..a6a095e 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -356,6 +356,7 @@ typedef enum { /* 220 */ QEMU_CAPS_DEVICE_PXB_PCIE, /* -device pxb-pcie */ + QEMU_CAPS_VIRTIO_SCSI_IOTHREAD, /* virtio-scsi-{pci,ccw}.iothread */ QEMU_CAPS_LAST /* this must always be the last item */ } virQEMUCapsFlags; diff --git a/tests/qemucapabilitiesdata/caps_1.2.2-1.replies b/tests/qemucapabilitiesdata/caps_1.2.2-1.replies index fbddf3d..dd4b403 100644 --- a/tests/qemucapabilitiesdata/caps_1.2.2-1.replies +++ b/tests/qemucapabilitiesdata/caps_1.2.2-1.replies @@ -1025,7 +1025,7 @@ "id": "libvirt-10", "error": { "class": "DeviceNotFound", - "desc": "Device 'virtio-blk-ccw' not found" + "desc": "Device 'virtio-scsi-pci' not found" } } @@ -1033,7 +1033,7 @@ "id": "libvirt-11", "error": { "class": "DeviceNotFound", - "desc": "Device 'virtio-net-ccw' not found" + "desc": "Device 'virtio-blk-ccw' not found" } } @@ -1041,7 +1041,7 @@ "id": "libvirt-12", "error": { "class": "DeviceNotFound", - "desc": "Device 'virtio-blk-s390' not found" + "desc": "Device 'virtio-net-ccw' not found" } } @@ -1049,7 +1049,7 @@ "id": "libvirt-13", "error": { "class": "DeviceNotFound", - "desc": "Device 'virtio-net-s390' not found" + "desc": "Device 'virtio-scsi-ccw' not found" } } @@ -1057,7 +1057,7 @@ "id": "libvirt-14", "error": { "class": "DeviceNotFound", - "desc": "Device 'pci-assign' not found" + "desc": "Device 'virtio-blk-s390' not found" } } @@ -1065,7 +1065,7 @@ "id": "libvirt-15", "error": { "class": "DeviceNotFound", - "desc": "Device 'kvm-pci-assign' not found" + "desc": "Device 'virtio-net-s390' not found" } } @@ -1073,6 +1073,22 @@ "id": "libvirt-16", "error": { "class": "DeviceNotFound", + "desc": "Device 'pci-assign' not found" + } +} + +{ + "id": "libvirt-17", + "error": { + "class": "DeviceNotFound", + "desc": "Device 'kvm-pci-assign' not found" + } +} + +{ + "id": "libvirt-18", + "error": { + "class": "DeviceNotFound", "desc": "Device 'vfio-pci' not found" } } @@ -1148,7 +1164,7 @@ "type": "drive" } ], - "id": "libvirt-17" + "id": "libvirt-19" } { @@ -1202,7 +1218,7 @@ "type": "drive" } ], - "id": "libvirt-18" + "id": "libvirt-20" } { @@ -1244,11 +1260,11 @@ "type": "uint32" } ], - "id": "libvirt-19" + "id": "libvirt-21" } { - "id": "libvirt-20", + "id": "libvirt-22", "error": { "class": "DeviceNotFound", "desc": "Device 'usb-redir' not found" @@ -1298,7 +1314,7 @@ "type": "uint32" } ], - "id": "libvirt-21" + "id": "libvirt-23" } { @@ -1324,17 +1340,17 @@ "type": "drive" } ], - "id": "libvirt-22" + "id": "libvirt-24" } { "return": [ ], - "id": "libvirt-23" + "id": "libvirt-25" } { - "id": "libvirt-24", + "id": "libvirt-26", "error": { "class": "DeviceNotFound", "desc": "Device 'q35-pcihost' not found" @@ -1388,7 +1404,7 @@ "type": "drive" } ], - "id": "libvirt-25" + "id": "libvirt-27" } { @@ -1402,7 +1418,7 @@ "type": "hex32" } ], - "id": "libvirt-26" + "id": "libvirt-28" } { @@ -1432,7 +1448,7 @@ "type": "uint32" } ], - "id": "libvirt-27" + "id": "libvirt-29" } { @@ -1462,7 +1478,7 @@ "type": "uint32" } ], - "id": "libvirt-28" + "id": "libvirt-30" } { @@ -1528,7 +1544,7 @@ "type": "uint32" } ], - "id": "libvirt-29" + "id": "libvirt-31" } { @@ -1594,11 +1610,11 @@ "type": "uint32" } ], - "id": "libvirt-30" + "id": "libvirt-32" } { - "id": "libvirt-31", + "id": "libvirt-33", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-gpu-pci' not found" @@ -1606,7 +1622,7 @@ } { - "id": "libvirt-32", + "id": "libvirt-34", "error": { "class": "DeviceNotFound", "desc": "Device 'ICH9-LPC' not found" @@ -1649,11 +1665,11 @@ "type": "on/off" } ], - "id": "libvirt-33" + "id": "libvirt-35" } { - "id": "libvirt-34", + "id": "libvirt-36", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-balloon-ccw' not found" @@ -1661,7 +1677,7 @@ } { - "id": "libvirt-35", + "id": "libvirt-37", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-balloon-device' not found" @@ -1712,7 +1728,7 @@ "name": "none" } ], - "id": "libvirt-36" + "id": "libvirt-38" } { @@ -1784,7 +1800,7 @@ "name": "Opteron_G4" } ], - "id": "libvirt-37" + "id": "libvirt-39" } { @@ -1792,11 +1808,11 @@ "enabled": false, "present": true }, - "id": "libvirt-38" + "id": "libvirt-40" } { - "id": "libvirt-39", + "id": "libvirt-41", "error": { "class": "CommandNotFound", "desc": "The command query-tpm-models has not been found" @@ -1804,7 +1820,7 @@ } { - "id": "libvirt-40", + "id": "libvirt-42", "error": { "class": "CommandNotFound", "desc": "The command query-tpm-types has not been found" @@ -1812,7 +1828,7 @@ } { - "id": "libvirt-41", + "id": "libvirt-43", "error": { "class": "CommandNotFound", "desc": "The command query-command-line-options has not been found" @@ -1826,5 +1842,5 @@ "state": false } ], - "id": "libvirt-42" + "id": "libvirt-44" } diff --git a/tests/qemucapabilitiesdata/caps_1.3.1-1.replies b/tests/qemucapabilitiesdata/caps_1.3.1-1.replies index 2542b67..d2d9d14 100644 --- a/tests/qemucapabilitiesdata/caps_1.3.1-1.replies +++ b/tests/qemucapabilitiesdata/caps_1.3.1-1.replies @@ -1126,7 +1126,7 @@ "id": "libvirt-11", "error": { "class": "DeviceNotFound", - "desc": "Device 'virtio-blk-ccw' not found" + "desc": "Device 'virtio-scsi-pci' not found" } } @@ -1134,7 +1134,7 @@ "id": "libvirt-12", "error": { "class": "DeviceNotFound", - "desc": "Device 'virtio-net-ccw' not found" + "desc": "Device 'virtio-blk-ccw' not found" } } @@ -1142,7 +1142,7 @@ "id": "libvirt-13", "error": { "class": "DeviceNotFound", - "desc": "Device 'virtio-blk-s390' not found" + "desc": "Device 'virtio-net-ccw' not found" } } @@ -1150,7 +1150,7 @@ "id": "libvirt-14", "error": { "class": "DeviceNotFound", - "desc": "Device 'virtio-net-s390' not found" + "desc": "Device 'virtio-scsi-ccw' not found" } } @@ -1158,6 +1158,22 @@ "id": "libvirt-15", "error": { "class": "DeviceNotFound", + "desc": "Device 'virtio-blk-s390' not found" + } +} + +{ + "id": "libvirt-16", + "error": { + "class": "DeviceNotFound", + "desc": "Device 'virtio-net-s390' not found" + } +} + +{ + "id": "libvirt-17", + "error": { + "class": "DeviceNotFound", "desc": "Device 'pci-assign' not found" } } @@ -1205,7 +1221,7 @@ "type": "pci-host-devaddr" } ], - "id": "libvirt-16" + "id": "libvirt-18" } { @@ -1239,7 +1255,7 @@ "type": "pci-host-devaddr" } ], - "id": "libvirt-17" + "id": "libvirt-19" } { @@ -1313,7 +1329,7 @@ "type": "drive" } ], - "id": "libvirt-18" + "id": "libvirt-20" } { @@ -1367,7 +1383,7 @@ "type": "drive" } ], - "id": "libvirt-19" + "id": "libvirt-21" } { @@ -1409,11 +1425,11 @@ "type": "uint32" } ], - "id": "libvirt-20" + "id": "libvirt-22" } { - "id": "libvirt-21", + "id": "libvirt-23", "error": { "class": "DeviceNotFound", "desc": "Device 'usb-redir' not found" @@ -1463,7 +1479,7 @@ "type": "uint32" } ], - "id": "libvirt-22" + "id": "libvirt-24" } { @@ -1489,13 +1505,13 @@ "type": "drive" } ], - "id": "libvirt-23" + "id": "libvirt-25" } { "return": [ ], - "id": "libvirt-24" + "id": "libvirt-26" } { @@ -1505,7 +1521,7 @@ "type": "uint64" } ], - "id": "libvirt-25" + "id": "libvirt-27" } { @@ -1555,7 +1571,7 @@ "type": "drive" } ], - "id": "libvirt-26" + "id": "libvirt-28" } { @@ -1569,7 +1585,7 @@ "type": "hex32" } ], - "id": "libvirt-27" + "id": "libvirt-29" } { @@ -1603,7 +1619,7 @@ "type": "uint32" } ], - "id": "libvirt-28" + "id": "libvirt-30" } { @@ -1633,7 +1649,7 @@ "type": "uint32" } ], - "id": "libvirt-29" + "id": "libvirt-31" } { @@ -1703,7 +1719,7 @@ "type": "uint32" } ], - "id": "libvirt-30" + "id": "libvirt-32" } { @@ -1773,11 +1789,11 @@ "type": "uint32" } ], - "id": "libvirt-31" + "id": "libvirt-33" } { - "id": "libvirt-32", + "id": "libvirt-34", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-gpu-pci' not found" @@ -1785,7 +1801,7 @@ } { - "id": "libvirt-33", + "id": "libvirt-35", "error": { "class": "DeviceNotFound", "desc": "Device 'ICH9-LPC' not found" @@ -1827,11 +1843,11 @@ "type": "on/off" } ], - "id": "libvirt-34" + "id": "libvirt-36" } { - "id": "libvirt-35", + "id": "libvirt-37", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-balloon-ccw' not found" @@ -1839,7 +1855,7 @@ } { - "id": "libvirt-36", + "id": "libvirt-38", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-balloon-device' not found" @@ -1897,7 +1913,7 @@ "name": "none" } ], - "id": "libvirt-37" + "id": "libvirt-39" } { @@ -1975,7 +1991,7 @@ "name": "Opteron_G5" } ], - "id": "libvirt-38" + "id": "libvirt-40" } { @@ -1983,11 +1999,11 @@ "enabled": false, "present": true }, - "id": "libvirt-39" + "id": "libvirt-41" } { - "id": "libvirt-40", + "id": "libvirt-42", "error": { "class": "CommandNotFound", "desc": "The command query-tpm-models has not been found" @@ -1995,7 +2011,7 @@ } { - "id": "libvirt-41", + "id": "libvirt-43", "error": { "class": "CommandNotFound", "desc": "The command query-tpm-types has not been found" @@ -2003,7 +2019,7 @@ } { - "id": "libvirt-42", + "id": "libvirt-44", "error": { "class": "CommandNotFound", "desc": "The command query-command-line-options has not been found" @@ -2017,5 +2033,5 @@ "state": false } ], - "id": "libvirt-43" + "id": "libvirt-45" } diff --git a/tests/qemucapabilitiesdata/caps_1.4.2-1.replies b/tests/qemucapabilitiesdata/caps_1.4.2-1.replies index 46c3292..65aa34b 100644 --- a/tests/qemucapabilitiesdata/caps_1.4.2-1.replies +++ b/tests/qemucapabilitiesdata/caps_1.4.2-1.replies @@ -1170,7 +1170,21 @@ } { - "id": "libvirt-11", + "return": [ + { + "name": "ioeventfd", + "type": "on/off" + }, + { + "name": "vectors", + "type": "uint32" + } + ], + "id": "libvirt-11" +} + +{ + "id": "libvirt-12", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-blk-ccw' not found" @@ -1178,7 +1192,7 @@ } { - "id": "libvirt-12", + "id": "libvirt-13", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-net-ccw' not found" @@ -1186,7 +1200,15 @@ } { - "id": "libvirt-13", + "id": "libvirt-14", + "error": { + "class": "DeviceNotFound", + "desc": "Device 'virtio-scsi-ccw' not found" + } +} + +{ + "id": "libvirt-15", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-blk-s390' not found" @@ -1194,7 +1216,7 @@ } { - "id": "libvirt-14", + "id": "libvirt-16", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-net-s390' not found" @@ -1202,7 +1224,7 @@ } { - "id": "libvirt-15", + "id": "libvirt-17", "error": { "class": "DeviceNotFound", "desc": "Device 'pci-assign' not found" @@ -1252,7 +1274,7 @@ "type": "pci-host-devaddr" } ], - "id": "libvirt-16" + "id": "libvirt-18" } { @@ -1286,7 +1308,7 @@ "type": "pci-host-devaddr" } ], - "id": "libvirt-17" + "id": "libvirt-19" } { @@ -1360,7 +1382,7 @@ "type": "drive" } ], - "id": "libvirt-18" + "id": "libvirt-20" } { @@ -1414,7 +1436,7 @@ "type": "drive" } ], - "id": "libvirt-19" + "id": "libvirt-21" } { @@ -1456,11 +1478,11 @@ "type": "uint32" } ], - "id": "libvirt-20" + "id": "libvirt-22" } { - "id": "libvirt-21", + "id": "libvirt-23", "error": { "class": "DeviceNotFound", "desc": "Device 'usb-redir' not found" @@ -1510,7 +1532,7 @@ "type": "uint32" } ], - "id": "libvirt-22" + "id": "libvirt-24" } { @@ -1536,13 +1558,13 @@ "type": "drive" } ], - "id": "libvirt-23" + "id": "libvirt-25" } { "return": [ ], - "id": "libvirt-24" + "id": "libvirt-26" } { @@ -1552,7 +1574,7 @@ "type": "uint64" } ], - "id": "libvirt-25" + "id": "libvirt-27" } { @@ -1602,7 +1624,7 @@ "type": "drive" } ], - "id": "libvirt-26" + "id": "libvirt-28" } { @@ -1616,7 +1638,7 @@ "type": "hex32" } ], - "id": "libvirt-27" + "id": "libvirt-29" } { @@ -1650,7 +1672,7 @@ "type": "uint32" } ], - "id": "libvirt-28" + "id": "libvirt-30" } { @@ -1680,7 +1702,7 @@ "type": "uint32" } ], - "id": "libvirt-29" + "id": "libvirt-31" } { @@ -1750,7 +1772,7 @@ "type": "uint32" } ], - "id": "libvirt-30" + "id": "libvirt-32" } { @@ -1820,11 +1842,11 @@ "type": "uint32" } ], - "id": "libvirt-31" + "id": "libvirt-33" } { - "id": "libvirt-32", + "id": "libvirt-34", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-gpu-pci' not found" @@ -1832,7 +1854,7 @@ } { - "id": "libvirt-33", + "id": "libvirt-35", "error": { "class": "DeviceNotFound", "desc": "Device 'ICH9-LPC' not found" @@ -1875,11 +1897,11 @@ "type": "on/off" } ], - "id": "libvirt-34" + "id": "libvirt-36" } { - "id": "libvirt-35", + "id": "libvirt-37", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-balloon-ccw' not found" @@ -1887,7 +1909,7 @@ } { - "id": "libvirt-36", + "id": "libvirt-38", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-balloon-device' not found" @@ -1948,7 +1970,7 @@ "name": "none" } ], - "id": "libvirt-37" + "id": "libvirt-39" } { @@ -2026,7 +2048,7 @@ "name": "qemu64" } ], - "id": "libvirt-38" + "id": "libvirt-40" } { @@ -2034,11 +2056,11 @@ "enabled": false, "present": true }, - "id": "libvirt-39" + "id": "libvirt-41" } { - "id": "libvirt-40", + "id": "libvirt-42", "error": { "class": "CommandNotFound", "desc": "The command query-tpm-models has not been found" @@ -2046,7 +2068,7 @@ } { - "id": "libvirt-41", + "id": "libvirt-43", "error": { "class": "CommandNotFound", "desc": "The command query-tpm-types has not been found" @@ -2054,7 +2076,7 @@ } { - "id": "libvirt-42", + "id": "libvirt-44", "error": { "class": "CommandNotFound", "desc": "The command query-command-line-options has not been found" @@ -2068,5 +2090,5 @@ "state": false } ], - "id": "libvirt-43" + "id": "libvirt-45" } diff --git a/tests/qemucapabilitiesdata/caps_1.5.3-1.replies b/tests/qemucapabilitiesdata/caps_1.5.3-1.replies index 37a735f..7223aad 100644 --- a/tests/qemucapabilitiesdata/caps_1.5.3-1.replies +++ b/tests/qemucapabilitiesdata/caps_1.5.3-1.replies @@ -1236,7 +1236,21 @@ } { - "id": "libvirt-11", + "return": [ + { + "name": "ioeventfd", + "type": "on/off" + }, + { + "name": "vectors", + "type": "uint32" + } + ], + "id": "libvirt-11" +} + +{ + "id": "libvirt-12", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-blk-ccw' not found" @@ -1244,7 +1258,7 @@ } { - "id": "libvirt-12", + "id": "libvirt-13", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-net-ccw' not found" @@ -1252,7 +1266,15 @@ } { - "id": "libvirt-13", + "id": "libvirt-14", + "error": { + "class": "DeviceNotFound", + "desc": "Device 'virtio-scsi-ccw' not found" + } +} + +{ + "id": "libvirt-15", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-blk-s390' not found" @@ -1260,7 +1282,7 @@ } { - "id": "libvirt-14", + "id": "libvirt-16", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-net-s390' not found" @@ -1268,7 +1290,7 @@ } { - "id": "libvirt-15", + "id": "libvirt-17", "error": { "class": "DeviceNotFound", "desc": "Device 'pci-assign' not found" @@ -1318,7 +1340,7 @@ "type": "pci-host-devaddr" } ], - "id": "libvirt-16" + "id": "libvirt-18" } { @@ -1360,7 +1382,7 @@ "type": "pci-host-devaddr" } ], - "id": "libvirt-17" + "id": "libvirt-19" } { @@ -1434,7 +1456,7 @@ "type": "drive" } ], - "id": "libvirt-18" + "id": "libvirt-20" } { @@ -1488,7 +1510,7 @@ "type": "drive" } ], - "id": "libvirt-19" + "id": "libvirt-21" } { @@ -1530,11 +1552,11 @@ "type": "uint32" } ], - "id": "libvirt-20" + "id": "libvirt-22" } { - "id": "libvirt-21", + "id": "libvirt-23", "error": { "class": "DeviceNotFound", "desc": "Device 'usb-redir' not found" @@ -1584,7 +1606,7 @@ "type": "uint32" } ], - "id": "libvirt-22" + "id": "libvirt-24" } { @@ -1610,13 +1632,13 @@ "type": "drive" } ], - "id": "libvirt-23" + "id": "libvirt-25" } { "return": [ ], - "id": "libvirt-24" + "id": "libvirt-26" } { @@ -1626,7 +1648,7 @@ "type": "uint64" } ], - "id": "libvirt-25" + "id": "libvirt-27" } { @@ -1676,7 +1698,7 @@ "type": "drive" } ], - "id": "libvirt-26" + "id": "libvirt-28" } { @@ -1690,7 +1712,7 @@ "type": "hex32" } ], - "id": "libvirt-27" + "id": "libvirt-29" } { @@ -1724,7 +1746,7 @@ "type": "uint32" } ], - "id": "libvirt-28" + "id": "libvirt-30" } { @@ -1754,7 +1776,7 @@ "type": "uint32" } ], - "id": "libvirt-29" + "id": "libvirt-31" } { @@ -1824,7 +1846,7 @@ "type": "uint32" } ], - "id": "libvirt-30" + "id": "libvirt-32" } { @@ -1894,11 +1916,11 @@ "type": "uint32" } ], - "id": "libvirt-31" + "id": "libvirt-33" } { - "id": "libvirt-32", + "id": "libvirt-34", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-gpu-pci' not found" @@ -1906,7 +1928,7 @@ } { - "id": "libvirt-33", + "id": "libvirt-35", "error": { "class": "DeviceNotFound", "desc": "Device 'ICH9-LPC' not found" @@ -1948,11 +1970,11 @@ "type": "on/off" } ], - "id": "libvirt-34" + "id": "libvirt-36" } { - "id": "libvirt-35", + "id": "libvirt-37", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-balloon-ccw' not found" @@ -1962,7 +1984,7 @@ { "return": [ ], - "id": "libvirt-36" + "id": "libvirt-38" } { @@ -2035,7 +2057,7 @@ "cpu-max": 1 } ], - "id": "libvirt-37" + "id": "libvirt-39" } { @@ -2113,7 +2135,7 @@ "name": "qemu64" } ], - "id": "libvirt-38" + "id": "libvirt-40" } { @@ -2121,19 +2143,19 @@ "enabled": false, "present": true }, - "id": "libvirt-39" + "id": "libvirt-41" } { "return": [ ], - "id": "libvirt-40" + "id": "libvirt-42" } { "return": [ ], - "id": "libvirt-41" + "id": "libvirt-43" } { @@ -2809,7 +2831,7 @@ "option": "drive" } ], - "id": "libvirt-42" + "id": "libvirt-44" } { @@ -2819,5 +2841,5 @@ "state": false } ], - "id": "libvirt-43" + "id": "libvirt-45" } diff --git a/tests/qemucapabilitiesdata/caps_1.6.0-1.replies b/tests/qemucapabilitiesdata/caps_1.6.0-1.replies index 8932702..0b8381d 100644 --- a/tests/qemucapabilitiesdata/caps_1.6.0-1.replies +++ b/tests/qemucapabilitiesdata/caps_1.6.0-1.replies @@ -1286,7 +1286,21 @@ } { - "id": "libvirt-11", + "return": [ + { + "name": "ioeventfd", + "type": "on/off" + }, + { + "name": "vectors", + "type": "uint32" + } + ], + "id": "libvirt-11" +} + +{ + "id": "libvirt-12", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-blk-ccw' not found" @@ -1294,7 +1308,7 @@ } { - "id": "libvirt-12", + "id": "libvirt-13", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-net-ccw' not found" @@ -1302,7 +1316,15 @@ } { - "id": "libvirt-13", + "id": "libvirt-14", + "error": { + "class": "DeviceNotFound", + "desc": "Device 'virtio-scsi-ccw' not found" + } +} + +{ + "id": "libvirt-15", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-blk-s390' not found" @@ -1310,7 +1332,7 @@ } { - "id": "libvirt-14", + "id": "libvirt-15", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-net-s390' not found" @@ -1318,7 +1340,7 @@ } { - "id": "libvirt-15", + "id": "libvirt-17", "error": { "class": "DeviceNotFound", "desc": "Device 'pci-assign' not found" @@ -1368,7 +1390,7 @@ "type": "pci-host-devaddr" } ], - "id": "libvirt-16" + "id": "libvirt-18" } { @@ -1410,7 +1432,7 @@ "type": "pci-host-devaddr" } ], - "id": "libvirt-17" + "id": "libvirt-19" } { @@ -1484,7 +1506,7 @@ "type": "drive" } ], - "id": "libvirt-18" + "id": "libvirt-20" } { @@ -1538,7 +1560,7 @@ "type": "drive" } ], - "id": "libvirt-19" + "id": "libvirt-21" } { @@ -1580,11 +1602,11 @@ "type": "uint32" } ], - "id": "libvirt-20" + "id": "libvirt-22" } { - "id": "libvirt-21", + "id": "libvirt-23", "error": { "class": "DeviceNotFound", "desc": "Device 'usb-redir' not found" @@ -1638,7 +1660,7 @@ "type": "uint32" } ], - "id": "libvirt-22" + "id": "libvirt-24" } { @@ -1664,7 +1686,7 @@ "type": "drive" } ], - "id": "libvirt-23" + "id": "libvirt-25" } { @@ -1674,7 +1696,7 @@ "type": "size" } ], - "id": "libvirt-24" + "id": "libvirt-26" } { @@ -1688,7 +1710,7 @@ "type": "uint64" } ], - "id": "libvirt-25" + "id": "libvirt-27" } { @@ -1738,7 +1760,7 @@ "type": "drive" } ], - "id": "libvirt-26" + "id": "libvirt-28" } { @@ -1752,7 +1774,7 @@ "type": "hex32" } ], - "id": "libvirt-27" + "id": "libvirt-29" } { @@ -1786,7 +1808,7 @@ "type": "uint32" } ], - "id": "libvirt-28" + "id": "libvirt-30" } { @@ -1816,7 +1838,7 @@ "type": "uint32" } ], - "id": "libvirt-29" + "id": "libvirt-31" } { @@ -1886,7 +1908,7 @@ "type": "uint32" } ], - "id": "libvirt-30" + "id": "libvirt-32" } { @@ -1956,11 +1978,11 @@ "type": "uint32" } ], - "id": "libvirt-31" + "id": "libvirt-33" } { - "id": "libvirt-32", + "id": "libvirt-34", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-gpu-pci' not found" @@ -1968,7 +1990,7 @@ } { - "id": "libvirt-33", + "id": "libvirt-35", "error": { "class": "DeviceNotFound", "desc": "Device 'ICH9-LPC' not found" @@ -2010,11 +2032,11 @@ "type": "on/off" } ], - "id": "libvirt-34" + "id": "libvirt-36" } { - "id": "libvirt-35", + "id": "libvirt-37", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-balloon-ccw' not found" @@ -2024,7 +2046,7 @@ { "return": [ ], - "id": "libvirt-36" + "id": "libvirt-38" } { @@ -2113,7 +2135,7 @@ "cpu-max": 1 } ], - "id": "libvirt-37" + "id": "libvirt-39" } { @@ -2191,7 +2213,7 @@ "name": "qemu64" } ], - "id": "libvirt-38" + "id": "libvirt-40" } { @@ -2199,19 +2221,19 @@ "enabled": false, "present": true }, - "id": "libvirt-39" + "id": "libvirt-41" } { "return": [ ], - "id": "libvirt-40" + "id": "libvirt-42" } { "return": [ ], - "id": "libvirt-41" + "id": "libvirt-43" } { @@ -2789,7 +2811,7 @@ "option": "drive" } ], - "id": "libvirt-42" + "id": "libvirt-44" } { @@ -2811,5 +2833,5 @@ "state": false } ], - "id": "libvirt-43" + "id": "libvirt-45" } diff --git a/tests/qemucapabilitiesdata/caps_1.6.50-1.replies b/tests/qemucapabilitiesdata/caps_1.6.50-1.replies index b9bb9a3..b986a30 100644 --- a/tests/qemucapabilitiesdata/caps_1.6.50-1.replies +++ b/tests/qemucapabilitiesdata/caps_1.6.50-1.replies @@ -1292,7 +1292,21 @@ } { - "id": "libvirt-11", + "return": [ + { + "name": "ioeventfd", + "type": "on/off" + }, + { + "name": "vectors", + "type": "uint32" + } + ], + "id": "libvirt-11" +} + +{ + "id": "libvirt-12", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-blk-ccw' not found" @@ -1300,7 +1314,7 @@ } { - "id": "libvirt-12", + "id": "libvirt-13", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-net-ccw' not found" @@ -1308,7 +1322,15 @@ } { - "id": "libvirt-13", + "id": "libvirt-14", + "error": { + "class": "DeviceNotFound", + "desc": "Device 'virtio-scsi-ccw' not found" + } +} + +{ + "id": "libvirt-15", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-blk-s390' not found" @@ -1316,7 +1338,7 @@ } { - "id": "libvirt-14", + "id": "libvirt-16", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-net-s390' not found" @@ -1324,7 +1346,7 @@ } { - "id": "libvirt-15", + "id": "libvirt-17", "error": { "class": "DeviceNotFound", "desc": "Device 'pci-assign' not found" @@ -1374,7 +1396,7 @@ "type": "pci-host-devaddr" } ], - "id": "libvirt-16" + "id": "libvirt-18" } { @@ -1416,7 +1438,7 @@ "type": "pci-host-devaddr" } ], - "id": "libvirt-17" + "id": "libvirt-19" } { @@ -1490,7 +1512,7 @@ "type": "drive" } ], - "id": "libvirt-18" + "id": "libvirt-20" } { @@ -1544,7 +1566,7 @@ "type": "drive" } ], - "id": "libvirt-19" + "id": "libvirt-21" } { @@ -1586,11 +1608,11 @@ "type": "uint32" } ], - "id": "libvirt-20" + "id": "libvirt-22" } { - "id": "libvirt-21", + "id": "libvirt-23", "error": { "class": "DeviceNotFound", "desc": "Device 'usb-redir' not found" @@ -1598,7 +1620,7 @@ } { - "id": "libvirt-22", + "id": "libvirt-24", "error": { "class": "DeviceNotFound", "desc": "Device 'usb-host' not found" @@ -1628,7 +1650,7 @@ "type": "drive" } ], - "id": "libvirt-23" + "id": "libvirt-25" } { @@ -1638,7 +1660,7 @@ "type": "size" } ], - "id": "libvirt-24" + "id": "libvirt-26" } { @@ -1652,7 +1674,7 @@ "type": "uint64" } ], - "id": "libvirt-25" + "id": "libvirt-27" } { @@ -1702,7 +1724,7 @@ "type": "drive" } ], - "id": "libvirt-26" + "id": "libvirt-28" } { @@ -1716,7 +1738,7 @@ "type": "hex32" } ], - "id": "libvirt-27" + "id": "libvirt-29" } { @@ -1750,7 +1772,7 @@ "type": "uint32" } ], - "id": "libvirt-28" + "id": "libvirt-30" } { @@ -1780,7 +1802,7 @@ "type": "uint32" } ], - "id": "libvirt-29" + "id": "libvirt-31" } { @@ -1850,7 +1872,7 @@ "type": "uint32" } ], - "id": "libvirt-30" + "id": "libvirt-32" } { @@ -1920,11 +1942,11 @@ "type": "uint32" } ], - "id": "libvirt-31" + "id": "libvirt-33" } { - "id": "libvirt-32", + "id": "libvirt-34", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-gpu-pci' not found" @@ -1932,7 +1954,7 @@ } { - "id": "libvirt-33", + "id": "libvirt-35", "error": { "class": "DeviceNotFound", "desc": "Device 'ICH9-LPC' not found" @@ -1974,11 +1996,11 @@ "type": "on/off" } ], - "id": "libvirt-34" + "id": "libvirt-36" } { - "id": "libvirt-35", + "id": "libvirt-37", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-balloon-ccw' not found" @@ -1988,7 +2010,7 @@ { "return": [ ], - "id": "libvirt-36" + "id": "libvirt-38" } { @@ -2085,7 +2107,7 @@ "cpu-max": 1 } ], - "id": "libvirt-37" + "id": "libvirt-39" } { @@ -2163,7 +2185,7 @@ "name": "qemu64" } ], - "id": "libvirt-38" + "id": "libvirt-40" } { @@ -2171,19 +2193,19 @@ "enabled": false, "present": true }, - "id": "libvirt-39" + "id": "libvirt-41" } { "return": [ ], - "id": "libvirt-40" + "id": "libvirt-42" } { "return": [ ], - "id": "libvirt-41" + "id": "libvirt-43" } { @@ -2771,7 +2793,7 @@ "option": "drive" } ], - "id": "libvirt-42" + "id": "libvirt-44" } { @@ -2793,5 +2815,5 @@ "state": false } ], - "id": "libvirt-43" + "id": "libvirt-45" } diff --git a/tests/qemucapabilitiesdata/caps_2.1.1-1.replies b/tests/qemucapabilitiesdata/caps_2.1.1-1.replies index fabda55..d363917 100644 --- a/tests/qemucapabilitiesdata/caps_2.1.1-1.replies +++ b/tests/qemucapabilitiesdata/caps_2.1.1-1.replies @@ -1566,7 +1566,21 @@ } { - "id": "libvirt-11", + "return": [ + { + "name": "ioeventfd", + "type": "on/off" + }, + { + "name": "vectors", + "type": "uint32" + } + ], + "id": "libvirt-11" +} + +{ + "id": "libvirt-12", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-blk-ccw' not found" @@ -1574,7 +1588,7 @@ } { - "id": "libvirt-12", + "id": "libvirt-13", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-net-ccw' not found" @@ -1582,7 +1596,15 @@ } { - "id": "libvirt-13", + "id": "libvirt-14", + "error": { + "class": "DeviceNotFound", + "desc": "Device 'virtio-scsi-ccw' not found" + } +} + +{ + "id": "libvirt-15", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-blk-s390' not found" @@ -1590,7 +1612,7 @@ } { - "id": "libvirt-14", + "id": "libvirt-16", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-net-s390' not found" @@ -1598,7 +1620,7 @@ } { - "id": "libvirt-15", + "id": "libvirt-17", "error": { "class": "DeviceNotFound", "desc": "Device 'pci-assign' not found" @@ -1648,7 +1670,7 @@ "type": "pci-host-devaddr" } ], - "id": "libvirt-16" + "id": "libvirt-18" } { @@ -1690,7 +1712,7 @@ "type": "pci-host-devaddr" } ], - "id": "libvirt-17" + "id": "libvirt-19" } { @@ -1776,7 +1798,7 @@ "type": "drive" } ], - "id": "libvirt-18" + "id": "libvirt-20" } { @@ -1830,7 +1852,7 @@ "type": "drive" } ], - "id": "libvirt-19" + "id": "libvirt-21" } { @@ -1880,7 +1902,7 @@ "type": "uint32" } ], - "id": "libvirt-20" + "id": "libvirt-22" } { @@ -1918,7 +1940,7 @@ "type": "chr" } ], - "id": "libvirt-21" + "id": "libvirt-23" } { @@ -1980,7 +2002,7 @@ "type": "uint32" } ], - "id": "libvirt-22" + "id": "libvirt-24" } { @@ -2006,7 +2028,7 @@ "type": "drive" } ], - "id": "libvirt-23" + "id": "libvirt-25" } { @@ -2044,7 +2066,7 @@ "type": "size" } ], - "id": "libvirt-24" + "id": "libvirt-26" } { @@ -2094,7 +2116,7 @@ "type": "uint64" } ], - "id": "libvirt-25" + "id": "libvirt-27" } { @@ -2148,7 +2170,7 @@ "type": "drive" } ], - "id": "libvirt-26" + "id": "libvirt-28" } { @@ -2162,7 +2184,7 @@ "type": "uint32" } ], - "id": "libvirt-27" + "id": "libvirt-29" } { @@ -2196,7 +2218,7 @@ "type": "uint32" } ], - "id": "libvirt-28" + "id": "libvirt-30" } { @@ -2226,7 +2248,7 @@ "type": "uint32" } ], - "id": "libvirt-29" + "id": "libvirt-31" } { @@ -2296,7 +2318,7 @@ "type": "uint32" } ], - "id": "libvirt-30" + "id": "libvirt-32" } { @@ -2366,11 +2388,11 @@ "type": "uint32" } ], - "id": "libvirt-31" + "id": "libvirt-33" } { - "id": "libvirt-32", + "id": "libvirt-34", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-gpu-pci' not found" @@ -2378,7 +2400,7 @@ } { - "id": "libvirt-33", + "id": "libvirt-35", "error": { "class": "DeviceNotFound", "desc": "Device 'ICH9-LPC' not found" @@ -2432,11 +2454,11 @@ "type": "uint32" } ], - "id": "libvirt-34" + "id": "libvirt-36" } { - "id": "libvirt-35", + "id": "libvirt-37", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-balloon-ccw' not found" @@ -2446,7 +2468,7 @@ { "return": [ ], - "id": "libvirt-36" + "id": "libvirt-38" } { @@ -2559,7 +2581,7 @@ "cpu-max": 255 } ], - "id": "libvirt-37" + "id": "libvirt-39" } { @@ -2640,7 +2662,7 @@ "name": "qemu64" } ], - "id": "libvirt-38" + "id": "libvirt-40" } { @@ -2648,21 +2670,21 @@ "enabled": false, "present": true }, - "id": "libvirt-39" + "id": "libvirt-41" } { "return": [ "tpm-tis" ], - "id": "libvirt-40" + "id": "libvirt-42" } { "return": [ "passthrough" ], - "id": "libvirt-41" + "id": "libvirt-43" } { @@ -3522,7 +3544,7 @@ "option": "drive" } ], - "id": "libvirt-42" + "id": "libvirt-44" } { @@ -3544,5 +3566,5 @@ "capability": "zero-blocks" } ], - "id": "libvirt-43" + "id": "libvirt-45" } diff --git a/tests/qemucapabilitiesdata/caps_2.4.0-1.caps b/tests/qemucapabilitiesdata/caps_2.4.0-1.caps index 2cdf961..4f66048 100644 --- a/tests/qemucapabilitiesdata/caps_2.4.0-1.caps +++ b/tests/qemucapabilitiesdata/caps_2.4.0-1.caps @@ -174,4 +174,5 @@ <flag name='qxl-vga.vram64_size_mb'/> <flag name='debug-threads'/> <flag name='pxb'/> + <flag name='virtio-scsi-pci.iothread'/> </qemuCaps> diff --git a/tests/qemucapabilitiesdata/caps_2.4.0-1.replies b/tests/qemucapabilitiesdata/caps_2.4.0-1.replies index 299fdfc..d186a8a 100644 --- a/tests/qemucapabilitiesdata/caps_2.4.0-1.replies +++ b/tests/qemucapabilitiesdata/caps_2.4.0-1.replies @@ -1800,7 +1800,110 @@ } { - "id": "libvirt-11", + "return": [ + { + "name": "iothread", + "type": "link<iothread>" + }, + { + "name": "any_layout", + "description": "on/off", + "type": "bool" + }, + { + "name": "notify_on_empty", + "description": "on/off", + "type": "bool" + }, + { + "name": "event_idx", + "description": "on/off", + "type": "bool" + }, + { + "name": "indirect_desc", + "description": "on/off", + "type": "bool" + }, + { + "name": "param_change", + "description": "on/off", + "type": "bool" + }, + { + "name": "hotplug", + "description": "on/off", + "type": "bool" + }, + { + "name": "cmd_per_lun", + "type": "uint32" + }, + { + "name": "max_sectors", + "type": "uint32" + }, + { + "name": "num_queues", + "type": "uint32" + }, + { + "name": "virtio-backend", + "type": "child<virtio-scsi-device>" + }, + { + "name": "command_serr_enable", + "description":"on/off", + "type": "bool" + }, + { + "name": "multifunction", + "description": "on/off", + "type": "bool" + }, + { + "name": "rombar", + "type": "uint32" + }, + { + "name": "romfile", + "type": "str" + }, + { + "name": "addr", + "description": "Slot and optional function number, example: 06.0 or 06", + "type": "int32" + }, + { + "name": "disable-modern", + "description": "on/off", + "type": "bool" + }, + { + "name": "disable-legacy", + "description": "on/off", + "type": "bool" + }, + { + "name": "virtio-pci-bus-master-bug-migration", + "description": "on/off", + "type": "bool" + }, + { + "name": "vectors", + "type": "uint32" + }, + { + "name": "ioeventfd", + "description": "on/off", + "type": "bool" + } + ], + "id": "libvirt-11" +} + +{ + "id": "libvirt-12", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-blk-ccw' not found" @@ -1808,7 +1911,7 @@ } { - "id": "libvirt-12", + "id": "libvirt-13", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-net-ccw' not found" @@ -1816,7 +1919,15 @@ } { - "id": "libvirt-13", + "id": "libvirt-14", + "error": { + "class": "DeviceNotFound", + "desc": "Device 'virtio-scsi-ccw' not found" + } +} + +{ + "id": "libvirt-15", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-blk-s390' not found" @@ -1824,7 +1935,7 @@ } { - "id": "libvirt-14", + "id": "libvirt-16", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-net-s390' not found" @@ -1832,7 +1943,7 @@ } { - "id": "libvirt-15", + "id": "libvirt-17", "error": { "class": "DeviceNotFound", "desc": "Device 'pci-assign' not found" @@ -1888,7 +1999,7 @@ "type": "str" } ], - "id": "libvirt-16" + "id": "libvirt-18" } { @@ -1944,7 +2055,7 @@ "type": "str" } ], - "id": "libvirt-17" + "id": "libvirt-19" } { @@ -2039,7 +2150,7 @@ "type": "str" } ], - "id": "libvirt-18" + "id": "libvirt-20" } { @@ -2096,7 +2207,7 @@ "type": "str" } ], - "id": "libvirt-19" + "id": "libvirt-21" } { @@ -2149,7 +2260,7 @@ "type": "uint32" } ], - "id": "libvirt-20" + "id": "libvirt-22" } { @@ -2190,7 +2301,7 @@ "type": "str" } ], - "id": "libvirt-21" + "id": "libvirt-23" } { @@ -2255,7 +2366,7 @@ "type": "uint32" } ], - "id": "libvirt-22" + "id": "libvirt-24" } { @@ -2282,7 +2393,7 @@ "type": "str" } ], - "id": "libvirt-23" + "id": "libvirt-25" } { @@ -2320,7 +2431,7 @@ "type": "size" } ], - "id": "libvirt-24" + "id": "libvirt-26" } { @@ -2374,7 +2485,7 @@ "type": "uint64" } ], - "id": "libvirt-25" + "id": "libvirt-27" } { @@ -2434,7 +2545,7 @@ "type": "str" } ], - "id": "libvirt-26" + "id": "libvirt-28" } { @@ -2448,7 +2559,7 @@ "type": "uint32" } ], - "id": "libvirt-27" + "id": "libvirt-29" } { @@ -2495,7 +2606,7 @@ "type": "uint32" } ], - "id": "libvirt-28" + "id": "libvirt-30" } { @@ -2528,7 +2639,7 @@ "type": "uint32" } ], - "id": "libvirt-29" + "id": "libvirt-31" } { @@ -2601,7 +2712,7 @@ "type": "uint32" } ], - "id": "libvirt-30" + "id": "libvirt-32" } { @@ -2674,7 +2785,7 @@ "type": "uint32" } ], - "id": "libvirt-31" + "id": "libvirt-33" } { @@ -2755,7 +2866,7 @@ "type": "bool" } ], - "id": "libvirt-32" + "id": "libvirt-34" } { @@ -2832,7 +2943,7 @@ "name": "gpe0_blk" } ], - "id": "libvirt-33" + "id": "libvirt-35" } @@ -2918,11 +3029,11 @@ "type": "uint32" } ], - "id": "libvirt-34" + "id": "libvirt-36" } { - "id": "libvirt-35", + "id": "libvirt-37", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-balloon-ccw' not found" @@ -2965,7 +3076,7 @@ "type": "bool" } ], - "id": "libvirt-36" + "id": "libvirt-38" } { @@ -3094,7 +3205,7 @@ "cpu-max": 255 } ], - "id": "libvirt-37" + "id": "libvirt-39" } { @@ -3184,7 +3295,7 @@ "name": "qemu64" } ], - "id": "libvirt-38" + "id": "libvirt-40" } { @@ -3192,21 +3303,21 @@ "enabled": false, "present": true }, - "id": "libvirt-39" + "id": "libvirt-41" } { "return": [ "tpm-tis" ], - "id": "libvirt-40" + "id": "libvirt-42" } { "return": [ "passthrough" ], - "id": "libvirt-41" + "id": "libvirt-43" } { @@ -4210,7 +4321,7 @@ "option": "drive" } ], - "id": "libvirt-42" + "id": "libvirt-44" } { @@ -4240,5 +4351,5 @@ "capability": "events" } ], - "id": "libvirt-43" + "id": "libvirt-44" } diff --git a/tests/qemucapabilitiesdata/caps_2.5.0-1.caps b/tests/qemucapabilitiesdata/caps_2.5.0-1.caps index ecaa165..2bd8573 100644 --- a/tests/qemucapabilitiesdata/caps_2.5.0-1.caps +++ b/tests/qemucapabilitiesdata/caps_2.5.0-1.caps @@ -175,4 +175,5 @@ <flag name='qxl-vga.vram64_size_mb'/> <flag name='debug-threads'/> <flag name='pxb'/> + <flag name='virtio-scsi-pci.iothread'/> </qemuCaps> diff --git a/tests/qemucapabilitiesdata/caps_2.5.0-1.replies b/tests/qemucapabilitiesdata/caps_2.5.0-1.replies index 7b692b5..ca57cd1 100644 --- a/tests/qemucapabilitiesdata/caps_2.5.0-1.replies +++ b/tests/qemucapabilitiesdata/caps_2.5.0-1.replies @@ -1800,7 +1800,130 @@ } { - "id": "libvirt-11", + "return": [ + { + "name": "iothread", + "type": "link<iothread>" + }, + { + "name": "any_layout", + "description": "on/off", + "type": "bool" + }, + { + "name": "notify_on_empty", + "description": "on/off", + "type": "bool" + }, + { + "name": "event_idx", + "description": "on/off", + "type": "bool" + }, + { + "name": "indirect_desc", + "description": "on/off", + "type": "bool" + }, + { + "name": "param_change", + "description": "on/off", + "type": "bool" + }, + { + "name": "hotplug", + "description": "on/off", + "type": "bool" + }, + { + "name": "modern-pio-notify", + "description": "on/off", + "type":"bool" + }, + { + "name": "cmd_per_lun", + "type": "uint32" + }, + { + "name": "max_sectors", + "type": "uint32" + }, + { + "name": "num_queues", + "type": "uint32" + }, + { + "name": "virtio-backend", + "type": "child<virtio-scsi-device>" + }, + { + "name": "command_serr_enable", + "description":"on/off", + "type": "bool" + }, + { + "name": "multifunction", + "description": "on/off", + "type": "bool" + }, + { + "name": "migrate-extra", + "description": "on/off", + "type": "bool" + }, + { + "name": "migrate-extra", + "description": "on/off", + "type": "bool" + }, + { + "name": "rombar", + "type": "uint32" + }, + { + "name": "romfile", + "type": "str" + }, + { + "name": "x-disable-pcie", + "description": "on/off", + "type": "bool" + }, + { + "name": "addr", + "description": "Slot and optional function number, example: 06.0 or 06", + "type": "int32" + }, + { + "name": "disable-modern", + "description": "on/off", + "type": "bool" + }, + { + "name": "disable-legacy", + "description": "on/off", + "type": "bool" + }, + { + "name": "virtio-pci-bus-master-bug-migration", + "description": "on/off", + "type": "bool" + }, + { + "name": "vectors", + "type": "uint32" + }, + { + "name": "ioeventfd", + "description": "on/off", + "type": "bool" + } + ], + "id": "libvirt-11" +} + +{ + "id": "libvirt-12", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-blk-ccw' not found" @@ -1808,7 +1931,7 @@ } { - "id": "libvirt-12", + "id": "libvirt-13", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-net-ccw' not found" @@ -1816,7 +1939,15 @@ } { - "id": "libvirt-13", + "id": "libvirt-14", + "error": { + "class": "DeviceNotFound", + "desc": "Device 'virtio-scsi-ccw' not found" + } +} + +{ + "id": "libvirt-15", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-blk-s390' not found" @@ -1824,7 +1955,7 @@ } { - "id": "libvirt-14", + "id": "libvirt-16", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-net-s390' not found" @@ -1832,7 +1963,7 @@ } { - "id": "libvirt-15", + "id": "libvirt-17", "error": { "class": "DeviceNotFound", "desc": "Device 'pci-assign' not found" @@ -1888,7 +2019,7 @@ "type": "str" } ], - "id": "libvirt-16" + "id": "libvirt-18" } { @@ -1944,7 +2075,7 @@ "type": "str" } ], - "id": "libvirt-17" + "id": "libvirt-19" } { @@ -2039,7 +2170,7 @@ "type": "str" } ], - "id": "libvirt-18" + "id": "libvirt-20" } { @@ -2096,7 +2227,7 @@ "type": "str" } ], - "id": "libvirt-19" + "id": "libvirt-21" } { @@ -2149,7 +2280,7 @@ "type": "uint32" } ], - "id": "libvirt-20" + "id": "libvirt-22" } { @@ -2190,7 +2321,7 @@ "type": "str" } ], - "id": "libvirt-21" + "id": "libvirt-23" } { @@ -2255,7 +2386,7 @@ "type": "uint32" } ], - "id": "libvirt-22" + "id": "libvirt-24" } { @@ -2282,7 +2413,7 @@ "type": "str" } ], - "id": "libvirt-23" + "id": "libvirt-25" } { @@ -2320,7 +2451,7 @@ "type": "size" } ], - "id": "libvirt-24" + "id": "libvirt-26" } { @@ -2374,7 +2505,7 @@ "type": "uint64" } ], - "id": "libvirt-25" + "id": "libvirt-27" } { @@ -2434,7 +2565,7 @@ "type": "str" } ], - "id": "libvirt-26" + "id": "libvirt-28" } { @@ -2448,7 +2579,7 @@ "type": "uint32" } ], - "id": "libvirt-27" + "id": "libvirt-29" } { @@ -2495,7 +2626,7 @@ "type": "uint32" } ], - "id": "libvirt-28" + "id": "libvirt-30" } { @@ -2528,7 +2659,7 @@ "type": "uint32" } ], - "id": "libvirt-29" + "id": "libvirt-31" } { @@ -2601,7 +2732,7 @@ "type": "uint32" } ], - "id": "libvirt-30" + "id": "libvirt-32" } { @@ -2674,7 +2805,7 @@ "type": "uint32" } ], - "id": "libvirt-31" + "id": "libvirt-33" } { @@ -2760,7 +2891,7 @@ "type": "bool" } ], - "id": "libvirt-32" + "id": "libvirt-34" } { @@ -2837,7 +2968,7 @@ "name": "gpe0_blk" } ], - "id": "libvirt-33" + "id": "libvirt-35" } @@ -2938,11 +3069,11 @@ "type": "bool" } ], - "id": "libvirt-34" + "id": "libvirt-36" } { - "id": "libvirt-35", + "id": "libvirt-37", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-balloon-ccw' not found" @@ -2985,7 +3116,7 @@ "type": "bool" } ], - "id": "libvirt-36" + "id": "libvirt-38" } { @@ -3114,7 +3245,7 @@ "cpu-max": 255 } ], - "id": "libvirt-37" + "id": "libvirt-39" } { @@ -3204,7 +3335,7 @@ "name": "qemu64" } ], - "id": "libvirt-38" + "id": "libvirt-40" } { @@ -3212,21 +3343,21 @@ "enabled": false, "present": true }, - "id": "libvirt-39" + "id": "libvirt-41" } { "return": [ "tpm-tis" ], - "id": "libvirt-40" + "id": "libvirt-42" } { "return": [ "passthrough" ], - "id": "libvirt-41" + "id": "libvirt-43" } { @@ -4230,7 +4361,7 @@ "option": "drive" } ], - "id": "libvirt-42" + "id": "libvirt-44" } { @@ -4260,5 +4391,5 @@ "capability": "events" } ], - "id": "libvirt-43" + "id": "libvirt-45" } diff --git a/tests/qemucapabilitiesdata/caps_2.6.0-1.caps b/tests/qemucapabilitiesdata/caps_2.6.0-1.caps index e243f8a..6794d7c 100644 --- a/tests/qemucapabilitiesdata/caps_2.6.0-1.caps +++ b/tests/qemucapabilitiesdata/caps_2.6.0-1.caps @@ -180,4 +180,5 @@ <flag name='secret'/> <flag name='pxb'/> <flag name='pxb-pcie'/> + <flag name='virtio-scsi-pci.iothread'/> </qemuCaps> diff --git a/tests/qemucapabilitiesdata/caps_2.6.0-1.replies b/tests/qemucapabilitiesdata/caps_2.6.0-1.replies index 8a4c3fe..a777c14 100644 --- a/tests/qemucapabilitiesdata/caps_2.6.0-1.replies +++ b/tests/qemucapabilitiesdata/caps_2.6.0-1.replies @@ -1806,7 +1806,125 @@ } { - "id": "libvirt-11", + "return": [ + { + "name": "disable-modern", + "description": "on/off", + "type": "bool" + }, + { + "name": "ioeventfd", + "description": "on/off", + "type": "bool" + }, + { + "name": "virtio-pci-bus-master-bug-migration", + "description": "on/off", + "type": "bool" + }, + { + "name": "event_idx", + "description": "on/off", + "type": "bool" + }, + { + "name": "cmd_per_lun", + "type": "uint32" + }, + { + "name": "indirect_desc", + "description": "on/off", + "type": "bool" + }, + { + "name": "param_change", + "description": "on/off", + "type": "bool" + }, + { + "name": "iothread", + "type": "link<iothread>" + }, + { + "name": "multifunction", + "description": "on/off", + "type": "bool" + }, + { + "name": "migrate-extra", + "description": "on/off", + "type": "bool" + }, + { + "name": "notify_on_empty", + "description": "on/off", + "type": "bool" + }, + { + "name": "hotplug", + "description": "on/off", + "type": "bool" + }, + { + "name": "modern-pio-notify", + "description": "on/off", + "type":"bool" + }, + { + "name": "num_queues", + "type": "uint32" + }, + { + "name": "romfile", + "type": "str" + }, + { + "name": "virtio-backend", + "type": "child<virtio-scsi-device>" + }, + { + "name": "disable-legacy", + "description": "on/off", + "type": "bool" + }, + { + "name": "command_serr_enable", + "description":"on/off", + "type": "bool" + }, + { + "name": "vectors", + "type": "uint32" + }, + { + "name": "x-disable-pcie", + "description": "on/off", + "type": "bool" + }, + { + "name": "addr", + "description": "Slot and optional function number, example: 06.0 or 06", + "type": "int32" + }, + { + "name": "any_layout", + "description": "on/off", + "type": "bool" + }, + { + "name": "max_sectors", + "type": "uint32" + }, + { + "name": "rombar", + "type": "uint32" + } + ], + "id": "libvirt-11" +} + +{ + "id": "libvirt-12", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-blk-ccw' not found" @@ -1814,7 +1932,7 @@ } { - "id": "libvirt-12", + "id": "libvirt-13", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-net-ccw' not found" @@ -1822,7 +1940,15 @@ } { - "id": "libvirt-13", + "id": "libvirt-14", + "error": { + "class": "DeviceNotFound", + "desc": "Device 'virtio-scsi-ccw' not found" + } +} + +{ + "id": "libvirt-15", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-blk-s390' not found" @@ -1830,7 +1956,7 @@ } { - "id": "libvirt-14", + "id": "libvirt-16", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-net-s390' not found" @@ -1838,7 +1964,7 @@ } { - "id": "libvirt-15", + "id": "libvirt-17", "error": { "class": "DeviceNotFound", "desc": "Device 'pci-assign' not found" @@ -1894,7 +2020,7 @@ "type": "str" } ], - "id": "libvirt-16" + "id": "libvirt-18" } { @@ -1950,7 +2076,7 @@ "type": "str" } ], - "id": "libvirt-17" + "id": "libvirt-19" } { @@ -2045,7 +2171,7 @@ "type": "str" } ], - "id": "libvirt-18" + "id": "libvirt-20" } { @@ -2102,7 +2228,7 @@ "type": "str" } ], - "id": "libvirt-19" + "id": "libvirt-21" } { @@ -2155,7 +2281,7 @@ "type": "uint32" } ], - "id": "libvirt-20" + "id": "libvirt-22" } { @@ -2196,7 +2322,7 @@ "type": "str" } ], - "id": "libvirt-21" + "id": "libvirt-23" } { @@ -2261,7 +2387,7 @@ "type": "uint32" } ], - "id": "libvirt-22" + "id": "libvirt-24" } { @@ -2288,7 +2414,7 @@ "type": "str" } ], - "id": "libvirt-23" + "id": "libvirt-25" } { @@ -2326,7 +2452,7 @@ "type": "size" } ], - "id": "libvirt-24" + "id": "libvirt-26" } { @@ -2380,7 +2506,7 @@ "type": "uint64" } ], - "id": "libvirt-25" + "id": "libvirt-27" } { @@ -2440,7 +2566,7 @@ "type": "str" } ], - "id": "libvirt-26" + "id": "libvirt-28" } { @@ -2454,7 +2580,7 @@ "type": "uint32" } ], - "id": "libvirt-27" + "id": "libvirt-29" } { @@ -2501,7 +2627,7 @@ "type": "uint32" } ], - "id": "libvirt-28" + "id": "libvirt-30" } { @@ -2534,7 +2660,7 @@ "type": "uint32" } ], - "id": "libvirt-29" + "id": "libvirt-31" } { @@ -2607,7 +2733,7 @@ "type": "uint32" } ], - "id": "libvirt-30" + "id": "libvirt-32" } { @@ -2680,7 +2806,7 @@ "type": "uint32" } ], - "id": "libvirt-31" + "id": "libvirt-33" } { @@ -2766,7 +2892,7 @@ "type": "bool" } ], - "id": "libvirt-32" + "id": "libvirt-34" } { @@ -2843,7 +2969,7 @@ "name": "gpe0_blk" } ], - "id": "libvirt-33" + "id": "libvirt-35" } @@ -2944,11 +3070,11 @@ "type": "bool" } ], - "id": "libvirt-34" + "id": "libvirt-36" } { - "id": "libvirt-35", + "id": "libvirt-37", "error": { "class": "DeviceNotFound", "desc": "Device 'virtio-balloon-ccw' not found" @@ -2991,7 +3117,7 @@ "type": "bool" } ], - "id": "libvirt-36" + "id": "libvirt-38" } { @@ -3120,7 +3246,7 @@ "cpu-max": 255 } ], - "id": "libvirt-37" + "id": "libvirt-39" } { @@ -3210,7 +3336,7 @@ "name": "qemu64" } ], - "id": "libvirt-38" + "id": "libvirt-40" } { @@ -3218,21 +3344,21 @@ "enabled": false, "present": true }, - "id": "libvirt-39" + "id": "libvirt-41" } { "return": [ "tpm-tis" ], - "id": "libvirt-40" + "id": "libvirt-42" } { "return": [ "passthrough" ], - "id": "libvirt-41" + "id": "libvirt-43" } { @@ -4244,7 +4370,7 @@ "option": "drive" } ], - "id": "libvirt-42" + "id": "libvirt-44" } { @@ -4274,5 +4400,5 @@ "capability": "events" } ], - "id": "libvirt-43" + "id": "libvirt-45" } -- 2.5.5

Signed-off-by: John Ferlan <jferlan@redhat.com> --- docs/formatdomain.html.in | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 895114b..9d7e908 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -2558,8 +2558,9 @@ disk to an IOThread as defined by the range for the domain <a href="#elementsIOThreadsAllocation"><code>iothreads</code></a> value. Multiple devices may be assigned to the same IOThread and - are numbered from 1 to the domain iothreads value. - <span class='since'>Since 1.2.8 (QEMU only)</span> + are numbered from 1 to the domain iothreads value. Available + only for virtio-blk-pci and virtio-blk-ccw disks. + <span class='since'>Since 1.2.8 (QEMU 2.1)</span> </li> </ul> </dd> -- 2.5.5

Reformat to use <dt> elements to make it a bit easier to read. Signed-off-by: John Ferlan <jferlan@redhat.com> --- docs/formatdomain.html.in | 49 ++++++++++++++++++++++++++++------------------- 1 file changed, 29 insertions(+), 20 deletions(-) diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 9d7e908..bcb8159 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -3007,28 +3007,37 @@ <p> Each controller has a mandatory attribute <code>type</code>, - which must be one of "ide", "fdc", "scsi", "sata", "usb", - "ccid", "virtio-serial" or "pci", and a mandatory + which must be one of 'ide', 'fdc', 'scsi', 'sata', 'usb', + 'ccid', 'virtio-serial' or 'pci', and a mandatory attribute <code>index</code> which is the decimal integer describing in which order the bus controller is encountered (for - use in <code>controller</code> attributes - of <code><address></code> elements). The "virtio-serial" - controller has two additional optional - attributes <code>ports</code> and <code>vectors</code>, which - control how many devices can be connected through the - controller. A "scsi" controller has an optional - attribute <code>model</code>, which is one of "auto", "buslogic", - "ibmvscsi", "lsilogic", "lsisas1068", "lsisas1078", "virtio-scsi" or - "vmpvscsi". A "usb" controller has an optional attribute - <code>model</code>, which is one of "piix3-uhci", "piix4-uhci", "ehci", - "ich9-ehci1", "ich9-uhci1", "ich9-uhci2", "ich9-uhci3", "vt82c686b-uhci", - "pci-ohci" or "nec-xhci". Additionally, - <span class="since">since 0.10.0</span>, if the USB bus needs to be - explicitly disabled for the guest, <code>model='none'</code> may be - used. <span class="since">Since 1.0.5</span>, no default USB controller - will be built on s390. The PowerPC64 "spapr-vio" addresses do not have an - associated controller. - </p> + use in <code>controller</code> attributes of + <code><address></code> elements). Some controller types + have additional attributes that control specific features, such as: + </p> + + <dl> + <dt><code>type='virtio-serial'</code></dt> + <dd>The <code>virtio-serial</code> controller has two additional + optional attributes <code>ports</code> and <code>vectors</code>, + which control how many devices can be connected through the + controller.</dd> + <dt><code>type='scsi'</code></dt> + <dd>A <code>scsi</code> controller has an optional attribute + <code>model</code>, which is one of 'auto', 'buslogic', 'ibmvscsi', + 'lsilogic', 'lsisas1068', 'lsisas1078', 'virtio-scsi' or + 'vmpvscsi'.</dd> + <dt><code>type='usb'</code></dt> + <dd>A <code>usb</code> controller has an optional attribute + <code>model</code>, which is one of "piix3-uhci", "piix4-uhci", + "ehci", "ich9-ehci1", "ich9-uhci1", "ich9-uhci2", "ich9-uhci3", + "vt82c686b-uhci", "pci-ohci" or "nec-xhci". Additionally, + <span class="since">since 0.10.0</span>, if the USB bus needs to + be explicitly disabled for the guest, <code>model='none'</code> + may be used. <span class="since">Since 1.0.5</span>, no default + USB controller will be built on s390. The PowerPC64 "spapr-vio" + addresses do not have an associated controller.</dd> + </dl> <p> For controllers that are themselves devices on a PCI or USB bus, -- 2.5.5

Move virDomainControllerModelTypeToString closer to it's counterpart virDomainControllerModelTypeFromString. Signed-off-by: John Ferlan <jferlan@redhat.com> --- src/conf/domain_conf.c | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index db567f5..a3c50f1 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -7798,6 +7798,22 @@ virDomainControllerModelTypeFromString(const virDomainControllerDef *def, return -1; } + +static const char * +virDomainControllerModelTypeToString(virDomainControllerDefPtr def, + int model) +{ + if (def->type == VIR_DOMAIN_CONTROLLER_TYPE_SCSI) + return virDomainControllerModelSCSITypeToString(model); + else if (def->type == VIR_DOMAIN_CONTROLLER_TYPE_USB) + return virDomainControllerModelUSBTypeToString(model); + else if (def->type == VIR_DOMAIN_CONTROLLER_TYPE_PCI) + return virDomainControllerModelPCITypeToString(model); + + return NULL; +} + + /* Parse the XML definition for a controller * @param node XML nodeset to parse for controller definition */ @@ -19378,19 +19394,6 @@ virDomainDiskDefFormat(virBufferPtr buf, return 0; } -static const char * -virDomainControllerModelTypeToString(virDomainControllerDefPtr def, - int model) -{ - if (def->type == VIR_DOMAIN_CONTROLLER_TYPE_SCSI) - return virDomainControllerModelSCSITypeToString(model); - else if (def->type == VIR_DOMAIN_CONTROLLER_TYPE_USB) - return virDomainControllerModelUSBTypeToString(model); - else if (def->type == VIR_DOMAIN_CONTROLLER_TYPE_PCI) - return virDomainControllerModelPCITypeToString(model); - - return NULL; -} static int virDomainControllerDefFormat(virBufferPtr buf, -- 2.5.5

Add a check in the device post processing for any disk using iothread to be using the proper bus (which happens to be only virtio for now). This check could have been added in device parse, except that if a domain was running with such a configuration (albeit doing nothing), then it would disappear. Found while working through code to add iothreads for virtio-scsi-{pci,ccw}. Signed-off-by: John Ferlan <jferlan@redhat.com> --- src/conf/domain_conf.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index a3c50f1..fd7579a 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -4187,6 +4187,13 @@ virDomainDeviceDefPostParseInternal(virDomainDeviceDefPtr dev, return -1; } + if (disk->iothread && disk->bus != VIR_DOMAIN_DISK_BUS_VIRTIO) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("disk '%s' improperly configured, iothread " + "only supported on virtio bus"), disk->dst); + return -1; + } + if (disk->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE && virDomainDiskDefAssignAddress(xmlopt, disk, def) < 0) return -1; -- 2.5.5

On Thu, Apr 21, 2016 at 19:24:13 -0400, John Ferlan wrote:
Add a check in the device post processing for any disk using iothread to be using the proper bus (which happens to be only virtio for now).
This check could have been added in device parse, except that if a domain was running with such a configuration (albeit doing nothing), then it would disappear. Found while working through code to add iothreads for virtio-scsi-{pci,ccw}.
This is still called when parsing and makes the domain disappear.
Signed-off-by: John Ferlan <jferlan@redhat.com> --- src/conf/domain_conf.c | 7 +++++++ 1 file changed, 7 insertions(+)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index a3c50f1..fd7579a 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -4187,6 +4187,13 @@ virDomainDeviceDefPostParseInternal(virDomainDeviceDefPtr dev, return -1; }
+ if (disk->iothread && disk->bus != VIR_DOMAIN_DISK_BUS_VIRTIO) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("disk '%s' improperly configured, iothread " + "only supported on virtio bus"), disk->dst); + return -1; + } + if (disk->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE && virDomainDiskDefAssignAddress(xmlopt, disk, def) < 0) return -1;
NACK to this placement, you need to put it into qemuProcess.. Peter

On 04/22/2016 03:04 AM, Peter Krempa wrote:
On Thu, Apr 21, 2016 at 19:24:13 -0400, John Ferlan wrote:
Add a check in the device post processing for any disk using iothread to be using the proper bus (which happens to be only virtio for now).
This check could have been added in device parse, except that if a domain was running with such a configuration (albeit doing nothing), then it would disappear. Found while working through code to add iothreads for virtio-scsi-{pci,ccw}.
This is still called when parsing and makes the domain disappear.
Signed-off-by: John Ferlan <jferlan@redhat.com> --- src/conf/domain_conf.c | 7 +++++++ 1 file changed, 7 insertions(+)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index a3c50f1..fd7579a 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -4187,6 +4187,13 @@ virDomainDeviceDefPostParseInternal(virDomainDeviceDefPtr dev, return -1; }
+ if (disk->iothread && disk->bus != VIR_DOMAIN_DISK_BUS_VIRTIO) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("disk '%s' improperly configured, iothread " + "only supported on virtio bus"), disk->dst); + return -1; + } + if (disk->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE && virDomainDiskDefAssignAddress(xmlopt, disk, def) < 0) return -1;
NACK to this placement, you need to put it into qemuProcess..
oh right... In the long run this probably doesn't matter if patch7 is accepted. That'll make the check later and only affects "new" starts. Although in thinking about it, I don't believe any domain could be running with iothreads and bus != virtio at this point since the code being replaced in patch7 would inhibit that. I was just thinking, check earlier, but not too early, but I didn't check late enough... parse, postparse, and missed-in-parse-and-postparse (eg. in qemu startup). John

On 04/22/2016 03:04 AM, Peter Krempa wrote:
On Thu, Apr 21, 2016 at 19:24:13 -0400, John Ferlan wrote:
Add a check in the device post processing for any disk using iothread to be using the proper bus (which happens to be only virtio for now).
This check could have been added in device parse, except that if a domain was running with such a configuration (albeit doing nothing), then it would disappear. Found while working through code to add iothreads for virtio-scsi-{pci,ccw}.
This is still called when parsing and makes the domain disappear.
Signed-off-by: John Ferlan <jferlan@redhat.com> --- src/conf/domain_conf.c | 7 +++++++ 1 file changed, 7 insertions(+)
I've dropped this from my local branch John
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index a3c50f1..fd7579a 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -4187,6 +4187,13 @@ virDomainDeviceDefPostParseInternal(virDomainDeviceDefPtr dev, return -1; }
+ if (disk->iothread && disk->bus != VIR_DOMAIN_DISK_BUS_VIRTIO) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("disk '%s' improperly configured, iothread " + "only supported on virtio bus"), disk->dst); + return -1; + } + if (disk->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE && virDomainDiskDefAssignAddress(xmlopt, disk, def) < 0) return -1;
NACK to this placement, you need to put it into qemuProcess..
Peter

Add the ability to add an 'iothread' to the controller which will be how virtio-scsi-pci and virtio-scsi-ccw iothreads have been implemented in qemu. Describe the new functionality and add tests to parse/validate that the new attribute can be added. Signed-off-by: John Ferlan <jferlan@redhat.com> --- docs/formatdomain.html.in | 33 +++++++++++--- docs/schemas/domaincommon.rng | 3 ++ src/conf/domain_conf.c | 25 ++++++++++- src/conf/domain_conf.h | 1 + .../qemuxml2argv-iothreads-virtio-scsi-ccw.xml | 39 +++++++++++++++++ .../qemuxml2argv-iothreads-virtio-scsi-pci.xml | 47 ++++++++++++++++++++ .../qemuxml2xmlout-iothreads-virtio-scsi-ccw.xml | 39 +++++++++++++++++ .../qemuxml2xmlout-iothreads-virtio-scsi-pci.xml | 51 ++++++++++++++++++++++ tests/qemuxml2xmltest.c | 7 +++ 9 files changed, 239 insertions(+), 6 deletions(-) create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-iothreads-virtio-scsi-ccw.xml create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-iothreads-virtio-scsi-pci.xml create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-iothreads-virtio-scsi-ccw.xml create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-iothreads-virtio-scsi-pci.xml diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index bcb8159..e04ee9e 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -565,11 +565,13 @@ <dt><code>iothreads</code></dt> <dd> The content of this optional element defines the number - of IOThreads to be assigned to the domain for use by - virtio-blk-pci and virtio-blk-ccw target storage devices. There - should be only 1 or 2 IOThreads per host CPU. There may be more - than one supported device assigned to each IOThread. - <span class="since">Since 1.2.8</span> + of IOThreads to be assigned to the domain for use by supported + storage disks or controllers. There should be only 1 or 2 IOThreads + per host CPU. There may be more than one supported device assigned + to each IOThread. Supported for virtio-blk-pci and virtio-blk-ccw + disk devices <span class="since">since 1.2.8 (QEMU 2.1)</span>. + Supported for virtio-scsi-pci and virtio-scsi-ccw controller + devices <span class="since">since 1.3.4 (QEMU 2.4)</span>. </dd> <dt><code>iothreadids</code></dt> <dd> @@ -3001,6 +3003,10 @@ <controller type='virtio-serial' index='1'> <address type='pci' domain='0x0000' bus='0x00' slot='0x0a' function='0x0'/> </controller> + <controller type='scsi' index='0' model='virtio-scsi'> + <driver iothread='4'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x0b' function='0x0'/> + </controller> ... </devices> ...</pre> @@ -3081,6 +3087,23 @@ I/O asynchronous handling</a> or not. Accepted values are "on" and "off". <span class="since">Since 1.2.18</span> </dd> + <dt><code>iothread</code></dt> + <dd> + Supported for controller type <code>scsi</code> using model + <code>virtio-scsi</code> for <code>address</code> types + <code>pci</code> and <code>ccw</code> + <span class="since">since 1.3.4 (QEMU 2.4)</span>. + + The optional <code>iothread</code> attribute assigns the controller + to an IOThread as defined by the range for the domain + <a href="#elementsIOThreadsAllocation"><code>iothreads</code></a> + value. Each SCSI <code>disk</code> assigned to use the specified + <code>controller</code> will utilize the same IOThread. If a specific + IOThread is desired for a specific SCSI <code>disk</code>, then + multiple controllers must be defined each having a specific + <code>iothread</code> value. The <code>iothread</code> value + must be within the range 1 to the domain iothreads value. + </dd> </dl> <p> USB companion controllers have an optional diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 3605afe..5196289 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -1891,6 +1891,9 @@ <optional> <ref name="ioeventfd"/> </optional> + <optional> + <ref name="driverIOThread"/> + </optional> </element> </optional> </interleave> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index fd7579a..32e3dcd 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -7847,6 +7847,7 @@ virDomainControllerDefParseXML(xmlNodePtr node, char *busNr = NULL; int numaNode = -1; char *ioeventfd = NULL; + char *iothread = NULL; xmlNodePtr saved = ctxt->node; int rc; @@ -7891,6 +7892,7 @@ virDomainControllerDefParseXML(xmlNodePtr node, cmd_per_lun = virXMLPropString(cur, "cmd_per_lun"); max_sectors = virXMLPropString(cur, "max_sectors"); ioeventfd = virXMLPropString(cur, "ioeventfd"); + iothread = virXMLPropString(cur, "iothread"); } else if (xmlStrEqual(cur->name, BAD_CAST "model")) { if (processedModel) { virReportError(VIR_ERR_XML_ERROR, "%s", @@ -7952,6 +7954,21 @@ virDomainControllerDefParseXML(xmlNodePtr node, goto error; } + if (iothread) { + if (def->model != VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VIRTIO_SCSI) { + virReportError(VIR_ERR_XML_ERROR, + _("'iothread' attribute only supported for " + "controller model '%s'"), + virDomainControllerModelTypeToString(def, VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VIRTIO_SCSI)); + goto error; + } + if (virStrToLong_uip(iothread, NULL, 10, &def->iothread) < 0) { + virReportError(VIR_ERR_XML_ERROR, + _("Invalid 'iothread' value '%s'"), iothread); + goto error; + } + } + if (def->type == VIR_DOMAIN_CONTROLLER_TYPE_USB && def->model == VIR_DOMAIN_CONTROLLER_MODEL_USB_NONE) { VIR_DEBUG("Ignoring device address for none model usb controller"); @@ -8135,6 +8152,7 @@ virDomainControllerDefParseXML(xmlNodePtr node, VIR_FREE(port); VIR_FREE(busNr); VIR_FREE(ioeventfd); + VIR_FREE(iothread); return def; @@ -19466,6 +19484,7 @@ virDomainControllerDefFormat(virBufferPtr buf, if (pciModel || pciTarget || def->queues || def->cmd_per_lun || def->max_sectors || def->ioeventfd || + def->iothread || virDomainDeviceInfoNeedsFormat(&def->info, flags) || pcihole64) { virBufferAddLit(buf, ">\n"); virBufferAdjustIndent(buf, 2); @@ -19508,7 +19527,7 @@ virDomainControllerDefFormat(virBufferPtr buf, } if (def->queues || def->cmd_per_lun || - def->max_sectors || def->ioeventfd) { + def->max_sectors || def->ioeventfd || def->iothread) { virBufferAddLit(buf, "<driver"); if (def->queues) virBufferAsprintf(buf, " queues='%u'", def->queues); @@ -19523,6 +19542,10 @@ virDomainControllerDefFormat(virBufferPtr buf, virBufferAsprintf(buf, " ioeventfd='%s'", virTristateSwitchTypeToString(def->ioeventfd)); } + + if (def->iothread) + virBufferAsprintf(buf, " iothread='%u'", def->iothread); + virBufferAddLit(buf, "/>\n"); } diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index fd540ed..bcc0d91 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -854,6 +854,7 @@ struct _virDomainControllerDef { unsigned int cmd_per_lun; unsigned int max_sectors; int ioeventfd; /* enum virTristateSwitch */ + unsigned int iothread; /* unused = 0, > 0 specific thread # */ union { virDomainVirtioSerialOpts vioserial; virDomainPCIControllerOpts pciopts; diff --git a/tests/qemuxml2argvdata/qemuxml2argv-iothreads-virtio-scsi-ccw.xml b/tests/qemuxml2argvdata/qemuxml2argv-iothreads-virtio-scsi-ccw.xml new file mode 100644 index 0000000..2499782 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-iothreads-virtio-scsi-ccw.xml @@ -0,0 +1,39 @@ +<domain type='qemu'> + <name>QEMUGuest1</name> + <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid> + <memory unit='KiB'>219136</memory> + <currentMemory unit='KiB'>219136</currentMemory> + <vcpu placement='static'>1</vcpu> + <iothreads>2</iothreads> + <os> + <type arch='s390x' machine='s390-ccw'>hvm</type> + <boot dev='hd'/> + </os> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu</emulator> + <disk type='block' device='disk'> + <driver name='qemu' type='raw' iothread='1'/> + <source dev='/dev/HostVG/QEMUGuest1'/> + <target dev='hda' bus='virtio'/> + <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0000'/> + </disk> + <disk type='block' device='disk'> + <driver name='qemu' type='raw'/> + <source dev='/dev/HostVG/QEMUGuest2'/> + <target dev='sdb' bus='scsi'/> + <address type='drive' controller='0' bus='0' target='2' unit='0'/> + </disk> + <controller type='usb' index='0' model='none'/> + <controller type='scsi' index='0' model='virtio-scsi'> + <driver iothread='2'/> + <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0001'/> + </controller> + <memballoon model='virtio'> + <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x000a'/> + </memballoon> + </devices> +</domain> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-iothreads-virtio-scsi-pci.xml b/tests/qemuxml2argvdata/qemuxml2argv-iothreads-virtio-scsi-pci.xml new file mode 100644 index 0000000..b427bcc --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-iothreads-virtio-scsi-pci.xml @@ -0,0 +1,47 @@ +<domain type='qemu'> + <name>QEMUGuest1</name> + <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid> + <memory unit='KiB'>219136</memory> + <currentMemory unit='KiB'>219136</currentMemory> + <vcpu placement='static'>2</vcpu> + <iothreads>2</iothreads> + <os> + <type arch='i686' machine='pc'>hvm</type> + <boot dev='hd'/> + </os> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu</emulator> + <disk type='block' device='disk'> + <driver name='qemu' type='raw'/> + <source dev='/dev/HostVG/QEMUGuest1'/> + <target dev='hda' bus='ide'/> + <address type='drive' controller='0' bus='0' target='0' unit='0'/> + </disk> + <disk type='file' device='disk'> + <driver name='qemu' type='raw' iothread='1'/> + <source file='/var/lib/libvirt/images/iothrtest1.img'/> + <target dev='vdb' bus='virtio'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/> + </disk> + <disk type='file' device='disk'> + <driver name='qemu' type='raw'/> + <source file='/var/lib/libvirt/images/iothrtest2.img'/> + <target dev='sdc' bus='scsi'/> + <address type='drive' controller='0' bus='0' target='0' unit='3'/> + </disk> + <controller type='usb' index='0'/> + <controller type='ide' index='0'/> + <controller type='pci' index='0' model='pci-root'/> + <controller type='scsi' index='0' model='virtio-scsi'> + <driver iothread='2'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x0b' function='0x0'/> + </controller> + <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> + <memballoon model='none'/> + </devices> +</domain> diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-iothreads-virtio-scsi-ccw.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-iothreads-virtio-scsi-ccw.xml new file mode 100644 index 0000000..2499782 --- /dev/null +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-iothreads-virtio-scsi-ccw.xml @@ -0,0 +1,39 @@ +<domain type='qemu'> + <name>QEMUGuest1</name> + <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid> + <memory unit='KiB'>219136</memory> + <currentMemory unit='KiB'>219136</currentMemory> + <vcpu placement='static'>1</vcpu> + <iothreads>2</iothreads> + <os> + <type arch='s390x' machine='s390-ccw'>hvm</type> + <boot dev='hd'/> + </os> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu</emulator> + <disk type='block' device='disk'> + <driver name='qemu' type='raw' iothread='1'/> + <source dev='/dev/HostVG/QEMUGuest1'/> + <target dev='hda' bus='virtio'/> + <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0000'/> + </disk> + <disk type='block' device='disk'> + <driver name='qemu' type='raw'/> + <source dev='/dev/HostVG/QEMUGuest2'/> + <target dev='sdb' bus='scsi'/> + <address type='drive' controller='0' bus='0' target='2' unit='0'/> + </disk> + <controller type='usb' index='0' model='none'/> + <controller type='scsi' index='0' model='virtio-scsi'> + <driver iothread='2'/> + <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0001'/> + </controller> + <memballoon model='virtio'> + <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x000a'/> + </memballoon> + </devices> +</domain> diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-iothreads-virtio-scsi-pci.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-iothreads-virtio-scsi-pci.xml new file mode 100644 index 0000000..d8306d4 --- /dev/null +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-iothreads-virtio-scsi-pci.xml @@ -0,0 +1,51 @@ +<domain type='qemu'> + <name>QEMUGuest1</name> + <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid> + <memory unit='KiB'>219136</memory> + <currentMemory unit='KiB'>219136</currentMemory> + <vcpu placement='static'>2</vcpu> + <iothreads>2</iothreads> + <os> + <type arch='i686' machine='pc'>hvm</type> + <boot dev='hd'/> + </os> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu</emulator> + <disk type='block' device='disk'> + <driver name='qemu' type='raw'/> + <source dev='/dev/HostVG/QEMUGuest1'/> + <target dev='hda' bus='ide'/> + <address type='drive' controller='0' bus='0' target='0' unit='0'/> + </disk> + <disk type='file' device='disk'> + <driver name='qemu' type='raw' iothread='1'/> + <source file='/var/lib/libvirt/images/iothrtest1.img'/> + <target dev='vdb' bus='virtio'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/> + </disk> + <disk type='file' device='disk'> + <driver name='qemu' type='raw'/> + <source file='/var/lib/libvirt/images/iothrtest2.img'/> + <target dev='sdc' bus='scsi'/> + <address type='drive' controller='0' bus='0' target='0' unit='3'/> + </disk> + <controller type='usb' index='0'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/> + </controller> + <controller type='ide' index='0'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/> + </controller> + <controller type='pci' index='0' model='pci-root'/> + <controller type='scsi' index='0' model='virtio-scsi'> + <driver iothread='2'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x0b' function='0x0'/> + </controller> + <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> + <memballoon model='none'/> + </devices> +</domain> diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index f766f4d..ad8143f 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -511,6 +511,13 @@ mymain(void) DO_TEST("iothreads-disk"); DO_TEST_FULL("iothreads-disk-virtio-ccw", WHEN_ACTIVE, QEMU_CAPS_VIRTIO_CCW, QEMU_CAPS_VIRTIO_S390); + DO_TEST_FULL("iothreads-virtio-scsi-pci", WHEN_ACTIVE, + QEMU_CAPS_NODEFCONFIG, + QEMU_CAPS_VIRTIO_SCSI); + DO_TEST_FULL("iothreads-virtio-scsi-ccw", WHEN_ACTIVE, + QEMU_CAPS_VIRTIO_SCSI, + QEMU_CAPS_VIRTIO_CCW, + QEMU_CAPS_VIRTIO_S390); DO_TEST("lease"); DO_TEST("event_idx"); DO_TEST("vhost_queues"); -- 2.5.5

On 04/22/2016 01:24 AM, John Ferlan wrote:
Add the ability to add an 'iothread' to the controller which will be how virtio-scsi-pci and virtio-scsi-ccw iothreads have been implemented in qemu.
Describe the new functionality and add tests to parse/validate that the new attribute can be added.
Signed-off-by: John Ferlan <jferlan@redhat.com> --- docs/formatdomain.html.in | 33 +++++++++++--- docs/schemas/domaincommon.rng | 3 ++ src/conf/domain_conf.c | 25 ++++++++++- src/conf/domain_conf.h | 1 + .../qemuxml2argv-iothreads-virtio-scsi-ccw.xml | 39 +++++++++++++++++ .../qemuxml2argv-iothreads-virtio-scsi-pci.xml | 47 ++++++++++++++++++++ .../qemuxml2xmlout-iothreads-virtio-scsi-ccw.xml | 39 +++++++++++++++++ .../qemuxml2xmlout-iothreads-virtio-scsi-pci.xml | 51 ++++++++++++++++++++++ tests/qemuxml2xmltest.c | 7 +++ 9 files changed, 239 insertions(+), 6 deletions(-) create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-iothreads-virtio-scsi-ccw.xml create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-iothreads-virtio-scsi-pci.xml create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-iothreads-virtio-scsi-ccw.xml create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-iothreads-virtio-scsi-pci.xml
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index bcb8159..e04ee9e 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -565,11 +565,13 @@ <dt><code>iothreads</code></dt> <dd> The content of this optional element defines the number - of IOThreads to be assigned to the domain for use by - virtio-blk-pci and virtio-blk-ccw target storage devices. There - should be only 1 or 2 IOThreads per host CPU. There may be more - than one supported device assigned to each IOThread. - <span class="since">Since 1.2.8</span> + of IOThreads to be assigned to the domain for use by supported + storage disks or controllers. There should be only 1 or 2 IOThreads + per host CPU. There may be more than one supported device assigned + to each IOThread. Supported for virtio-blk-pci and virtio-blk-ccw + disk devices <span class="since">since 1.2.8 (QEMU 2.1)</span>. + Supported for virtio-scsi-pci and virtio-scsi-ccw controller + devices <span class="since">since 1.3.4 (QEMU 2.4)</span>. </dd> <dt><code>iothreadids</code></dt> <dd> @@ -3001,6 +3003,10 @@ <controller type='virtio-serial' index='1'> <address type='pci' domain='0x0000' bus='0x00' slot='0x0a' function='0x0'/> </controller> + <controller type='scsi' index='0' model='virtio-scsi'> + <driver iothread='4'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x0b' function='0x0'/> + </controller> ... </devices> ...</pre> @@ -3081,6 +3087,23 @@ I/O asynchronous handling</a> or not. Accepted values are "on" and "off". <span class="since">Since 1.2.18</span> </dd> + <dt><code>iothread</code></dt> + <dd> + Supported for controller type <code>scsi</code> using model + <code>virtio-scsi</code> for <code>address</code> types + <code>pci</code> and <code>ccw</code> + <span class="since">since 1.3.4 (QEMU 2.4)</span>. + + The optional <code>iothread</code> attribute assigns the controller + to an IOThread as defined by the range for the domain + <a href="#elementsIOThreadsAllocation"><code>iothreads</code></a> + value. Each SCSI <code>disk</code> assigned to use the specified + <code>controller</code> will utilize the same IOThread. If a specific + IOThread is desired for a specific SCSI <code>disk</code>, then + multiple controllers must be defined each having a specific + <code>iothread</code> value. The <code>iothread</code> value + must be within the range 1 to the domain iothreads value. + </dd> </dl> <p> USB companion controllers have an optional diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 3605afe..5196289 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -1891,6 +1891,9 @@ <optional> <ref name="ioeventfd"/> </optional> + <optional> + <ref name="driverIOThread"/> + </optional> </element> </optional> </interleave> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index fd7579a..32e3dcd 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -7847,6 +7847,7 @@ virDomainControllerDefParseXML(xmlNodePtr node, char *busNr = NULL; int numaNode = -1; char *ioeventfd = NULL; + char *iothread = NULL; xmlNodePtr saved = ctxt->node; int rc;
@@ -7891,6 +7892,7 @@ virDomainControllerDefParseXML(xmlNodePtr node, cmd_per_lun = virXMLPropString(cur, "cmd_per_lun"); max_sectors = virXMLPropString(cur, "max_sectors"); ioeventfd = virXMLPropString(cur, "ioeventfd"); + iothread = virXMLPropString(cur, "iothread"); } else if (xmlStrEqual(cur->name, BAD_CAST "model")) { if (processedModel) { virReportError(VIR_ERR_XML_ERROR, "%s", @@ -7952,6 +7954,21 @@ virDomainControllerDefParseXML(xmlNodePtr node, goto error; }
+ if (iothread) { + if (def->model != VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VIRTIO_SCSI) { + virReportError(VIR_ERR_XML_ERROR, + _("'iothread' attribute only supported for " + "controller model '%s'"), + virDomainControllerModelTypeToString(def, VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VIRTIO_SCSI)); virDomainControllerModelSCSITypeToString(VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VIRTIO_SCSI)
Otherwise you can end up with a rather useless error messages that looks like this: error: XML error: 'iothread' attribute only supported for controller model '(null)' e.g. if the controller is of type 'virtio-serial'.
+ goto error; + } + if (virStrToLong_uip(iothread, NULL, 10, &def->iothread) < 0) { + virReportError(VIR_ERR_XML_ERROR, + _("Invalid 'iothread' value '%s'"), iothread); + goto error; + } + } + if (def->type == VIR_DOMAIN_CONTROLLER_TYPE_USB && def->model == VIR_DOMAIN_CONTROLLER_MODEL_USB_NONE) { VIR_DEBUG("Ignoring device address for none model usb controller"); @@ -8135,6 +8152,7 @@ virDomainControllerDefParseXML(xmlNodePtr node, VIR_FREE(port); VIR_FREE(busNr); VIR_FREE(ioeventfd); + VIR_FREE(iothread);
return def;
@@ -19466,6 +19484,7 @@ virDomainControllerDefFormat(virBufferPtr buf,
if (pciModel || pciTarget || def->queues || def->cmd_per_lun || def->max_sectors || def->ioeventfd || + def->iothread || virDomainDeviceInfoNeedsFormat(&def->info, flags) || pcihole64) { virBufferAddLit(buf, ">\n"); virBufferAdjustIndent(buf, 2); @@ -19508,7 +19527,7 @@ virDomainControllerDefFormat(virBufferPtr buf, }
if (def->queues || def->cmd_per_lun || - def->max_sectors || def->ioeventfd) { + def->max_sectors || def->ioeventfd || def->iothread) { virBufferAddLit(buf, "<driver"); if (def->queues) virBufferAsprintf(buf, " queues='%u'", def->queues); @@ -19523,6 +19542,10 @@ virDomainControllerDefFormat(virBufferPtr buf, virBufferAsprintf(buf, " ioeventfd='%s'", virTristateSwitchTypeToString(def->ioeventfd)); } + + if (def->iothread) + virBufferAsprintf(buf, " iothread='%u'", def->iothread); + virBufferAddLit(buf, "/>\n"); }
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index fd540ed..bcc0d91 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -854,6 +854,7 @@ struct _virDomainControllerDef { unsigned int cmd_per_lun; unsigned int max_sectors; int ioeventfd; /* enum virTristateSwitch */ + unsigned int iothread; /* unused = 0, > 0 specific thread # */ union { virDomainVirtioSerialOpts vioserial; virDomainPCIControllerOpts pciopts; diff --git a/tests/qemuxml2argvdata/qemuxml2argv-iothreads-virtio-scsi-ccw.xml b/tests/qemuxml2argvdata/qemuxml2argv-iothreads-virtio-scsi-ccw.xml new file mode 100644 index 0000000..2499782 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-iothreads-virtio-scsi-ccw.xml @@ -0,0 +1,39 @@ +<domain type='qemu'> + <name>QEMUGuest1</name> + <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid> + <memory unit='KiB'>219136</memory> + <currentMemory unit='KiB'>219136</currentMemory> + <vcpu placement='static'>1</vcpu> + <iothreads>2</iothreads> + <os> + <type arch='s390x' machine='s390-ccw'>hvm</type> + <boot dev='hd'/> + </os> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu</emulator> + <disk type='block' device='disk'> + <driver name='qemu' type='raw' iothread='1'/> + <source dev='/dev/HostVG/QEMUGuest1'/> + <target dev='hda' bus='virtio'/> + <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0000'/> + </disk> + <disk type='block' device='disk'> + <driver name='qemu' type='raw'/> + <source dev='/dev/HostVG/QEMUGuest2'/> + <target dev='sdb' bus='scsi'/> + <address type='drive' controller='0' bus='0' target='2' unit='0'/> + </disk> + <controller type='usb' index='0' model='none'/> + <controller type='scsi' index='0' model='virtio-scsi'> + <driver iothread='2'/> + <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0001'/> + </controller> + <memballoon model='virtio'> + <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x000a'/> + </memballoon> + </devices> +</domain> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-iothreads-virtio-scsi-pci.xml b/tests/qemuxml2argvdata/qemuxml2argv-iothreads-virtio-scsi-pci.xml new file mode 100644 index 0000000..b427bcc --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-iothreads-virtio-scsi-pci.xml @@ -0,0 +1,47 @@ +<domain type='qemu'> + <name>QEMUGuest1</name> + <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid> + <memory unit='KiB'>219136</memory> + <currentMemory unit='KiB'>219136</currentMemory> + <vcpu placement='static'>2</vcpu> + <iothreads>2</iothreads> + <os> + <type arch='i686' machine='pc'>hvm</type> + <boot dev='hd'/> + </os> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu</emulator> + <disk type='block' device='disk'> + <driver name='qemu' type='raw'/> + <source dev='/dev/HostVG/QEMUGuest1'/> + <target dev='hda' bus='ide'/> + <address type='drive' controller='0' bus='0' target='0' unit='0'/> + </disk> + <disk type='file' device='disk'> + <driver name='qemu' type='raw' iothread='1'/> + <source file='/var/lib/libvirt/images/iothrtest1.img'/> + <target dev='vdb' bus='virtio'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/> + </disk> + <disk type='file' device='disk'> + <driver name='qemu' type='raw'/> + <source file='/var/lib/libvirt/images/iothrtest2.img'/> + <target dev='sdc' bus='scsi'/> + <address type='drive' controller='0' bus='0' target='0' unit='3'/> + </disk> + <controller type='usb' index='0'/> + <controller type='ide' index='0'/> + <controller type='pci' index='0' model='pci-root'/> + <controller type='scsi' index='0' model='virtio-scsi'> + <driver iothread='2'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x0b' function='0x0'/> + </controller> + <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> + <memballoon model='none'/> + </devices> +</domain> diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-iothreads-virtio-scsi-ccw.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-iothreads-virtio-scsi-ccw.xml new file mode 100644 index 0000000..2499782 --- /dev/null +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-iothreads-virtio-scsi-ccw.xml @@ -0,0 +1,39 @@ +<domain type='qemu'> + <name>QEMUGuest1</name> + <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid> + <memory unit='KiB'>219136</memory> + <currentMemory unit='KiB'>219136</currentMemory> + <vcpu placement='static'>1</vcpu> + <iothreads>2</iothreads> + <os> + <type arch='s390x' machine='s390-ccw'>hvm</type> + <boot dev='hd'/> + </os> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu</emulator> + <disk type='block' device='disk'> + <driver name='qemu' type='raw' iothread='1'/> + <source dev='/dev/HostVG/QEMUGuest1'/> + <target dev='hda' bus='virtio'/> + <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0000'/> + </disk> + <disk type='block' device='disk'> + <driver name='qemu' type='raw'/> + <source dev='/dev/HostVG/QEMUGuest2'/> + <target dev='sdb' bus='scsi'/> + <address type='drive' controller='0' bus='0' target='2' unit='0'/> + </disk> + <controller type='usb' index='0' model='none'/> + <controller type='scsi' index='0' model='virtio-scsi'> + <driver iothread='2'/> + <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0001'/> + </controller> + <memballoon model='virtio'> + <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x000a'/> + </memballoon> + </devices> +</domain> diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-iothreads-virtio-scsi-pci.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-iothreads-virtio-scsi-pci.xml new file mode 100644 index 0000000..d8306d4 --- /dev/null +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-iothreads-virtio-scsi-pci.xml @@ -0,0 +1,51 @@ +<domain type='qemu'> + <name>QEMUGuest1</name> + <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid> + <memory unit='KiB'>219136</memory> + <currentMemory unit='KiB'>219136</currentMemory> + <vcpu placement='static'>2</vcpu> + <iothreads>2</iothreads> + <os> + <type arch='i686' machine='pc'>hvm</type> + <boot dev='hd'/> + </os> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu</emulator> + <disk type='block' device='disk'> + <driver name='qemu' type='raw'/> + <source dev='/dev/HostVG/QEMUGuest1'/> + <target dev='hda' bus='ide'/> + <address type='drive' controller='0' bus='0' target='0' unit='0'/> + </disk> + <disk type='file' device='disk'> + <driver name='qemu' type='raw' iothread='1'/> + <source file='/var/lib/libvirt/images/iothrtest1.img'/> + <target dev='vdb' bus='virtio'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/> + </disk> + <disk type='file' device='disk'> + <driver name='qemu' type='raw'/> + <source file='/var/lib/libvirt/images/iothrtest2.img'/> + <target dev='sdc' bus='scsi'/> + <address type='drive' controller='0' bus='0' target='0' unit='3'/> + </disk> + <controller type='usb' index='0'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/> + </controller> + <controller type='ide' index='0'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/> + </controller> + <controller type='pci' index='0' model='pci-root'/> + <controller type='scsi' index='0' model='virtio-scsi'> + <driver iothread='2'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x0b' function='0x0'/> + </controller> + <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> + <memballoon model='none'/> + </devices> +</domain> diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index f766f4d..ad8143f 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -511,6 +511,13 @@ mymain(void) DO_TEST("iothreads-disk"); DO_TEST_FULL("iothreads-disk-virtio-ccw", WHEN_ACTIVE, QEMU_CAPS_VIRTIO_CCW, QEMU_CAPS_VIRTIO_S390); + DO_TEST_FULL("iothreads-virtio-scsi-pci", WHEN_ACTIVE, + QEMU_CAPS_NODEFCONFIG, + QEMU_CAPS_VIRTIO_SCSI); + DO_TEST_FULL("iothreads-virtio-scsi-ccw", WHEN_ACTIVE, + QEMU_CAPS_VIRTIO_SCSI, + QEMU_CAPS_VIRTIO_CCW, + QEMU_CAPS_VIRTIO_S390); DO_TEST("lease"); DO_TEST("event_idx"); DO_TEST("vhost_queues");
-- Mit freundlichen Grüßen/Kind regards Boris Fiuczynski IBM Deutschland Research & Development GmbH Vorsitzender des Aufsichtsrats: Martina Köderitz Geschäftsführung: Dirk Wittkopp Sitz der Gesellschaft: Böblingen Registergericht: Amtsgericht Stuttgart, HRB 243294

[...]
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index fd7579a..32e3dcd 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -7847,6 +7847,7 @@ virDomainControllerDefParseXML(xmlNodePtr node, char *busNr = NULL; int numaNode = -1; char *ioeventfd = NULL; + char *iothread = NULL; xmlNodePtr saved = ctxt->node; int rc;
@@ -7891,6 +7892,7 @@ virDomainControllerDefParseXML(xmlNodePtr node, cmd_per_lun = virXMLPropString(cur, "cmd_per_lun"); max_sectors = virXMLPropString(cur, "max_sectors"); ioeventfd = virXMLPropString(cur, "ioeventfd"); + iothread = virXMLPropString(cur, "iothread"); } else if (xmlStrEqual(cur->name, BAD_CAST "model")) { if (processedModel) { virReportError(VIR_ERR_XML_ERROR, "%s", @@ -7952,6 +7954,21 @@ virDomainControllerDefParseXML(xmlNodePtr node, goto error; }
+ if (iothread) { + if (def->model != VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VIRTIO_SCSI) { + virReportError(VIR_ERR_XML_ERROR, + _("'iothread' attribute only supported for " + "controller model '%s'"), + virDomainControllerModelTypeToString(def, VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VIRTIO_SCSI)); virDomainControllerModelSCSITypeToString(VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VIRTIO_SCSI)
Otherwise you can end up with a rather useless error messages that looks like this: error: XML error: 'iothread' attribute only supported for controller model '(null)' e.g. if the controller is of type 'virtio-serial'.
Oh right - yeah, good catch... I've fixed it in my branch. I guess I was trying to utilize the common ModelTypeToString which vectors off if type is right... Thanks for looking at it from a ccw/s390 perspective - I was mostly flying blind with those. I can "see" the proper syntax, but didn't have something to test with. Tks - John [...]

Rather than an if statement, use a switch (we're about to add more support) Signed-off-by: John Ferlan <jferlan@redhat.com> --- src/qemu/qemu_command.c | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 2fb967a..b7388ef 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -1495,12 +1495,29 @@ qemuCheckIOThreads(const virDomainDef *def, virDomainDiskDefPtr disk) { /* Right "type" of disk" */ - if (disk->bus != VIR_DOMAIN_DISK_BUS_VIRTIO || - (disk->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI && - disk->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW)) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("IOThreads only available for virtio pci and " - "virtio ccw disk")); + switch ((virDomainDiskBus)disk->bus) { + case VIR_DOMAIN_DISK_BUS_VIRTIO: + if (disk->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI && + disk->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("IOThreads only available for virtio pci and " + "virtio ccw disk")); + return false; + } + break; + + case VIR_DOMAIN_DISK_BUS_IDE: + case VIR_DOMAIN_DISK_BUS_FDC: + case VIR_DOMAIN_DISK_BUS_SCSI: + case VIR_DOMAIN_DISK_BUS_XEN: + case VIR_DOMAIN_DISK_BUS_USB: + case VIR_DOMAIN_DISK_BUS_UML: + case VIR_DOMAIN_DISK_BUS_SATA: + case VIR_DOMAIN_DISK_BUS_SD: + case VIR_DOMAIN_DISK_BUS_LAST: + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + ("IOThreads not available for bus %s dst %s"), + virDomainDiskBusTypeToString(disk->bus), disk->dst); return false; } -- 2.5.5

https://bugzilla.redhat.com/show_bug.cgi?id=1286709 Now that we have all the pieces in place, we can add the 'iothread=#' to the command line for the (two) controllers that support it (virtio-scsi-pci and virtio-scsi-ccw). Add the tests as well... Signed-off-by: John Ferlan <jferlan@redhat.com> --- src/qemu/qemu_command.c | 86 ++++++++++++++++++++-- .../qemuxml2argv-iothreads-virtio-scsi-ccw.args | 28 +++++++ .../qemuxml2argv-iothreads-virtio-scsi-pci.args | 32 ++++++++ tests/qemuxml2argvtest.c | 6 ++ 4 files changed, 146 insertions(+), 6 deletions(-) create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-iothreads-virtio-scsi-ccw.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-iothreads-virtio-scsi-pci.args diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index b7388ef..115d115 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -2206,6 +2206,65 @@ qemuBuildUSBControllerDevStr(const virDomainDef *domainDef, return 0; } + +/* qemuCheckSCSIControllerIOThreads: + * @domainDef: Pointer to domain def + * @def: Pointer to controller def + * @qemuCaps: Capabilities + * + * If this controller definition has iothreads set, let's make sure the + * configuration is right before adding to the command line + * + * Returns true if either supported or there are no iothreads for controller; + * otherwise, returns false if configuration is not quite right. + */ +static bool +qemuCheckSCSIControllerIOThreads(const virDomainDef *domainDef, + virDomainControllerDefPtr def, + virQEMUCapsPtr qemuCaps) +{ + if (!def->iothread) + return true; + + /* By this time QEMU_CAPS_OBJECT_IOTHREAD was already checked. + * We just need to check if the QEMU_CAPS_VIRTIO_SCSI_IOTHREAD + * capability is set. + */ + if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_SCSI_IOTHREAD)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("IOThreads for virtio-scsi not supported for " + "this QEMU")); + return false; + } + + if (def->model != VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VIRTIO_SCSI) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("IOThreads only supported for virtio-scsi " + "controllers model is '%s'"), + virDomainControllerModelSCSITypeToString(def->model)); + return false; + } + + if (def->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI && + def->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("IOThreads only available for virtio pci and " + "virtio ccw controllers")); + return false; + } + + /* Can we find the controller iothread in the iothreadid list? */ + if (!virDomainIOThreadIDFind(domainDef, def->iothread)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("controller iothread '%u' not defined in iothreadid"), + def->iothread); + return false; + } + + return true; +} + + char * qemuBuildControllerDevStr(const virDomainDef *domainDef, virDomainControllerDefPtr def, @@ -2253,16 +2312,31 @@ qemuBuildControllerDevStr(const virDomainDef *domainDef, case VIR_DOMAIN_CONTROLLER_TYPE_SCSI: switch (model) { case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VIRTIO_SCSI: - if (def->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW) + if (def->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW) { virBufferAddLit(&buf, "virtio-scsi-ccw"); - else if (def->info.type == - VIR_DOMAIN_DEVICE_ADDRESS_TYPE_VIRTIO_S390) + if (def->iothread) { + if (!qemuCheckSCSIControllerIOThreads(domainDef, + def, qemuCaps)) + goto error; + virBufferAsprintf(&buf, ",iothread=iothread%u", + def->iothread); + } + } else if (def->info.type == + VIR_DOMAIN_DEVICE_ADDRESS_TYPE_VIRTIO_S390) { virBufferAddLit(&buf, "virtio-scsi-s390"); - else if (def->info.type == - VIR_DOMAIN_DEVICE_ADDRESS_TYPE_VIRTIO_MMIO) + } else if (def->info.type == + VIR_DOMAIN_DEVICE_ADDRESS_TYPE_VIRTIO_MMIO) { virBufferAddLit(&buf, "virtio-scsi-device"); - else + } else { virBufferAddLit(&buf, "virtio-scsi-pci"); + if (def->iothread) { + if (!qemuCheckSCSIControllerIOThreads(domainDef, + def, qemuCaps)) + goto error; + virBufferAsprintf(&buf, ",iothread=iothread%u", + def->iothread); + } + } break; case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_LSILOGIC: virBufferAddLit(&buf, "lsi"); diff --git a/tests/qemuxml2argvdata/qemuxml2argv-iothreads-virtio-scsi-ccw.args b/tests/qemuxml2argvdata/qemuxml2argv-iothreads-virtio-scsi-ccw.args new file mode 100644 index 0000000..edf49bf --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-iothreads-virtio-scsi-ccw.args @@ -0,0 +1,28 @@ +LC_ALL=C \ +PATH=/bin \ +HOME=/home/test \ +USER=test \ +LOGNAME=test \ +QEMU_AUDIO_DRV=none \ +/usr/bin/qemu \ +-name QEMUGuest1 \ +-S \ +-M s390-ccw \ +-m 214 \ +-smp 1 \ +-object iothread,id=iothread1 \ +-object iothread,id=iothread2 \ +-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ +-nographic \ +-nodefaults \ +-monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ +-no-acpi \ +-boot c \ +-device virtio-scsi-ccw,iothread=iothread2,id=scsi0,devno=fe.0.0001 \ +-drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-virtio-disk0 \ +-device virtio-blk-ccw,iothread=iothread1,devno=fe.0.0000,\ +drive=drive-virtio-disk0,id=virtio-disk0 \ +-drive file=/dev/HostVG/QEMUGuest2,format=raw,if=none,id=drive-scsi0-0-2-0 \ +-device scsi-disk,bus=scsi0.0,channel=0,scsi-id=2,lun=0,drive=drive-scsi0-0-2-0,\ +id=scsi0-0-2-0 \ +-device virtio-balloon-ccw,id=balloon0,devno=fe.0.000a diff --git a/tests/qemuxml2argvdata/qemuxml2argv-iothreads-virtio-scsi-pci.args b/tests/qemuxml2argvdata/qemuxml2argv-iothreads-virtio-scsi-pci.args new file mode 100644 index 0000000..bd83b27 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-iothreads-virtio-scsi-pci.args @@ -0,0 +1,32 @@ +LC_ALL=C \ +PATH=/bin \ +HOME=/home/test \ +USER=test \ +LOGNAME=test \ +QEMU_AUDIO_DRV=none \ +/usr/bin/qemu \ +-name QEMUGuest1 \ +-S \ +-M pc \ +-m 214 \ +-smp 2 \ +-object iothread,id=iothread1 \ +-object iothread,id=iothread2 \ +-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ +-nographic \ +-nodefaults \ +-monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ +-no-acpi \ +-boot c \ +-device virtio-scsi-pci,iothread=iothread2,id=scsi0,bus=pci.0,addr=0xb \ +-usb \ +-drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ +-device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 \ +-drive file=/var/lib/libvirt/images/iothrtest1.img,format=raw,if=none,\ +id=drive-virtio-disk1 \ +-device virtio-blk-pci,iothread=iothread1,bus=pci.0,addr=0x4,\ +drive=drive-virtio-disk1,id=virtio-disk1 \ +-drive file=/var/lib/libvirt/images/iothrtest2.img,format=raw,if=none,\ +id=drive-scsi0-0-0-3 \ +-device scsi-disk,bus=scsi0.0,channel=0,scsi-id=0,lun=3,drive=drive-scsi0-0-0-3,\ +id=scsi0-0-0-3 diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 8842b2f..328a931 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -1254,6 +1254,12 @@ mymain(void) DO_TEST("iothreads-disk", QEMU_CAPS_OBJECT_IOTHREAD); DO_TEST("iothreads-disk-virtio-ccw", QEMU_CAPS_OBJECT_IOTHREAD, QEMU_CAPS_VIRTIO_CCW, QEMU_CAPS_VIRTIO_S390); + DO_TEST("iothreads-virtio-scsi-pci", QEMU_CAPS_VIRTIO_SCSI, + QEMU_CAPS_OBJECT_IOTHREAD, + QEMU_CAPS_VIRTIO_SCSI_IOTHREAD); + DO_TEST("iothreads-virtio-scsi-ccw", QEMU_CAPS_OBJECT_IOTHREAD, + QEMU_CAPS_VIRTIO_SCSI, QEMU_CAPS_VIRTIO_SCSI_IOTHREAD, + QEMU_CAPS_VIRTIO_CCW, QEMU_CAPS_VIRTIO_S390); DO_TEST("cpu-topology1", QEMU_CAPS_SMP_TOPOLOGY); DO_TEST("cpu-topology2", QEMU_CAPS_SMP_TOPOLOGY); -- 2.5.5

On 04/22/2016 01:24 AM, John Ferlan wrote:
Add support for virtio-scsi-{pci,ccw} iothreads.
Besides my comment about the error message on patch 6 it looks good for ccw on S390. Thanks John -- Mit freundlichen Grüßen/Kind regards Boris Fiuczynski IBM Deutschland Research & Development GmbH Vorsitzender des Aufsichtsrats: Martina Köderitz Geschäftsführung: Dirk Wittkopp Sitz der Gesellschaft: Böblingen Registergericht: Amtsgericht Stuttgart, HRB 243294
participants (3)
-
Boris Fiuczynski
-
John Ferlan
-
Peter Krempa