[libvirt] [PATCH 3/4] qemu: Enforce ACPI, UEFI requirements
John Ferlan
jferlan at redhat.com
Wed Mar 29 16:05:56 UTC 2017
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
>
> [v2] https://www.redhat.com/archives/libvir-list/2017-March/msg01531.html
> --
> Andrea Bolognani / Red Hat / Virtualization
>
More information about the libvir-list
mailing list