Add crash CPU feature for Hyper-V. Hyper-V crash MSR's can be used
by Hyper-V based guests to notify about occurred guest crash.
XML:
<features>
<hyperv>
<crash state='on'/>
</hyperv>
</features>
---
docs/formatdomain.html.in | 7 +++++++
docs/schemas/domaincommon.rng | 5 +++++
src/conf/domain_conf.c | 6 +++++-
src/conf/domain_conf.h | 1 +
4 files changed, 18 insertions(+), 1 deletion(-)
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index c88b032..87abeb7 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -1460,6 +1460,7 @@
<relaxed state='on'/>
<vapic state='on'/>
<spinlocks state='on' retries='4096'/>
+ <crash state='on'/>
</hyperv>
<kvm>
<hidden state='on'/>
@@ -1535,6 +1536,12 @@
<td>on, off; retries - at least 4095</td>
<td><span class="since">1.1.0 (QEMU
only)</span></td>
</tr>
+ <tr>
+ <td>crash</td>
+ <td>Enable guest crash notification</td>
+ <td>on, off</td>
+ <td><span class="since">2.5.0 (QEMU
only)</span></td>
+ </tr>
</table>
</dd>
<dt><code>pvspinlock</code></dt>
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
index f196177..07e73df 100644
--- a/docs/schemas/domaincommon.rng
+++ b/docs/schemas/domaincommon.rng
@@ -4827,6 +4827,11 @@
</optional>
</element>
</optional>
+ <optional>
+ <element name="crash">
+ <ref name="featurestate"/>
+ </element>
+ </optional>
</interleave>
</element>
</define>
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 0c559d2..00f291d 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -159,7 +159,8 @@ VIR_ENUM_IMPL(virDomainCapabilitiesPolicy,
VIR_DOMAIN_CAPABILITIES_POLICY_LAST,
VIR_ENUM_IMPL(virDomainHyperv, VIR_DOMAIN_HYPERV_LAST,
"relaxed",
"vapic",
- "spinlocks")
+ "spinlocks",
+ "crash")
VIR_ENUM_IMPL(virDomainKVM, VIR_DOMAIN_KVM_LAST,
"hidden")
@@ -15466,6 +15467,7 @@ virDomainDefParseXML(xmlDocPtr xml,
switch ((virDomainHyperv) feature) {
case VIR_DOMAIN_HYPERV_RELAXED:
case VIR_DOMAIN_HYPERV_VAPIC:
+ case VIR_DOMAIN_HYPERV_CRASH:
if (!(tmp = virXPathString("string(./@state)", ctxt))) {
virReportError(VIR_ERR_XML_ERROR,
_("missing 'state' attribute for
"
@@ -17535,6 +17537,7 @@ virDomainDefFeaturesCheckABIStability(virDomainDefPtr src,
switch ((virDomainHyperv) i) {
case VIR_DOMAIN_HYPERV_RELAXED:
case VIR_DOMAIN_HYPERV_VAPIC:
+ case VIR_DOMAIN_HYPERV_CRASH:
if (src->hyperv_features[i] != dst->hyperv_features[i]) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("State of HyperV enlightenment "
@@ -22091,6 +22094,7 @@ virDomainDefFormatInternal(virDomainDefPtr def,
switch ((virDomainHyperv) j) {
case VIR_DOMAIN_HYPERV_RELAXED:
case VIR_DOMAIN_HYPERV_VAPIC:
+ case VIR_DOMAIN_HYPERV_CRASH:
if (def->hyperv_features[j])
virBufferAsprintf(buf, "<%s
state='%s'/>\n",
virDomainHypervTypeToString(j),
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index fd4ef82..4f35b6c 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -1692,6 +1692,7 @@ typedef enum {
VIR_DOMAIN_HYPERV_RELAXED = 0,
VIR_DOMAIN_HYPERV_VAPIC,
VIR_DOMAIN_HYPERV_SPINLOCKS,
+ VIR_DOMAIN_HYPERV_CRASH,
VIR_DOMAIN_HYPERV_LAST
} virDomainHyperv;
--
1.8.3.1