]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemuBuildMemoryBackendStr: Handle one more corner case
authorMichal Privoznik <mprivozn@redhat.com>
Tue, 8 Aug 2017 14:51:30 +0000 (16:51 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 10 Aug 2017 15:26:30 +0000 (17:26 +0200)
commite255cf02b2a24d19412d9bf08dfa654150d9a31b
tree6400d5951c8c1aacf766bdf927a8f1f3c75a941d
parente02b5722ed9d88b2e993eba829fc2bcc6c720aab
qemuBuildMemoryBackendStr: Handle one more corner case

https://bugzilla.redhat.com/show_bug.cgi?id=1458638

This code is so complicated because we allow enabling the same
bits at many places. Just like in this case: huge pages can be
enabled by global <hugepages/> element under <memoryBacking> or
on per <memory/> basis. To complicate things a bit more, users
are allowed to omit the page size which case the default page
size is used. And this is what is causing this bug. If no page
size is specified, @pagesize is keeping value of zero throughout
whole function. Therefore we need yet another boolean to hold
[use, don't use] information as we can't sue @pagesize for that.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
src/qemu/qemu_command.c
tests/qemuxml2argvdata/qemuxml2argv-hugepages-pages7.args [new file with mode: 0644]
tests/qemuxml2argvdata/qemuxml2argv-hugepages-pages7.xml [new file with mode: 0644]
tests/qemuxml2argvtest.c
tests/qemuxml2xmloutdata/qemuxml2xmlout-hugepages-pages7.xml [new symlink]
tests/qemuxml2xmltest.c