6ae9ed
From d9e2deb0b6928f213d11f5c6e82ac17c3cad0b3b Mon Sep 17 00:00:00 2001
6ae9ed
Message-Id: <d9e2deb0b6928f213d11f5c6e82ac17c3cad0b3b@dist-git>
6ae9ed
From: =?UTF-8?q?J=C3=A1n=20Tomko?= <jtomko@redhat.com>
6ae9ed
Date: Mon, 25 Jul 2016 10:24:57 +0200
6ae9ed
Subject: [PATCH] Add QEMU_CAPS_DEVICE_INTEL_IOMMU
6ae9ed
MIME-Version: 1.0
6ae9ed
Content-Type: text/plain; charset=UTF-8
6ae9ed
Content-Transfer-Encoding: 8bit
6ae9ed
6ae9ed
Check whether QEMU supports -device intel-iommu
6ae9ed
6ae9ed
Note that the presence of this option does not mean that it's
6ae9ed
usable because of a bug in earlier QEMU versions, but it's
6ae9ed
better than nothing.
6ae9ed
6ae9ed
https://bugzilla.redhat.com/show_bug.cgi?id=1235581
6ae9ed
(cherry picked from commit 8e7e79738d47d7881eb6ccc61ddcb0cfba418d94)
6ae9ed
Signed-off-by: Ján Tomko <jtomko@redhat.com>
6ae9ed
6ae9ed
 Conflicts:
6ae9ed
	src/qemu/qemu_capabilities.c
6ae9ed
	src/qemu/qemu_capabilities.h
6ae9ed
	tests/qemucapabilitiesdata/caps_2.4.0.x86_64.xml
6ae9ed
	tests/qemucapabilitiesdata/caps_2.5.0.x86_64.xml
6ae9ed
	tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml
6ae9ed
  Downstream is missing QEMU_CAPS_DISPLAY
6ae9ed
---
6ae9ed
 src/qemu/qemu_capabilities.c                     | 2 ++
6ae9ed
 src/qemu/qemu_capabilities.h                     | 1 +
6ae9ed
 tests/qemucapabilitiesdata/caps_2.4.0.x86_64.xml | 1 +
6ae9ed
 tests/qemucapabilitiesdata/caps_2.5.0.x86_64.xml | 1 +
6ae9ed
 tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml | 1 +
6ae9ed
 5 files changed, 6 insertions(+)
6ae9ed
6ae9ed
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
6ae9ed
index 9f1c0e1..b35948d 100644
6ae9ed
--- a/src/qemu/qemu_capabilities.c
6ae9ed
+++ b/src/qemu/qemu_capabilities.c
6ae9ed
@@ -337,6 +337,7 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST,
6ae9ed
               "drive-detect-zeroes",
6ae9ed
 
6ae9ed
               "tls-creds-x509", /* 230 */
6ae9ed
+              "intel-iommu",
6ae9ed
     );
6ae9ed
 
6ae9ed
 
6ae9ed
@@ -1566,6 +1567,7 @@ struct virQEMUCapsStringFlags virQEMUCapsObjectTypes[] = {
6ae9ed
     { "pxb", QEMU_CAPS_DEVICE_PXB },
6ae9ed
     { "pxb-pcie", QEMU_CAPS_DEVICE_PXB_PCIE },
6ae9ed
     { "tls-creds-x509", QEMU_CAPS_OBJECT_TLS_CREDS_X509 },
6ae9ed
+    { "intel-iommu", QEMU_CAPS_DEVICE_INTEL_IOMMU },
6ae9ed
 };
6ae9ed
 
6ae9ed
 static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsVirtioBalloon[] = {
6ae9ed
diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
6ae9ed
index 9d891c8..379aff0 100644
6ae9ed
--- a/src/qemu/qemu_capabilities.h
6ae9ed
+++ b/src/qemu/qemu_capabilities.h
6ae9ed
@@ -370,6 +370,7 @@ typedef enum {
6ae9ed
 
6ae9ed
     /* 230 */
6ae9ed
     QEMU_CAPS_OBJECT_TLS_CREDS_X509, /* -object tls-creds-x509 */
6ae9ed
+    QEMU_CAPS_DEVICE_INTEL_IOMMU, /* -device intel-iommu */
6ae9ed
 
6ae9ed
     QEMU_CAPS_LAST /* this must always be the last item */
6ae9ed
 } virQEMUCapsFlags;
6ae9ed
diff --git a/tests/qemucapabilitiesdata/caps_2.4.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.4.0.x86_64.xml
6ae9ed
index 112ac95..98c260c 100644
6ae9ed
--- a/tests/qemucapabilitiesdata/caps_2.4.0.x86_64.xml
6ae9ed
+++ b/tests/qemucapabilitiesdata/caps_2.4.0.x86_64.xml
6ae9ed
@@ -182,6 +182,7 @@
6ae9ed
   <flag name='qxl-vga.max_outputs'/>
6ae9ed
   <flag name='spice-unix'/>
6ae9ed
   <flag name='drive-detect-zeroes'/>
6ae9ed
+  <flag name='intel-iommu'/>
6ae9ed
   <version>2004000</version>
6ae9ed
   <kvmVersion>0</kvmVersion>
6ae9ed
   <package></package>
6ae9ed
diff --git a/tests/qemucapabilitiesdata/caps_2.5.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.5.0.x86_64.xml
6ae9ed
index 8157985..590c8c1 100644
6ae9ed
--- a/tests/qemucapabilitiesdata/caps_2.5.0.x86_64.xml
6ae9ed
+++ b/tests/qemucapabilitiesdata/caps_2.5.0.x86_64.xml
6ae9ed
@@ -187,6 +187,7 @@
6ae9ed
   <flag name='spice-unix'/>
6ae9ed
   <flag name='drive-detect-zeroes'/>
6ae9ed
   <flag name='tls-creds-x509'/>
6ae9ed
+  <flag name='intel-iommu'/>
6ae9ed
   <version>2005000</version>
6ae9ed
   <kvmVersion>0</kvmVersion>
6ae9ed
   <package></package>
6ae9ed
diff --git a/tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml
6ae9ed
index 1d503dd..128ac11 100644
6ae9ed
--- a/tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml
6ae9ed
+++ b/tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml
6ae9ed
@@ -193,6 +193,7 @@
6ae9ed
   <flag name='spice-unix'/>
6ae9ed
   <flag name='drive-detect-zeroes'/>
6ae9ed
   <flag name='tls-creds-x509'/>
6ae9ed
+  <flag name='intel-iommu'/>
6ae9ed
   <version>2006000</version>
6ae9ed
   <kvmVersion>0</kvmVersion>
6ae9ed
   <package></package>
6ae9ed
-- 
6ae9ed
2.9.2
6ae9ed