]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: Generate command line for virtio-iommu
authorAndrea Bolognani <abologna@redhat.com>
Fri, 24 Sep 2021 17:29:37 +0000 (19:29 +0200)
committerAndrea Bolognani <abologna@redhat.com>
Mon, 4 Apr 2022 08:36:28 +0000 (10:36 +0200)
https://bugzilla.redhat.com/show_bug.cgi?id=1653327

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/qemu/qemu_command.c
tests/qemuxml2argvdata/virtio-iommu-aarch64.aarch64-latest.args
tests/qemuxml2argvdata/virtio-iommu-x86_64.x86_64-latest.args

index a6d4bb1cb14b0eca7195db6b64f5289ddfb03832..ea8a18a05bc698e5676d922db567c39753037019 100644 (file)
@@ -6452,6 +6452,18 @@ qemuBuildIOMMUCommandLine(virCommand *cmd,
         return 0;
 
     case VIR_DOMAIN_IOMMU_MODEL_VIRTIO:
+        if (virJSONValueObjectAdd(&props,
+                                  "s:driver", "virtio-iommu",
+                                  NULL) < 0) {
+            return -1;
+        }
+
+        if (qemuBuildDeviceAddressProps(props, def, &iommu->info) < 0)
+            return -1;
+
+        if (qemuBuildDeviceCommandlineFromJSON(cmd, props, def, qemuCaps) < 0)
+            return -1;
+
         return 0;
 
     case VIR_DOMAIN_IOMMU_MODEL_SMMUV3:
index 917451d6f22ab9a7178a49b383117f192462aa70..a9e45ab87fdede6ea4e906a58c8390540f27f59a 100644 (file)
@@ -30,6 +30,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-guest/.config \
 -rtc base=utc \
 -no-shutdown \
 -boot strict=on \
+-device '{"driver":"virtio-iommu","bus":"pcie.0","addr":"0x1"}' \
 -audiodev '{"id":"audio1","driver":"none"}' \
 -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
 -msg timestamp=on
index be06ea995744f6ad9bad7be7c2b8d9edb8b1f096..7e0aa7192d0d952c6766a2489f31fd0a12608a92 100644 (file)
@@ -26,6 +26,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
 -rtc base=utc \
 -no-shutdown \
 -boot strict=on \
+-device '{"driver":"virtio-iommu","bus":"pcie.0","addr":"0x1"}' \
 -audiodev '{"id":"audio1","driver":"none"}' \
 -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
 -msg timestamp=on