You need to sign in or sign up before continuing.
提交 c2fef631 编写于 作者: A Andrea Bolognani

conf: Reintroduce virDomainDef::hpt_resizing

We're going to introduce a second HPT-related setting soon,
at which point using a single location to store everything is
no longer going to cut it.

This mostly, but not completely, reverts 3dd1eb3b.
Signed-off-by: NAndrea Bolognani <abologna@redhat.com>
上级 90e6e0fa
...@@ -19803,9 +19803,12 @@ virDomainDefParseXML(xmlDocPtr xml, ...@@ -19803,9 +19803,12 @@ virDomainDefParseXML(xmlDocPtr xml,
tmp); tmp);
goto error; goto error;
} }
def->features[val] = value; def->hpt_resizing = (virDomainHPTResizing) value;
VIR_FREE(tmp); VIR_FREE(tmp);
} }
if (def->hpt_resizing != VIR_DOMAIN_HPT_RESIZING_NONE)
def->features[val] = VIR_TRISTATE_SWITCH_ON;
break; break;
/* coverity[dead_error_begin] */ /* coverity[dead_error_begin] */
...@@ -21983,13 +21986,16 @@ virDomainDefFeaturesCheckABIStability(virDomainDefPtr src, ...@@ -21983,13 +21986,16 @@ virDomainDefFeaturesCheckABIStability(virDomainDefPtr src,
break; break;
case VIR_DOMAIN_FEATURE_HPT: case VIR_DOMAIN_FEATURE_HPT:
if (src->features[i] != dst->features[i]) { if (src->features[i] != dst->features[i] ||
src->hpt_resizing != dst->hpt_resizing) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("State of feature '%s' differs: " _("State of feature '%s' differs: "
"source: '%s=%s', destination: '%s=%s'"), "source: '%s,%s=%s', destination: '%s,%s=%s'"),
featureName, featureName,
"resizing", virDomainHPTResizingTypeToString(src->features[i]), virTristateSwitchTypeToString(src->features[i]),
"resizing", virDomainHPTResizingTypeToString(dst->features[i])); "resizing", virDomainHPTResizingTypeToString(src->hpt_resizing),
virTristateSwitchTypeToString(dst->features[i]),
"resizing", virDomainHPTResizingTypeToString(dst->hpt_resizing));
return false; return false;
} }
break; break;
...@@ -27767,11 +27773,12 @@ virDomainDefFormatInternal(virDomainDefPtr def, ...@@ -27767,11 +27773,12 @@ virDomainDefFormatInternal(virDomainDefPtr def,
break; break;
case VIR_DOMAIN_FEATURE_HPT: case VIR_DOMAIN_FEATURE_HPT:
if (def->features[i] == VIR_DOMAIN_HPT_RESIZING_NONE) if (def->features[i] != VIR_TRISTATE_SWITCH_ON ||
def->hpt_resizing == VIR_DOMAIN_HPT_RESIZING_NONE)
break; break;
virBufferAsprintf(buf, "<hpt resizing='%s'/>\n", virBufferAsprintf(buf, "<hpt resizing='%s'/>\n",
virDomainHPTResizingTypeToString(def->features[i])); virDomainHPTResizingTypeToString(def->hpt_resizing));
break; break;
/* coverity[dead_error_begin] */ /* coverity[dead_error_begin] */
......
...@@ -2438,6 +2438,7 @@ struct _virDomainDef { ...@@ -2438,6 +2438,7 @@ struct _virDomainDef {
int kvm_features[VIR_DOMAIN_KVM_LAST]; int kvm_features[VIR_DOMAIN_KVM_LAST];
unsigned int hyperv_spinlocks; unsigned int hyperv_spinlocks;
virGICVersion gic_version; virGICVersion gic_version;
virDomainHPTResizing hpt_resizing;
char *hyperv_vendor_id; char *hyperv_vendor_id;
int apic_eoi; int apic_eoi;
......
...@@ -7256,17 +7256,18 @@ qemuBuildMachineCommandLine(virCommandPtr cmd, ...@@ -7256,17 +7256,18 @@ qemuBuildMachineCommandLine(virCommandPtr cmd,
} }
} }
if (def->features[VIR_DOMAIN_FEATURE_HPT] != VIR_DOMAIN_HPT_RESIZING_NONE) { if (def->features[VIR_DOMAIN_FEATURE_HPT] == VIR_TRISTATE_SWITCH_ON) {
const char *str; const char *str;
if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_MACHINE_PSERIES_RESIZE_HPT)) { if (def->hpt_resizing != VIR_DOMAIN_HPT_RESIZING_NONE &&
!virQEMUCapsGet(qemuCaps, QEMU_CAPS_MACHINE_PSERIES_RESIZE_HPT)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("HTP resizing is not supported by this " _("HTP resizing is not supported by this "
"QEMU binary")); "QEMU binary"));
goto cleanup; goto cleanup;
} }
str = virDomainHPTResizingTypeToString(def->features[VIR_DOMAIN_FEATURE_HPT]); str = virDomainHPTResizingTypeToString(def->hpt_resizing);
if (!str) { if (!str) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("Invalid setting for HPT resizing")); _("Invalid setting for HPT resizing"));
......
...@@ -3812,7 +3812,7 @@ qemuDomainDefValidateFeatures(const virDomainDef *def, ...@@ -3812,7 +3812,7 @@ qemuDomainDefValidateFeatures(const virDomainDef *def,
break; break;
case VIR_DOMAIN_FEATURE_HPT: case VIR_DOMAIN_FEATURE_HPT:
if (def->features[i] != VIR_DOMAIN_HPT_RESIZING_NONE && if (def->features[i] != VIR_TRISTATE_SWITCH_ABSENT &&
!qemuDomainIsPSeries(def)) { !qemuDomainIsPSeries(def)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("The '%s' feature is not supported for " _("The '%s' feature is not supported for "
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册