[PATCH v3 00/15] Introduce virtio-mem <memory/> model

Peter Krempa pkrempa at redhat.com
Thu Jun 17 12:42:01 UTC 2021


On Thu, Jun 17, 2021 at 14:34:21 +0200, David Hildenbrand wrote:
> On 17.06.21 14:17, Peter Krempa wrote:
> > On Thu, Jun 17, 2021 at 14:03:44 +0200, David Hildenbrand wrote:

[...]

> 
> 4. QEMU does no longer require a "slots" specification when maxmem is set
> (because virtio-based memory devices don't require ACPI memory module
> slots).
> 
> Specifying "<maxMemory unit='KiB'>20971520</maxMemory>" results in (IMHO
> confusing) error:
> 
>   "error: XML document failed to validate against schema: Unable to
>    validate doc against /usr/local/share/libvirt/schemas/domain.rng
>    Extra element maxMemory in interleave
>    Invalid sequence in interleave
>    Element domain failed to validate content"
> 
> 
> "Extra element maxMemory in interleave
> Invalid sequence in interleave
> Element domain failed to validate content"

This is because the XML schema for maxMemory requires the element.
Unfortunately the XML schema validator from libxml2 has extremely
user-unfriendly errors.

> Specifying "<maxMemory slots='0' unit='KiB'>20971520</maxMemory>" results in
>   "error: XML error: both maximum memory size and memory slot count must
>    be specified"

This is the error from the XML parser which has human-crafter errors.

> However, older QEMU version have that requirement. Supported since 3.0 I
> think:
> 
> $ git tag --contains 951f2269af2
> ...
> v3.0.0
> ...

Is there a way how to detect that it's not needed? E.g. via the QMP
schema or such?

In this instance we could perhaps drop it and let qemu report the error
... well if it's reasonable though.




More information about the libvir-list mailing list