]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu: Prefer hugepages over mem source='file'
authorMichal Privoznik <mprivozn@redhat.com>
Thu, 8 Jun 2017 14:45:02 +0000 (16:45 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Tue, 13 Jun 2017 14:44:29 +0000 (16:44 +0200)
commit992bf863fccfe1fa1d0c5a5277b9cee50abc48ef
treea7961398f61d969fc58b573b6358c4fa7677ca35
parent671d18594f42f24f7cb3f1b2c574ff4ddba0b183
qemu: Prefer hugepages over mem source='file'

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

Consider the following XML:

  <memoryBacking>
    <hugepages>
      <page size='2048' unit='KiB' nodeset='1'/>
    </hugepages>
    <source type='file'/>
    <access mode='shared'/>
  </memoryBacking>

  <numa>
    <cell id='0' cpus='0-3' memory='512000' unit='KiB'/>
    <cell id='1' cpus='4-7' memory='512000' unit='KiB'/>
  </numa>

The following cmd line is generated:

  -object
  memory-backend-file,id=ram-node0,mem-path=/var/lib/libvirt/qemu/ram,
  share=yes,size=524288000 -numa node,nodeid=0,cpus=0-3,memdev=ram-node0
  -object
  memory-backend-file,id=ram-node1,mem-path=/var/lib/libvirt/qemu/ram,
  share=yes,size=524288000 -numa node,nodeid=1,cpus=4-7,memdev=ram-node1

This is obviously wrong as for node 1 hugepages should have been
used. The hugepages configuration is more specific than <source
type='file'/>.

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