]> git.ipfire.org Git - thirdparty/libvirt.git/commit
conf: Disallow nonexistent NUMA nodes for hugepages
authorMichal Privoznik <mprivozn@redhat.com>
Mon, 15 Sep 2014 09:59:09 +0000 (11:59 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Wed, 17 Sep 2014 16:33:33 +0000 (18:33 +0200)
commitec982f6d929f3c2343d4ea9b06e49c23e6c526ba
tree20e9d93a1b2801eb4e6d02d813299ccc3ad4d18b
parent74cf34bc94c5147b217a86f7f0c2686dc86b62bb
conf: Disallow nonexistent NUMA nodes for hugepages

As of 136ad4974 it is possible to specify different huge pages per
guest NUMA node. However, there's no check if nodeset specified in
./hugepages/page contains only those guest NUMA nodes that exist.
In other words with current code it is possible to define meaningless
combination:

  <memoryBacking>
    <hugepages>
      <page size='1048576' unit='KiB' nodeset='0,2-3'/>
      <page size='2048' unit='KiB' nodeset='1,4'/>
    </hugepages>
  </memoryBacking>
  <vcpu placement='static'>4</vcpu>
  <cpu>
    <numa>
      <cell id='0' cpus='0' memory='1048576'/>
      <cell id='1' cpus='1' memory='1048576'/>
      <cell id='2' cpus='2' memory='1048576'/>
      <cell id='3' cpus='3' memory='1048576'/>
    </numa>
  </cpu>

Notice the node 4 in <hugepages/>?

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
src/qemu/qemu_command.c
tests/qemuxml2argvdata/qemuxml2argv-hugepages-pages4.xml [new file with mode: 0644]
tests/qemuxml2argvtest.c