mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 04:25:18 +00:00
virDomainFeaturesHyperVDefParse: Read attribute "mode" of element "hyperv"
Currently, this attribute may either have a value of "custom", or be absent (which defaults to "custom"), for backwards compatibility. Signed-off-by: Tim Wiederhake <twiederh@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
cc1546ac6b
commit
6e83fafe33
@ -17428,7 +17428,14 @@ static int
|
||||
virDomainFeaturesHyperVDefParse(virDomainDef *def,
|
||||
xmlNodePtr node)
|
||||
{
|
||||
def->features[VIR_DOMAIN_FEATURE_HYPERV] = VIR_TRISTATE_SWITCH_ON;
|
||||
virDomainHyperVMode mode;
|
||||
|
||||
if (virXMLPropEnumDefault(node, "mode", virDomainHyperVModeTypeFromString,
|
||||
VIR_XML_PROP_NONZERO, &mode,
|
||||
VIR_DOMAIN_HYPERV_MODE_CUSTOM) < 0)
|
||||
return -1;
|
||||
|
||||
def->features[VIR_DOMAIN_FEATURE_HYPERV] = mode;
|
||||
|
||||
node = xmlFirstElementChild(node);
|
||||
while (node != NULL) {
|
||||
@ -21726,7 +21733,7 @@ virDomainDefFeaturesCheckABIStability(virDomainDef *src,
|
||||
}
|
||||
|
||||
/* hyperv */
|
||||
if (src->features[VIR_DOMAIN_FEATURE_HYPERV] == VIR_TRISTATE_SWITCH_ON) {
|
||||
if (src->features[VIR_DOMAIN_FEATURE_HYPERV] != VIR_DOMAIN_HYPERV_MODE_NONE) {
|
||||
for (i = 0; i < VIR_DOMAIN_HYPERV_LAST; i++) {
|
||||
switch ((virDomainHyperv) i) {
|
||||
case VIR_DOMAIN_HYPERV_RELAXED:
|
||||
|
@ -6712,7 +6712,7 @@ qemuBuildCpuCommandLine(virCommand *cmd,
|
||||
VIR_TRISTATE_SWITCH_ON ? "on" : "off");
|
||||
}
|
||||
|
||||
if (def->features[VIR_DOMAIN_FEATURE_HYPERV] == VIR_TRISTATE_SWITCH_ON) {
|
||||
if (def->features[VIR_DOMAIN_FEATURE_HYPERV] != VIR_DOMAIN_HYPERV_MODE_NONE) {
|
||||
for (i = 0; i < VIR_DOMAIN_HYPERV_LAST; i++) {
|
||||
switch ((virDomainHyperv) i) {
|
||||
case VIR_DOMAIN_HYPERV_RELAXED:
|
||||
|
@ -273,7 +273,7 @@ qemuValidateDomainDefFeatures(const virDomainDef *def,
|
||||
break;
|
||||
|
||||
case VIR_DOMAIN_FEATURE_HYPERV:
|
||||
if (def->features[i] != VIR_TRISTATE_SWITCH_ABSENT &&
|
||||
if (def->features[i] != VIR_DOMAIN_HYPERV_MODE_NONE &&
|
||||
!ARCH_IS_X86(def->os.arch) && !qemuDomainIsARMVirt(def)) {
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
_("Hyperv features are not supported for "
|
||||
|
Loading…
x
Reference in New Issue
Block a user