]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemuBuildMemoryBackendStr: Fix hugepages lookup process
authorMichal Privoznik <mprivozn@redhat.com>
Wed, 24 Jun 2015 16:09:57 +0000 (18:09 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Fri, 26 Jun 2015 07:15:26 +0000 (09:15 +0200)
commitf8e9deb1d4c677eea7f22abef580ceb70765abae
tree3bd2a8795ab6bc330a5c3057031101647c3fe23b
parent786539d6bf5ff841e00c9a538fcf77c65c5c8fab
qemuBuildMemoryBackendStr: Fix hugepages lookup process

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

This function constructs the backend (host facing) part of the
memory device.  At the beginning, the configured hugepages are
searched to find the best match for given guest NUMA node.
Configured hugepages can have a @nodeset attribute to specify on
which guest NUMA nodes should be the hugepages backing used.
There is, however, one 'corner case'. Users may just tell 'use
hugepages to back all the nodes'. In other words:

  <memoryBacking>
    <hugepages/>
  </memoryBacking>

  <cpu>
    <numa>
      <cell id='0' cpus='0-1' memory='1024000' unit='KiB'/>
    </numa>
  </cpu>

Our code fails in this case. Well, since there's no @nodeset (nor
any <page/> child element to <hugepages/>) we fail to lookup the
default hugepage size to use.

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