Re: [PATCH v2 4/5] qemu: Enforce ACPI, UEFI requirements

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 03/30/2017 03:47 AM, Andrea Bolognani wrote:
> On Wed, 2017-03-29 at 19:50 -0400, John Ferlan wrote:
> [...]
>>> @@ -2884,6 +2884,26 @@ qemuDomainDefValidate(const virDomainDef *def,
>>>           goto cleanup;
>>>       }
>>>   
>>> +    /* On x86, UEFI requires ACPI */
>>> +    if (def->os.loader &&
>>> +        def->os.loader->type == VIR_DOMAIN_LOADER_TYPE_PFLASH &&
>>> +        ARCH_IS_X86(def->os.arch) &&
>>> +        def->features[VIR_DOMAIN_FEATURE_ACPI] != VIR_TRISTATE_SWITCH_ON) {
>>> +        virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
>>> +                       _("UEFI requires ACPI on this architecture"));
>>> +        goto cleanup;
>>> +    }
>>> +
>>> +    /* On aarch64, ACPI requires UEFI */
>>> +    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;
>>  
>> goto cleanup;
> 
> Missed that when moving the code over, good catch :)
> 
> [...]
>> So as I said in my last response to v1 - are you sure there couldn't be
>> a guest running that now disappears because of this check?
>>  
>> IOW should this move to post parse processing...
>>  
>> ACK - if you're positive this won't affect the running guest causing it
>> to disappear.
> 
> AIUI it's the other way around: PostParse() is called every
> time the XML is loaded, including daemon start / reload, so
> adding a new error condition there can cause existing guests
> to disappear.
> 
> Validate() on the other hand is only called when creating,
> editing or starting guests, so having the check there will
> prevent users from misconfiguring guests but will also give
> them a chance to fix existing guests.

Fair enough - I didn't have the processing committed to memory and the
whole guest disappearing as a result of post processing or validation
when moving checks to earlier from qemu_command is something that I know
has caused issues in the past. I was being too lazy to "page back in"
those algorithms  ;-)

> 
> As part of preparing this respin, I created a misconfigured
> guest and verified that it didn't disappear after starting
> a build of libvirt that included this patch, so I'll take
> your ACK :)
> 

Great - thanks

John

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]
  Powered by Linux