Report domaincaps <features><vmcoreinfo supported='yes'/> if the
guest
config accepts <features><vmcoreinfo state='on'/>
Signed-off-by: Cole Robinson <crobinso(a)redhat.com>
---
This bucks the domaincapabilities trend of always having a child
enum if supported='yes'. Following that trend we would give us
this XML when vmcoreinfo is supported:
<vmcoreinfo supported='yes'>
<enum name='state'>
<value>on</value>
<value>off</value>
</enum>
</vmcoreinfo>
Which is verbose but fine. But it's unclear what we do in the
case when vmcoreinfo isn't supported... do we do:
<vmcoreinfo supported='no'/>
which may not be entirely accurate because the code will still accept
<vmcoreinfo enabled='off'/>. Or do we do:
<vmcoreinfo supported='yes'>
<enum name='state'>
<value>off</value>
</enum>
</vmcoreinfo>
Which is weird IMO. I'm not certain what the semantics of
'supported' are meant to be so I went with this minimal option
but I'm not tied to it
docs/formatdomaincaps.html.in | 5 +++++
docs/schemas/domaincaps.rng | 7 +++++++
src/conf/domain_capabilities.c | 2 ++
src/conf/domain_capabilities.h | 1 +
src/qemu/qemu_capabilities.c | 3 +++
tests/domaincapsschemadata/basic.xml | 1 +
tests/domaincapsschemadata/bhyve_basic.x86_64.xml | 1 +
tests/domaincapsschemadata/bhyve_fbuf.x86_64.xml | 1 +
tests/domaincapsschemadata/bhyve_uefi.x86_64.xml | 1 +
tests/domaincapsschemadata/full.xml | 1 +
tests/domaincapsschemadata/libxl-xenfv-usb.xml | 1 +
tests/domaincapsschemadata/libxl-xenfv.xml | 1 +
tests/domaincapsschemadata/libxl-xenpv-usb.xml | 1 +
tests/domaincapsschemadata/libxl-xenpv.xml | 1 +
tests/domaincapsschemadata/qemu_1.7.0.x86_64.xml | 1 +
tests/domaincapsschemadata/qemu_2.12.0-virt.aarch64.xml | 1 +
tests/domaincapsschemadata/qemu_2.12.0.ppc64.xml | 1 +
tests/domaincapsschemadata/qemu_2.12.0.s390x.xml | 1 +
tests/domaincapsschemadata/qemu_2.12.0.x86_64.xml | 1 +
tests/domaincapsschemadata/qemu_2.6.0-virt.aarch64.xml | 1 +
tests/domaincapsschemadata/qemu_2.6.0.aarch64.xml | 1 +
tests/domaincapsschemadata/qemu_2.6.0.ppc64.xml | 1 +
tests/domaincapsschemadata/qemu_2.6.0.x86_64.xml | 1 +
tests/domaincapsschemadata/qemu_2.7.0.s390x.xml | 1 +
tests/domaincapsschemadata/qemu_2.8.0-tcg.x86_64.xml | 1 +
tests/domaincapsschemadata/qemu_2.8.0.s390x.xml | 1 +
tests/domaincapsschemadata/qemu_2.8.0.x86_64.xml | 1 +
tests/domaincapsschemadata/qemu_2.9.0-q35.x86_64.xml | 1 +
tests/domaincapsschemadata/qemu_2.9.0-tcg.x86_64.xml | 1 +
tests/domaincapsschemadata/qemu_2.9.0.x86_64.xml | 1 +
30 files changed, 43 insertions(+)
diff --git a/docs/formatdomaincaps.html.in b/docs/formatdomaincaps.html.in
index 6bfcaf61c..acdc1cf8a 100644
--- a/docs/formatdomaincaps.html.in
+++ b/docs/formatdomaincaps.html.in
@@ -417,6 +417,7 @@
<value>3</value>
</enum>
</gic>
+ <vmcoreinfo supported='yes'/>
</features>
</domainCapabilities>
</pre>
@@ -441,5 +442,9 @@
<code>gic</code> element.</dd>
</dl>
+ <h4><a id="elementsvmcoreinfo">vmcoreinfo</a></h4>
+
+ <p>Reports whether the vmcoreinfo feature can be enabled</p>
+
</body>
</html>
diff --git a/docs/schemas/domaincaps.rng b/docs/schemas/domaincaps.rng
index 39053181e..bace0e44a 100644
--- a/docs/schemas/domaincaps.rng
+++ b/docs/schemas/domaincaps.rng
@@ -173,6 +173,7 @@
<element name='features'>
<interleave>
<ref name='gic'/>
+ <ref name='vmcoreinfo'/>
</interleave>
</element>
</define>
@@ -184,6 +185,12 @@
</element>
</define>
+ <define name='vmcoreinfo'>
+ <element name='vmcoreinfo'>
+ <ref name='supported'/>
+ </element>
+ </define>
+
<define name='value'>
<zeroOrMore>
<element name='value'>
diff --git a/src/conf/domain_capabilities.c b/src/conf/domain_capabilities.c
index f7d9be50f..ccdccd695 100644
--- a/src/conf/domain_capabilities.c
+++ b/src/conf/domain_capabilities.c
@@ -587,6 +587,8 @@ virDomainCapsFormat(virDomainCapsPtr const caps)
virBufferAdjustIndent(&buf, 2);
virDomainCapsFeatureGICFormat(&buf, &caps->gic);
+ virBufferAsprintf(&buf, "<vmcoreinfo
supported='%s'/>\n",
+ caps->vmcoreinfo ? "yes" : "no");
virBufferAdjustIndent(&buf, -2);
virBufferAddLit(&buf, "</features>\n");
diff --git a/src/conf/domain_capabilities.h b/src/conf/domain_capabilities.h
index fa4c1e442..5bb028f63 100644
--- a/src/conf/domain_capabilities.h
+++ b/src/conf/domain_capabilities.h
@@ -157,6 +157,7 @@ struct _virDomainCaps {
/* add new domain devices here */
virDomainCapsFeatureGIC gic;
+ bool vmcoreinfo;
/* add new domain features here */
};
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index f379fc6d2..0543c0194 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -4830,6 +4830,9 @@ virQEMUCapsFillDomainCaps(virCapsPtr caps,
domCaps->maxvcpus = MIN(domCaps->maxvcpus, hostmaxvcpus);
}
+ domCaps->vmcoreinfo = virQEMUCapsGet(qemuCaps,
+ QEMU_CAPS_DEVICE_VMCOREINFO);
+
if (virQEMUCapsFillDomainOSCaps(os, firmwares, nfirmwares) < 0 ||
virQEMUCapsFillDomainCPUCaps(caps, qemuCaps, domCaps) < 0 ||
virQEMUCapsFillDomainDeviceDiskCaps(qemuCaps,
diff --git a/tests/domaincapsschemadata/basic.xml b/tests/domaincapsschemadata/basic.xml
index 6b788d914..e937b3607 100644
--- a/tests/domaincapsschemadata/basic.xml
+++ b/tests/domaincapsschemadata/basic.xml
@@ -17,5 +17,6 @@
</devices>
<features>
<gic supported='no'/>
+ <vmcoreinfo supported='no'/>
</features>
</domainCapabilities>
diff --git a/tests/domaincapsschemadata/bhyve_basic.x86_64.xml
b/tests/domaincapsschemadata/bhyve_basic.x86_64.xml
index 95a8038c2..70e36e97e 100644
--- a/tests/domaincapsschemadata/bhyve_basic.x86_64.xml
+++ b/tests/domaincapsschemadata/bhyve_basic.x86_64.xml
@@ -27,5 +27,6 @@
</devices>
<features>
<gic supported='no'/>
+ <vmcoreinfo supported='no'/>
</features>
</domainCapabilities>
diff --git a/tests/domaincapsschemadata/bhyve_fbuf.x86_64.xml
b/tests/domaincapsschemadata/bhyve_fbuf.x86_64.xml
index 662d0db9a..19b76da45 100644
--- a/tests/domaincapsschemadata/bhyve_fbuf.x86_64.xml
+++ b/tests/domaincapsschemadata/bhyve_fbuf.x86_64.xml
@@ -44,5 +44,6 @@
</devices>
<features>
<gic supported='no'/>
+ <vmcoreinfo supported='no'/>
</features>
</domainCapabilities>
diff --git a/tests/domaincapsschemadata/bhyve_uefi.x86_64.xml
b/tests/domaincapsschemadata/bhyve_uefi.x86_64.xml
index f8c79b99b..c278df038 100644
--- a/tests/domaincapsschemadata/bhyve_uefi.x86_64.xml
+++ b/tests/domaincapsschemadata/bhyve_uefi.x86_64.xml
@@ -36,5 +36,6 @@
</devices>
<features>
<gic supported='no'/>
+ <vmcoreinfo supported='no'/>
</features>
</domainCapabilities>
diff --git a/tests/domaincapsschemadata/full.xml b/tests/domaincapsschemadata/full.xml
index ab6ef9f2e..93bdad2eb 100644
--- a/tests/domaincapsschemadata/full.xml
+++ b/tests/domaincapsschemadata/full.xml
@@ -107,5 +107,6 @@
</devices>
<features>
<gic supported='no'/>
+ <vmcoreinfo supported='no'/>
</features>
</domainCapabilities>
diff --git a/tests/domaincapsschemadata/libxl-xenfv-usb.xml
b/tests/domaincapsschemadata/libxl-xenfv-usb.xml
index 6a9e3d96f..dfa992cb7 100644
--- a/tests/domaincapsschemadata/libxl-xenfv-usb.xml
+++ b/tests/domaincapsschemadata/libxl-xenfv-usb.xml
@@ -70,5 +70,6 @@
</devices>
<features>
<gic supported='no'/>
+ <vmcoreinfo supported='no'/>
</features>
</domainCapabilities>
diff --git a/tests/domaincapsschemadata/libxl-xenfv.xml
b/tests/domaincapsschemadata/libxl-xenfv.xml
index d48e69948..c74632a13 100644
--- a/tests/domaincapsschemadata/libxl-xenfv.xml
+++ b/tests/domaincapsschemadata/libxl-xenfv.xml
@@ -69,5 +69,6 @@
</devices>
<features>
<gic supported='no'/>
+ <vmcoreinfo supported='no'/>
</features>
</domainCapabilities>
diff --git a/tests/domaincapsschemadata/libxl-xenpv-usb.xml
b/tests/domaincapsschemadata/libxl-xenpv-usb.xml
index d1a3918ef..8277a9efd 100644
--- a/tests/domaincapsschemadata/libxl-xenpv-usb.xml
+++ b/tests/domaincapsschemadata/libxl-xenpv-usb.xml
@@ -60,5 +60,6 @@
</devices>
<features>
<gic supported='no'/>
+ <vmcoreinfo supported='no'/>
</features>
</domainCapabilities>
diff --git a/tests/domaincapsschemadata/libxl-xenpv.xml
b/tests/domaincapsschemadata/libxl-xenpv.xml
index c0e3193fe..c816b2053 100644
--- a/tests/domaincapsschemadata/libxl-xenpv.xml
+++ b/tests/domaincapsschemadata/libxl-xenpv.xml
@@ -59,5 +59,6 @@
</devices>
<features>
<gic supported='no'/>
+ <vmcoreinfo supported='no'/>
</features>
</domainCapabilities>
diff --git a/tests/domaincapsschemadata/qemu_1.7.0.x86_64.xml
b/tests/domaincapsschemadata/qemu_1.7.0.x86_64.xml
index 8d1ad8657..d79e8015f 100644
--- a/tests/domaincapsschemadata/qemu_1.7.0.x86_64.xml
+++ b/tests/domaincapsschemadata/qemu_1.7.0.x86_64.xml
@@ -108,5 +108,6 @@
</devices>
<features>
<gic supported='no'/>
+ <vmcoreinfo supported='no'/>
</features>
</domainCapabilities>
diff --git a/tests/domaincapsschemadata/qemu_2.12.0-virt.aarch64.xml
b/tests/domaincapsschemadata/qemu_2.12.0-virt.aarch64.xml
index 9cba942fb..982f31a9a 100644
--- a/tests/domaincapsschemadata/qemu_2.12.0-virt.aarch64.xml
+++ b/tests/domaincapsschemadata/qemu_2.12.0-virt.aarch64.xml
@@ -115,5 +115,6 @@
<value>3</value>
</enum>
</gic>
+ <vmcoreinfo supported='yes'/>
</features>
</domainCapabilities>
diff --git a/tests/domaincapsschemadata/qemu_2.12.0.ppc64.xml
b/tests/domaincapsschemadata/qemu_2.12.0.ppc64.xml
index 4029e9e38..0aa14b127 100644
--- a/tests/domaincapsschemadata/qemu_2.12.0.ppc64.xml
+++ b/tests/domaincapsschemadata/qemu_2.12.0.ppc64.xml
@@ -77,5 +77,6 @@
</devices>
<features>
<gic supported='no'/>
+ <vmcoreinfo supported='no'/>
</features>
</domainCapabilities>
diff --git a/tests/domaincapsschemadata/qemu_2.12.0.s390x.xml
b/tests/domaincapsschemadata/qemu_2.12.0.s390x.xml
index 50680c1ef..693b6dc7a 100644
--- a/tests/domaincapsschemadata/qemu_2.12.0.s390x.xml
+++ b/tests/domaincapsschemadata/qemu_2.12.0.s390x.xml
@@ -74,5 +74,6 @@
</devices>
<features>
<gic supported='no'/>
+ <vmcoreinfo supported='no'/>
</features>
</domainCapabilities>
diff --git a/tests/domaincapsschemadata/qemu_2.12.0.x86_64.xml
b/tests/domaincapsschemadata/qemu_2.12.0.x86_64.xml
index 851d914bc..797ecfae7 100644
--- a/tests/domaincapsschemadata/qemu_2.12.0.x86_64.xml
+++ b/tests/domaincapsschemadata/qemu_2.12.0.x86_64.xml
@@ -139,5 +139,6 @@
</devices>
<features>
<gic supported='no'/>
+ <vmcoreinfo supported='yes'/>
</features>
</domainCapabilities>
diff --git a/tests/domaincapsschemadata/qemu_2.6.0-virt.aarch64.xml
b/tests/domaincapsschemadata/qemu_2.6.0-virt.aarch64.xml
index 7c019b230..5e4ac26f7 100644
--- a/tests/domaincapsschemadata/qemu_2.6.0-virt.aarch64.xml
+++ b/tests/domaincapsschemadata/qemu_2.6.0-virt.aarch64.xml
@@ -112,5 +112,6 @@
<value>2</value>
</enum>
</gic>
+ <vmcoreinfo supported='no'/>
</features>
</domainCapabilities>
diff --git a/tests/domaincapsschemadata/qemu_2.6.0.aarch64.xml
b/tests/domaincapsschemadata/qemu_2.6.0.aarch64.xml
index 3b1428062..5bc69e717 100644
--- a/tests/domaincapsschemadata/qemu_2.6.0.aarch64.xml
+++ b/tests/domaincapsschemadata/qemu_2.6.0.aarch64.xml
@@ -108,5 +108,6 @@
</devices>
<features>
<gic supported='no'/>
+ <vmcoreinfo supported='no'/>
</features>
</domainCapabilities>
diff --git a/tests/domaincapsschemadata/qemu_2.6.0.ppc64.xml
b/tests/domaincapsschemadata/qemu_2.6.0.ppc64.xml
index 98c72d36d..0543e3f56 100644
--- a/tests/domaincapsschemadata/qemu_2.6.0.ppc64.xml
+++ b/tests/domaincapsschemadata/qemu_2.6.0.ppc64.xml
@@ -81,5 +81,6 @@
</devices>
<features>
<gic supported='no'/>
+ <vmcoreinfo supported='no'/>
</features>
</domainCapabilities>
diff --git a/tests/domaincapsschemadata/qemu_2.6.0.x86_64.xml
b/tests/domaincapsschemadata/qemu_2.6.0.x86_64.xml
index de8188623..21198b500 100644
--- a/tests/domaincapsschemadata/qemu_2.6.0.x86_64.xml
+++ b/tests/domaincapsschemadata/qemu_2.6.0.x86_64.xml
@@ -113,5 +113,6 @@
</devices>
<features>
<gic supported='no'/>
+ <vmcoreinfo supported='no'/>
</features>
</domainCapabilities>
diff --git a/tests/domaincapsschemadata/qemu_2.7.0.s390x.xml
b/tests/domaincapsschemadata/qemu_2.7.0.s390x.xml
index b93d00ece..1e6140091 100644
--- a/tests/domaincapsschemadata/qemu_2.7.0.s390x.xml
+++ b/tests/domaincapsschemadata/qemu_2.7.0.s390x.xml
@@ -74,5 +74,6 @@
</devices>
<features>
<gic supported='no'/>
+ <vmcoreinfo supported='no'/>
</features>
</domainCapabilities>
diff --git a/tests/domaincapsschemadata/qemu_2.8.0-tcg.x86_64.xml
b/tests/domaincapsschemadata/qemu_2.8.0-tcg.x86_64.xml
index d860cd833..8ae794f69 100644
--- a/tests/domaincapsschemadata/qemu_2.8.0-tcg.x86_64.xml
+++ b/tests/domaincapsschemadata/qemu_2.8.0-tcg.x86_64.xml
@@ -114,5 +114,6 @@
</devices>
<features>
<gic supported='no'/>
+ <vmcoreinfo supported='no'/>
</features>
</domainCapabilities>
diff --git a/tests/domaincapsschemadata/qemu_2.8.0.s390x.xml
b/tests/domaincapsschemadata/qemu_2.8.0.s390x.xml
index ee40d1e84..ac6317755 100644
--- a/tests/domaincapsschemadata/qemu_2.8.0.s390x.xml
+++ b/tests/domaincapsschemadata/qemu_2.8.0.s390x.xml
@@ -155,5 +155,6 @@
</devices>
<features>
<gic supported='no'/>
+ <vmcoreinfo supported='no'/>
</features>
</domainCapabilities>
diff --git a/tests/domaincapsschemadata/qemu_2.8.0.x86_64.xml
b/tests/domaincapsschemadata/qemu_2.8.0.x86_64.xml
index 33161f7b8..d227926c6 100644
--- a/tests/domaincapsschemadata/qemu_2.8.0.x86_64.xml
+++ b/tests/domaincapsschemadata/qemu_2.8.0.x86_64.xml
@@ -114,5 +114,6 @@
</devices>
<features>
<gic supported='no'/>
+ <vmcoreinfo supported='no'/>
</features>
</domainCapabilities>
diff --git a/tests/domaincapsschemadata/qemu_2.9.0-q35.x86_64.xml
b/tests/domaincapsschemadata/qemu_2.9.0-q35.x86_64.xml
index 07e1db641..513b71c1b 100644
--- a/tests/domaincapsschemadata/qemu_2.9.0-q35.x86_64.xml
+++ b/tests/domaincapsschemadata/qemu_2.9.0-q35.x86_64.xml
@@ -122,5 +122,6 @@
</devices>
<features>
<gic supported='no'/>
+ <vmcoreinfo supported='no'/>
</features>
</domainCapabilities>
diff --git a/tests/domaincapsschemadata/qemu_2.9.0-tcg.x86_64.xml
b/tests/domaincapsschemadata/qemu_2.9.0-tcg.x86_64.xml
index 6c2bbac19..38fddf586 100644
--- a/tests/domaincapsschemadata/qemu_2.9.0-tcg.x86_64.xml
+++ b/tests/domaincapsschemadata/qemu_2.9.0-tcg.x86_64.xml
@@ -146,5 +146,6 @@
</devices>
<features>
<gic supported='no'/>
+ <vmcoreinfo supported='no'/>
</features>
</domainCapabilities>
diff --git a/tests/domaincapsschemadata/qemu_2.9.0.x86_64.xml
b/tests/domaincapsschemadata/qemu_2.9.0.x86_64.xml
index 2fc3b7213..501fcc682 100644
--- a/tests/domaincapsschemadata/qemu_2.9.0.x86_64.xml
+++ b/tests/domaincapsschemadata/qemu_2.9.0.x86_64.xml
@@ -123,5 +123,6 @@
</devices>
<features>
<gic supported='no'/>
+ <vmcoreinfo supported='no'/>
</features>
</domainCapabilities>
--
2.17.0