]> git.ipfire.org Git - thirdparty/libvirt.git/commit
virDomainMemoryDefValidate: Fix VIRTIO_MEM alignment check
authorMichal Privoznik <mprivozn@redhat.com>
Fri, 22 Sep 2023 08:45:50 +0000 (10:45 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Fri, 22 Sep 2023 14:37:10 +0000 (16:37 +0200)
commita1d6e18f001e3d4b7c6a726db5fad724406f90ea
tree21b6649866c07cf603ef7d784471e0ade8a79c53
parentd54b70a7e409b876e3ed896f5cd043b7e6f1ae03
virDomainMemoryDefValidate: Fix VIRTIO_MEM alignment check

Inside of virDomainMemoryDefValidate() there's a check that
address where a virtio-mem memory device is mapped to is a
multiple of its block size. But this check is off by a couple of
bits, because the memory address is in bytes while the block size
is in kibibytes. Therefore, when checking whether address is a
multiple of the block size, the latter has to be multiplied by a
factor of 1024.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/conf/domain_validate.c