On 17.06.21 14:42, Peter Krempa wrote:
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.
I guess only implicitly, for example, if virtio-mem-pci or
virtio-pmem-pci are possible (I assume supported devices can be queried
via QMP). And without these devices, it doesn't make sense to have
"slots=0".
virtio-pmem-pci was introduced with v4.1.0, virtio-mem-pci was
introduced with v5.1.0.
--
Thanks,
David / dhildenb