https://bugzilla.redhat.com/show_bug.cgi?id=1653327
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
src/qemu/qemu_command.c | 12 ++++++++++++
.../virtio-iommu-aarch64.aarch64-latest.args | 1 +
.../virtio-iommu-x86_64.x86_64-latest.args | 1 +
3 files changed, 14 insertions(+)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index a6d4bb1cb1..ea8a18a05b 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -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:
diff --git a/tests/qemuxml2argvdata/virtio-iommu-aarch64.aarch64-latest.args
b/tests/qemuxml2argvdata/virtio-iommu-aarch64.aarch64-latest.args
index 917451d6f2..a9e45ab87f 100644
--- a/tests/qemuxml2argvdata/virtio-iommu-aarch64.aarch64-latest.args
+++ b/tests/qemuxml2argvdata/virtio-iommu-aarch64.aarch64-latest.args
@@ -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
diff --git a/tests/qemuxml2argvdata/virtio-iommu-x86_64.x86_64-latest.args
b/tests/qemuxml2argvdata/virtio-iommu-x86_64.x86_64-latest.args
index be06ea9957..7e0aa7192d 100644
--- a/tests/qemuxml2argvdata/virtio-iommu-x86_64.x86_64-latest.args
+++ b/tests/qemuxml2argvdata/virtio-iommu-x86_64.x86_64-latest.args
@@ -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
--
2.35.1