qemu: Figure out nodeset bitmap size correctly

The current private XML parsing code relies on the assumption
that NUMA node IDs start from 0 and are densely allocated,
neither of which is necessarily the case.

Change it so that the bitmap size is dynamically calculated by
looking at NUMA node IDs instead, which ensures all nodes will
be able to fit and thus the bitmap will be parsed successfully.

Update one of the test cases so that it would fail with the
previous approach, but passes with the new one.

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

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Andrea Bolognani
2018-04-10 16:12:05 +02:00
parent 4fe4ffdbdf
commit 931144858f
2 changed files with 10 additions and 2 deletions

View File

@@ -252,7 +252,7 @@
<device alias='usb'/>
<device alias='ide0-0-0'/>
</devices>
<numad nodeset='0' cpuset='0-7'/>
<numad nodeset='6' cpuset='0-7'/>
<libDir path='/var/lib/libvirt/qemu/domain-1-upstream'/>
<channelTargetDir path='/var/lib/libvirt/qemu/channel/target/domain-1-upstream'/>
<chardevStdioLogd/>