On 03/29/2017 10:12 AM, Andrea Bolognani wrote:
On Mon, 2017-03-27 at 08:03 -0400, John Ferlan wrote:
>> @@ -6252,9 +6252,23 @@ qemuBuildPMCommandLine(virCommandPtr cmd,
>> virCommandAddArg(cmd, "-no-shutdown");
>> }
>>
>> + /* Architectures that support ACPI also support -no-acpi as a way
>> + * of turning it off, and vice versa */
>> if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_NO_ACPI)) {
>> +
>> + /* ACPI is off unless explicitly turned on */
>> if (def->features[VIR_DOMAIN_FEATURE_ACPI] !=
VIR_TRISTATE_SWITCH_ON)
>> virCommandAddArg(cmd, "-no-acpi");
>> +
>> + /* aarch64 requires UEFI to be in use for ACPI to work */
>> + if (def->features[VIR_DOMAIN_FEATURE_ACPI] == VIR_TRISTATE_SWITCH_ON
&&
>> + def->os.arch == VIR_ARCH_AARCH64 &&
>> + (!def->os.loader ||
>> + def->os.loader->type != VIR_DOMAIN_LOADER_TYPE_PFLASH)) {
>> + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
>> + _("ACPI requires UEFI on this
architecture"));
>> + return -1;
>> + }
>
> Why isn't this check in qemuDomainDefPostParse?
>
> Avoids errors in command line building which IIRC was something where
> there was an "effort" to avoid in favor of "earlier" checking.
Good point.
I've actually moved both checks to qemuDomainDefValidate()
rather than qemuDomainDefPostParse(), so that we can prevent
users from defining or starting guests that don't follow the
requirements without losing existing guests.
As long we don't make a guest disappear then we're good.
I've just posted [v2], if you feel like taking a look :)
I'll look later today.
John