]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: capabilities: Retire QEMU_CAPS_MACHINE_IOMMU
authorPeter Krempa <pkrempa@redhat.com>
Mon, 19 Apr 2021 10:12:43 +0000 (12:12 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 3 May 2021 10:14:44 +0000 (12:14 +0200)
The feature is no longer asserted. Remove the checks related to it and
make the code work properly with QEMU_CAPS_DEVICE_INTEL_IOMMU.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
src/qemu/qemu_capabilities.h
src/qemu/qemu_command.c
src/qemu/qemu_validate.c

index b47fbbaf5478c7f83a773c5dd01fb1f1135b5f8c..4e9c3c55f336ca3bbc80c14034798010c46d829e 100644 (file)
@@ -373,7 +373,7 @@ typedef enum { /* virQEMUCapsFlags grouping marker for syntax-check */
     QEMU_CAPS_VIRTIO_PCI_DISABLE_LEGACY, /* virtio-*pci.disable-legacy */
     QEMU_CAPS_QUERY_HOTPLUGGABLE_CPUS, /* qmp command query-hotpluggable-cpus */
     QEMU_CAPS_VIRTIO_NET_RX_QUEUE_SIZE, /* virtio-net-*.rx_queue_size */
-    QEMU_CAPS_MACHINE_IOMMU, /* -machine iommu=on */
+    X_QEMU_CAPS_MACHINE_IOMMU, /* -machine iommu=on */
 
     /* 235 */
     QEMU_CAPS_DEVICE_VIRTIO_VGA, /* -device virtio-vga */
index 88d7c9828cb3bc55affd410aa359bbd4977ec9b6..ca2265cc9072b17a6c3505a2a16feeb295be6187 100644 (file)
@@ -6245,8 +6245,7 @@ qemuBuildBootCommandLine(virCommand *cmd,
 
 static int
 qemuBuildIOMMUCommandLine(virCommand *cmd,
-                          const virDomainDef *def,
-                          virQEMUCaps *qemuCaps)
+                          const virDomainDef *def)
 {
     const virDomainIOMMUDef *iommu = def->iommu;
 
@@ -6257,13 +6256,6 @@ qemuBuildIOMMUCommandLine(virCommand *cmd,
     case VIR_DOMAIN_IOMMU_MODEL_INTEL: {
         g_auto(virBuffer) opts = VIR_BUFFER_INITIALIZER;
 
-        /* qemuValidateDomainDeviceDefIOMMU() already made sure we have
-         * one of QEMU_CAPS_DEVICE_INTEL_IOMMU or QEMU_CAPS_MACHINE_IOMMU:
-         * here we handle the former case, while the latter is taken care
-         * of in qemuBuildMachineCommandLine() */
-        if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_INTEL_IOMMU))
-            return 0;
-
         virBufferAddLit(&opts, "intel-iommu");
         if (iommu->intremap != VIR_TRISTATE_SWITCH_ABSENT) {
             virBufferAsprintf(&opts, ",intremap=%s",
@@ -6904,12 +6896,7 @@ qemuBuildMachineCommandLine(virCommand *cmd,
     if (def->iommu) {
         switch (def->iommu->model) {
         case VIR_DOMAIN_IOMMU_MODEL_INTEL:
-            /* qemuValidateDomainDeviceDefIOMMU() already made sure we have
-             * one of QEMU_CAPS_DEVICE_INTEL_IOMMU or QEMU_CAPS_MACHINE_IOMMU:
-             * here we handle the latter case, while the former is taken care
-             * of in qemuBuildIOMMUCommandLine() */
-            if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_MACHINE_IOMMU))
-                virBufferAddLit(&buf, ",iommu=on");
+            /* The 'intel' IOMMu is formatted in qemuBuildIOMMUCommandLine */
             break;
 
         case VIR_DOMAIN_IOMMU_MODEL_SMMUV3:
@@ -10489,7 +10476,7 @@ qemuBuildCommandLine(virQEMUDriver *driver,
     if (qemuBuildBootCommandLine(cmd, def, qemuCaps) < 0)
         return NULL;
 
-    if (qemuBuildIOMMUCommandLine(cmd, def, qemuCaps) < 0)
+    if (qemuBuildIOMMUCommandLine(cmd, def) < 0)
         return NULL;
 
     if (qemuBuildGlobalControllerCommandLine(cmd, def) < 0)
index 774426bcebf37494659f5188394740141476ca22..e924e8d08f88d4161dcdce0b82e8b0a0b65acbb8 100644 (file)
@@ -4726,8 +4726,7 @@ qemuValidateDomainDeviceDefIOMMU(const virDomainIOMMUDef *iommu,
                            virDomainIOMMUModelTypeToString(iommu->model));
             return -1;
         }
-        if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_INTEL_IOMMU) &&
-            !virQEMUCapsGet(qemuCaps, QEMU_CAPS_MACHINE_IOMMU)) {
+        if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_INTEL_IOMMU)) {
             virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
                            _("IOMMU device: '%s' is not supported with "
                              "this QEMU binary"),