Add svm attribute to qemu command line if specified in domain conf.

Signed-off-by: Zhenzhong Duan <[email protected]>
---
 src/qemu/qemu_command.c                                  | 1 +
 tests/qemuxmlconfdata/intel-iommu-svm.x86_64-latest.args | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 5ea8337602..f1a1bde3aa 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -6346,6 +6346,7 @@ qemuBuildIOMMUCommandLine(virCommand *cmd,
                                       "T:scalable-mode", iommu->scalable_mode,
                                       "T:fsts", iommu->fsts,
                                       "p:pasid-bits", iommu->pasid_bits,
+                                      "T:svm", iommu->svm,
                                       NULL) < 0)
                 return -1;
 
diff --git a/tests/qemuxmlconfdata/intel-iommu-svm.x86_64-latest.args 
b/tests/qemuxmlconfdata/intel-iommu-svm.x86_64-latest.args
index e2f5adfc93..9cacafe6d3 100644
--- a/tests/qemuxmlconfdata/intel-iommu-svm.x86_64-latest.args
+++ b/tests/qemuxmlconfdata/intel-iommu-svm.x86_64-latest.args
@@ -26,7 +26,7 @@ 
XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
 -rtc base=utc \
 -no-shutdown \
 -boot strict=on \
--device 
'{"driver":"intel-iommu","id":"iommu0","scalable-mode":true,"fsts":true,"pasid-bits":6}'
 \
+-device 
'{"driver":"intel-iommu","id":"iommu0","scalable-mode":true,"fsts":true,"pasid-bits":6,"svm":true}'
 \
 -audiodev '{"id":"audio1","driver":"none"}' \
 -global ICH9-LPC.noreboot=off \
 -watchdog-action reset \
-- 
2.52.0

Reply via email to