mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 04:25:18 +00:00
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 3dd1eb3b2650. Signed-off-by: Andrea Bolognani <abologna@redhat.com>
This commit is contained in:
parent
90e6e0fae8
commit
c2fef631ba
@ -19803,9 +19803,12 @@ virDomainDefParseXML(xmlDocPtr xml,
|
||||
tmp);
|
||||
goto error;
|
||||
}
|
||||
def->features[val] = value;
|
||||
def->hpt_resizing = (virDomainHPTResizing) value;
|
||||
VIR_FREE(tmp);
|
||||
}
|
||||
|
||||
if (def->hpt_resizing != VIR_DOMAIN_HPT_RESIZING_NONE)
|
||||
def->features[val] = VIR_TRISTATE_SWITCH_ON;
|
||||
break;
|
||||
|
||||
/* coverity[dead_error_begin] */
|
||||
@ -21983,13 +21986,16 @@ virDomainDefFeaturesCheckABIStability(virDomainDefPtr src,
|
||||
break;
|
||||
|
||||
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,
|
||||
_("State of feature '%s' differs: "
|
||||
"source: '%s=%s', destination: '%s=%s'"),
|
||||
"source: '%s,%s=%s', destination: '%s,%s=%s'"),
|
||||
featureName,
|
||||
"resizing", virDomainHPTResizingTypeToString(src->features[i]),
|
||||
"resizing", virDomainHPTResizingTypeToString(dst->features[i]));
|
||||
virTristateSwitchTypeToString(src->features[i]),
|
||||
"resizing", virDomainHPTResizingTypeToString(src->hpt_resizing),
|
||||
virTristateSwitchTypeToString(dst->features[i]),
|
||||
"resizing", virDomainHPTResizingTypeToString(dst->hpt_resizing));
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
@ -27767,11 +27773,12 @@ virDomainDefFormatInternal(virDomainDefPtr def,
|
||||
break;
|
||||
|
||||
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;
|
||||
|
||||
virBufferAsprintf(buf, "<hpt resizing='%s'/>\n",
|
||||
virDomainHPTResizingTypeToString(def->features[i]));
|
||||
virDomainHPTResizingTypeToString(def->hpt_resizing));
|
||||
break;
|
||||
|
||||
/* coverity[dead_error_begin] */
|
||||
|
@ -2438,6 +2438,7 @@ struct _virDomainDef {
|
||||
int kvm_features[VIR_DOMAIN_KVM_LAST];
|
||||
unsigned int hyperv_spinlocks;
|
||||
virGICVersion gic_version;
|
||||
virDomainHPTResizing hpt_resizing;
|
||||
char *hyperv_vendor_id;
|
||||
int apic_eoi;
|
||||
|
||||
|
@ -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;
|
||||
|
||||
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",
|
||||
_("HTP resizing is not supported by this "
|
||||
"QEMU binary"));
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
str = virDomainHPTResizingTypeToString(def->features[VIR_DOMAIN_FEATURE_HPT]);
|
||||
str = virDomainHPTResizingTypeToString(def->hpt_resizing);
|
||||
if (!str) {
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||
_("Invalid setting for HPT resizing"));
|
||||
|
@ -3812,7 +3812,7 @@ qemuDomainDefValidateFeatures(const virDomainDef *def,
|
||||
break;
|
||||
|
||||
case VIR_DOMAIN_FEATURE_HPT:
|
||||
if (def->features[i] != VIR_DOMAIN_HPT_RESIZING_NONE &&
|
||||
if (def->features[i] != VIR_TRISTATE_SWITCH_ABSENT &&
|
||||
!qemuDomainIsPSeries(def)) {
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
_("The '%s' feature is not supported for "
|
||||
|
Loading…
x
Reference in New Issue
Block a user