mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 21:55:25 +00:00
7dd3d77940
The 'size' of a 'shmem' device is parsed and formatted as a "scaled" value, stored in bytes, but the formatting scale is mebibytes. This precission loss combined with the fact that the value was validated only when starting and the size is formatted only when non-zero meant that on first parse a value < 1 MiB would be accepted, but would be formatted to the XML as 0 MiB as it was non-zero but truncated and a subsequent parse would parse of such XML would parse it as 0 bytes, which in turn would be interpreted as 'default' size. Fix the issue by moving the validator, which ensures that the number is a power of two and more than 1 MiB to the validator code so that it'll be rejected at XML parsing time. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 lines
73 B
Plaintext
2 lines
73 B
Plaintext
XML error: shmem size must be a power of 2 and at least 1 MiB (1024 KiB)
|