]> xenbits.xensource.com Git - libvirt.git/commitdiff
domain_capabilities: Don't report machine type for bhyve
authorMichal Privoznik <mprivozn@redhat.com>
Tue, 21 Mar 2017 14:23:35 +0000 (15:23 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Wed, 22 Mar 2017 08:40:17 +0000 (09:40 +0100)
For some drivers the domain's machine type makes no sense. They
just don't use it. A great example is bhyve driver. Therefore it
makes very less sense to report machine in domain capabilities
XML.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
docs/formatdomaincaps.html.in
src/conf/domain_capabilities.c

index 648e3d481e1fee4259feeb50b3de51db37ba262c..007cab62dcdcaaca0e7a74f8d6dc4ab5b342f9a3 100644 (file)
@@ -70,7 +70,8 @@
 
       <dt><code>machine</code></dt>
       <dd>The domain's <a href="formatdomain.html#elementsOSBIOS">machine
-          type</a>.</dd>
+          type</a>. Since not every hypervisor has a sense of machine types
+          this element might be omitted in such drivers.</dd>
 
       <dt><code>arch</code></dt>
       <dd>The domain's <a href="formatdomain.html#elementsOSBIOS">
index bb6742359bdb7814016888e1fdb065a684d0ba5d..7a3d2e6fb1db5e6964d5a6b001cadd2d054d7167 100644 (file)
@@ -527,7 +527,8 @@ virDomainCapsFormatInternal(virBufferPtr buf,
 
     virBufferEscapeString(buf, "<path>%s</path>\n", caps->path);
     virBufferAsprintf(buf, "<domain>%s</domain>\n", virttype_str);
-    virBufferAsprintf(buf, "<machine>%s</machine>\n", caps->machine);
+    if (caps->machine)
+        virBufferAsprintf(buf, "<machine>%s</machine>\n", caps->machine);
     virBufferAsprintf(buf, "<arch>%s</arch>\n", arch_str);
 
     if (caps->maxvcpus)