[libvirt PATCH v2 06/17] conf: Introduce virtio model for <iommu>

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Andrea Bolognani <abologna@xxxxxxxxxx>
Reviewed-by: Ján Tomko <jtomko@xxxxxxxxxx>
---
 docs/schemas/domaincommon.rng  | 1 +
 src/conf/domain_conf.c         | 1 +
 src/conf/domain_conf.h         | 1 +
 src/qemu/qemu_command.c        | 4 ++++
 src/qemu/qemu_domain_address.c | 6 ++++++
 src/qemu/qemu_validate.c       | 3 +++
 6 files changed, 16 insertions(+)

diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
index 9c1b64a644..deef019ded 100644
--- a/docs/schemas/domaincommon.rng
+++ b/docs/schemas/domaincommon.rng
@@ -5447,6 +5447,7 @@
         <choice>
           <value>intel</value>
           <value>smmuv3</value>
+          <value>virtio</value>
         </choice>
       </attribute>
       <optional>
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index e0dfc9e45f..99e82bc5f9 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -1285,6 +1285,7 @@ VIR_ENUM_IMPL(virDomainIOMMUModel,
               VIR_DOMAIN_IOMMU_MODEL_LAST,
               "intel",
               "smmuv3",
+              "virtio",
 );
 
 VIR_ENUM_IMPL(virDomainVsockModel,
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index a4de46773c..f6ffcf985c 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -2753,6 +2753,7 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC(virDomainSecDef, virDomainSecDefFree);
 typedef enum {
     VIR_DOMAIN_IOMMU_MODEL_INTEL,
     VIR_DOMAIN_IOMMU_MODEL_SMMUV3,
+    VIR_DOMAIN_IOMMU_MODEL_VIRTIO,
 
     VIR_DOMAIN_IOMMU_MODEL_LAST
 } virDomainIOMMUModel;
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 2f6f63229a..66a85984f6 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -6408,6 +6408,9 @@ qemuBuildIOMMUCommandLine(virCommand *cmd,
 
         return 0;
 
+    case VIR_DOMAIN_IOMMU_MODEL_VIRTIO:
+        return 0;
+
     case VIR_DOMAIN_IOMMU_MODEL_SMMUV3:
         /* There is no -device for SMMUv3, so nothing to be done here */
         return 0;
@@ -6994,6 +6997,7 @@ qemuBuildMachineCommandLine(virCommand *cmd,
             break;
 
         case VIR_DOMAIN_IOMMU_MODEL_INTEL:
+        case VIR_DOMAIN_IOMMU_MODEL_VIRTIO:
             /* These IOMMUs are formatted in qemuBuildIOMMUCommandLine */
             break;
 
diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c
index 6ca6fa54a3..205610c53e 100644
--- a/src/qemu/qemu_domain_address.c
+++ b/src/qemu/qemu_domain_address.c
@@ -1004,6 +1004,9 @@ qemuDomainDeviceCalculatePCIConnectFlags(virDomainDeviceDef *dev,
 
     case VIR_DOMAIN_DEVICE_IOMMU:
         switch ((virDomainIOMMUModel) dev->data.iommu->model) {
+            case VIR_DOMAIN_IOMMU_MODEL_VIRTIO:
+                return 0;
+
             case VIR_DOMAIN_IOMMU_MODEL_INTEL:
             case VIR_DOMAIN_IOMMU_MODEL_SMMUV3:
             case VIR_DOMAIN_IOMMU_MODEL_LAST:
@@ -2382,6 +2385,9 @@ qemuDomainAssignDevicePCISlots(virDomainDef *def,
         virDomainIOMMUDef *iommu = def->iommu;
 
         switch ((virDomainIOMMUModel) iommu->model) {
+        case VIR_DOMAIN_IOMMU_MODEL_VIRTIO:
+            break;
+
         case VIR_DOMAIN_IOMMU_MODEL_INTEL:
         case VIR_DOMAIN_IOMMU_MODEL_SMMUV3:
         case VIR_DOMAIN_IOMMU_MODEL_LAST:
diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c
index f27e480696..7fec60e342 100644
--- a/src/qemu/qemu_validate.c
+++ b/src/qemu/qemu_validate.c
@@ -4858,6 +4858,9 @@ qemuValidateDomainDeviceDefIOMMU(const virDomainIOMMUDef *iommu,
         }
         break;
 
+    case VIR_DOMAIN_IOMMU_MODEL_VIRTIO:
+        break;
+
     case VIR_DOMAIN_IOMMU_MODEL_LAST:
     default:
         virReportEnumRangeError(virDomainIOMMUModel, iommu->model);
-- 
2.35.1




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux