[PATCH 2/5] qemu_validate.c: add pSeries NVDIMM size alignment validation

Daniel Henrique Barboza danielhb413 at gmail.com
Thu Sep 10 17:37:20 UTC 2020

On 9/10/20 11:59 AM, Daniel P. Berrangé wrote:
> On Thu, Jul 30, 2020 at 04:48:01PM -0300, Daniel Henrique Barboza wrote:
>> The existing auto-align behavior for pSeries has the idea to
>> alleviate user configuration of the NVDIMM size, given that the
>> alignment calculation is not trivial to do (256MiB alignment
>> of mem->size - mem->label_size value, a.k.a guest area). We
>> align mem->size down to avoid end of file problems.
>> The end result is not ideal though. We do not touch the domain
>> XML, meaning that the XML can report a NVDIMM size 255MiB smaller
>> than the actual size the guest is seeing. It also adds one more
>> thing to consider in case the guest is reporting less memory
>> than declared, since the auto-align is transparent to the
>> user.
>> Following Andrea's suggestion in [1], let's instead do an
>> size alignment validation. If the NVDIMM is unaligned, error out
>> and suggest a rounded up value. This can be bothersome to users,
>> but will bring consistency of NVDIMM size between the domain XML
>> and the guest.
>> This approach will force existing non-running pSeries guests to
>> readjust the NVDIMM value in their XMLs, if necessary. No changes
>> were made for x86 NVDIMM support.
> This change violates on of the key requirements of libvirt design
> which is to never break existing guests that are running successfully.
> We must not assume users are ok with manually changing their guests
> during an upgrade scenario, so IMHO we need to revert this change.

I think this approach is cleaner, but I don't mind the previous one (perhaps
tweaking it to update the size in the XML to the auto-aligned value, for

I can post patches reverting this change and amending the older approach
(which will not break existing guests). Andrea, what do you think?



> Regards,
> Daniel

More information about the libvir-list mailing list