mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 12:35:17 +00:00
conf: add 'model' attribute for panic device with values isa, pseries, hyperv
Libvirt already has two types of panic devices - pvpanic and pSeries firmware. This patch introduces the 'model' attribute and a new type of panic device. 'isa' model is for ISA pvpanic device. 'pseries' model is a default value for pSeries guests. 'hyperv' model is the new type. It's used for Hyper-V crash. Schema and docs are updated for the new attribute.
This commit is contained in:
parent
e5c9e03285
commit
658ec27fe8
@ -6152,19 +6152,33 @@ qemu-kvm -net nic,model=? /dev/null
|
|||||||
<pre>
|
<pre>
|
||||||
...
|
...
|
||||||
<devices>
|
<devices>
|
||||||
<panic>
|
<panic model='isa'>
|
||||||
<address type='isa' iobase='0x505'/>
|
<address type='isa' iobase='0x505'/>
|
||||||
</panic>
|
</panic>
|
||||||
</devices>
|
</devices>
|
||||||
...
|
...
|
||||||
</pre>
|
</pre>
|
||||||
<dl>
|
<dl>
|
||||||
|
<dt><code>model</code></dt>
|
||||||
|
<dd>
|
||||||
|
<p>
|
||||||
|
The optional <code>model</code> attribute specifies what type
|
||||||
|
of panic device is provided. The panic model used when this attribute
|
||||||
|
is missing depends on the hypervisor and guest arch.
|
||||||
|
</p>
|
||||||
|
<ul>
|
||||||
|
<li>'isa' — for ISA pvpanic device</li>
|
||||||
|
<li>'pseries' — default and valid only for pSeries guests.</li>
|
||||||
|
<li>'hyperv' — for Hyper-V crash CPU feature.
|
||||||
|
<span class="since">Since 1.3.0, QEMU and KVM only</span></li>
|
||||||
|
</ul>
|
||||||
|
</dd>
|
||||||
<dt><code>address</code></dt>
|
<dt><code>address</code></dt>
|
||||||
<dd>
|
<dd>
|
||||||
<p>
|
<p>
|
||||||
address of panic. The default ioport is 0x505. Most users
|
address of panic. The default ioport is 0x505. Most users
|
||||||
don't need to specify an address, and doing so is forbidden
|
don't need to specify an address, and doing so is forbidden
|
||||||
altogether for pSeries guests.
|
altogether for pseries and hyperv models.
|
||||||
</p>
|
</p>
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
|
@ -5360,6 +5360,15 @@
|
|||||||
</define>
|
</define>
|
||||||
<define name="panic">
|
<define name="panic">
|
||||||
<element name="panic">
|
<element name="panic">
|
||||||
|
<optional>
|
||||||
|
<attribute name="model">
|
||||||
|
<choice>
|
||||||
|
<value>isa</value>
|
||||||
|
<value>pseries</value>
|
||||||
|
<value>hyperv</value>
|
||||||
|
</choice>
|
||||||
|
</attribute>
|
||||||
|
</optional>
|
||||||
<optional>
|
<optional>
|
||||||
<ref name="address"/>
|
<ref name="address"/>
|
||||||
</optional>
|
</optional>
|
||||||
|
@ -525,6 +525,12 @@ VIR_ENUM_IMPL(virDomainWatchdogAction, VIR_DOMAIN_WATCHDOG_ACTION_LAST,
|
|||||||
"none",
|
"none",
|
||||||
"inject-nmi")
|
"inject-nmi")
|
||||||
|
|
||||||
|
VIR_ENUM_IMPL(virDomainPanicModel, VIR_DOMAIN_PANIC_MODEL_LAST,
|
||||||
|
"default",
|
||||||
|
"isa",
|
||||||
|
"pseries",
|
||||||
|
"hyperv")
|
||||||
|
|
||||||
VIR_ENUM_IMPL(virDomainVideo, VIR_DOMAIN_VIDEO_TYPE_LAST,
|
VIR_ENUM_IMPL(virDomainVideo, VIR_DOMAIN_VIDEO_TYPE_LAST,
|
||||||
"vga",
|
"vga",
|
||||||
"cirrus",
|
"cirrus",
|
||||||
@ -10197,6 +10203,7 @@ static virDomainPanicDefPtr
|
|||||||
virDomainPanicDefParseXML(xmlNodePtr node)
|
virDomainPanicDefParseXML(xmlNodePtr node)
|
||||||
{
|
{
|
||||||
virDomainPanicDefPtr panic;
|
virDomainPanicDefPtr panic;
|
||||||
|
char *model = NULL;
|
||||||
|
|
||||||
if (VIR_ALLOC(panic) < 0)
|
if (VIR_ALLOC(panic) < 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -10204,10 +10211,22 @@ virDomainPanicDefParseXML(xmlNodePtr node)
|
|||||||
if (virDomainDeviceInfoParseXML(node, NULL, &panic->info, 0) < 0)
|
if (virDomainDeviceInfoParseXML(node, NULL, &panic->info, 0) < 0)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
|
model = virXMLPropString(node, "model");
|
||||||
|
if (model != NULL &&
|
||||||
|
(panic->model = virDomainPanicModelTypeFromString(model)) < 0) {
|
||||||
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||||
|
_("unknown panic model '%s'"), model);
|
||||||
|
goto error;
|
||||||
|
}
|
||||||
|
|
||||||
|
cleanup:
|
||||||
|
VIR_FREE(model);
|
||||||
return panic;
|
return panic;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
virDomainPanicDefFree(panic);
|
virDomainPanicDefFree(panic);
|
||||||
return NULL;
|
panic = NULL;
|
||||||
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Parse the XML definition for an input device */
|
/* Parse the XML definition for an input device */
|
||||||
@ -17627,6 +17646,14 @@ virDomainPanicDefCheckABIStability(virDomainPanicDefPtr src,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (src->model != dst->model) {
|
||||||
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||||
|
_("Target panic model '%s' does not match source '%s'"),
|
||||||
|
virDomainPanicModelTypeToString(dst->model),
|
||||||
|
virDomainPanicModelTypeToString(src->model));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
return virDomainDeviceInfoCheckABIStability(&src->info, &dst->info);
|
return virDomainDeviceInfoCheckABIStability(&src->info, &dst->info);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -20613,6 +20640,11 @@ static int virDomainPanicDefFormat(virBufferPtr buf,
|
|||||||
int indent = virBufferGetIndent(buf, false);
|
int indent = virBufferGetIndent(buf, false);
|
||||||
|
|
||||||
virBufferAddLit(buf, "<panic");
|
virBufferAddLit(buf, "<panic");
|
||||||
|
|
||||||
|
if (def->model)
|
||||||
|
virBufferAsprintf(buf, " model='%s'",
|
||||||
|
virDomainPanicModelTypeToString(def->model));
|
||||||
|
|
||||||
virBufferAdjustIndent(&childrenBuf, indent + 2);
|
virBufferAdjustIndent(&childrenBuf, indent + 2);
|
||||||
if (virDomainDeviceInfoFormat(&childrenBuf, &def->info, 0) < 0)
|
if (virDomainDeviceInfoFormat(&childrenBuf, &def->info, 0) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -2045,7 +2045,17 @@ struct _virDomainIdMapDef {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
VIR_DOMAIN_PANIC_MODEL_DEFAULT,
|
||||||
|
VIR_DOMAIN_PANIC_MODEL_ISA,
|
||||||
|
VIR_DOMAIN_PANIC_MODEL_PSERIES,
|
||||||
|
VIR_DOMAIN_PANIC_MODEL_HYPERV,
|
||||||
|
|
||||||
|
VIR_DOMAIN_PANIC_MODEL_LAST
|
||||||
|
} virDomainPanicModel;
|
||||||
|
|
||||||
struct _virDomainPanicDef {
|
struct _virDomainPanicDef {
|
||||||
|
int model; /* virDomainPanicModel */
|
||||||
virDomainDeviceInfo info;
|
virDomainDeviceInfo info;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -3060,6 +3070,7 @@ VIR_ENUM_DECL(virDomainMemballoonModel)
|
|||||||
VIR_ENUM_DECL(virDomainSmbiosMode)
|
VIR_ENUM_DECL(virDomainSmbiosMode)
|
||||||
VIR_ENUM_DECL(virDomainWatchdogModel)
|
VIR_ENUM_DECL(virDomainWatchdogModel)
|
||||||
VIR_ENUM_DECL(virDomainWatchdogAction)
|
VIR_ENUM_DECL(virDomainWatchdogAction)
|
||||||
|
VIR_ENUM_DECL(virDomainPanicModel)
|
||||||
VIR_ENUM_DECL(virDomainVideo)
|
VIR_ENUM_DECL(virDomainVideo)
|
||||||
VIR_ENUM_DECL(virDomainHostdevMode)
|
VIR_ENUM_DECL(virDomainHostdevMode)
|
||||||
VIR_ENUM_DECL(virDomainHostdevSubsys)
|
VIR_ENUM_DECL(virDomainHostdevSubsys)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user