[libvirt PATCH 6/9] conf: Advertise migratable attribute for CPU in domcaps

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

 



Signed-off-by: Jiri Denemark <jdenemar@xxxxxxxxxx>
---
 docs/formatdomaincaps.html.in  | 13 +++++++++++--
 docs/schemas/domaincaps.rng    |  3 +++
 src/conf/domain_capabilities.c | 13 ++++++++++++-
 src/conf/domain_capabilities.h |  1 +
 4 files changed, 27 insertions(+), 3 deletions(-)

diff --git a/docs/formatdomaincaps.html.in b/docs/formatdomaincaps.html.in
index 7df9f0bbbf..1506f79818 100644
--- a/docs/formatdomaincaps.html.in
+++ b/docs/formatdomaincaps.html.in
@@ -201,7 +201,12 @@
 &lt;domainCapabilities&gt;
   ...
   &lt;cpu&gt;
-    &lt;mode name='host-passthrough' supported='yes'/&gt;
+    &lt;mode name='host-passthrough' supported='yes'&gt;
+      &lt;enum name='hostPassthroughMigratable'&gt;
+        &lt;value&gt;on&lt;/value&gt;
+        &lt;value&gt;off&lt;/value&gt;
+      &lt;/enum&gt;
+    &lt;/mode&gt;
     &lt;mode name='host-model' supported='yes'&gt;
       &lt;model fallback='allow'&gt;Broadwell&lt;/model&gt;
       &lt;vendor&gt;Intel&lt;/vendor&gt;
@@ -227,7 +232,11 @@
 
     <dl>
       <dt><code>host-passthrough</code></dt>
-      <dd>No mode specific details are provided.</dd>
+      <dd>
+        The <code>hostPassthroughMigratable</code> enum shows possible values
+        of the <code>migratable</code> attribute for the &lt;cpu&gt; element
+        with <code>mode='host-passthrough'</code> in the domain XML.
+      </dd>
 
       <dt><code>host-model</code></dt>
       <dd>
diff --git a/docs/schemas/domaincaps.rng b/docs/schemas/domaincaps.rng
index 682cc82177..325581476d 100644
--- a/docs/schemas/domaincaps.rng
+++ b/docs/schemas/domaincaps.rng
@@ -99,6 +99,9 @@
         <value>host-passthrough</value>
       </attribute>
       <ref name='supported'/>
+      <optional>
+        <ref name='enum'/>
+      </optional>
     </element>
   </define>
 
diff --git a/src/conf/domain_capabilities.c b/src/conf/domain_capabilities.c
index 921d795630..0fa8aee78e 100644
--- a/src/conf/domain_capabilities.c
+++ b/src/conf/domain_capabilities.c
@@ -412,10 +412,21 @@ virDomainCapsCPUFormat(virBufferPtr buf,
     virBufferAddLit(buf, "<cpu>\n");
     virBufferAdjustIndent(buf, 2);
 
-    virBufferAsprintf(buf, "<mode name='%s' supported='%s'/>\n",
+    virBufferAsprintf(buf, "<mode name='%s' supported='%s'",
                       virCPUModeTypeToString(VIR_CPU_MODE_HOST_PASSTHROUGH),
                       cpu->hostPassthrough ? "yes" : "no");
 
+    if (cpu->hostPassthrough && cpu->hostPassthroughMigratable.report) {
+        virBufferAddLit(buf, ">\n");
+        virBufferAdjustIndent(buf, 2);
+        ENUM_PROCESS(cpu, hostPassthroughMigratable,
+                     virTristateSwitchTypeToString);
+        virBufferAdjustIndent(buf, -2);
+        virBufferAddLit(buf, "</mode>\n");
+    } else {
+        virBufferAddLit(buf, "/>\n");
+    }
+
     virBufferAsprintf(buf, "<mode name='%s' ",
                       virCPUModeTypeToString(VIR_CPU_MODE_HOST_MODEL));
     if (cpu->hostModel) {
diff --git a/src/conf/domain_capabilities.h b/src/conf/domain_capabilities.h
index 9f4a23d015..685d5e2a44 100644
--- a/src/conf/domain_capabilities.h
+++ b/src/conf/domain_capabilities.h
@@ -145,6 +145,7 @@ typedef struct _virDomainCapsCPU virDomainCapsCPU;
 typedef virDomainCapsCPU *virDomainCapsCPUPtr;
 struct _virDomainCapsCPU {
     bool hostPassthrough;
+    virDomainCapsEnum hostPassthroughMigratable;
     virCPUDefPtr hostModel;
     virDomainCapsCPUModelsPtr custom;
 };
-- 
2.27.0




[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