]> xenbits.xensource.com Git - libvirt.git/commit
qemuBuildMemoryBackendStr: Report backend requirement more appropriately
authorMichal Privoznik <mprivozn@redhat.com>
Thu, 12 Feb 2015 16:43:27 +0000 (17:43 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Tue, 17 Feb 2015 08:07:09 +0000 (09:07 +0100)
commit7832fac84741d65e851dbdbfaf474785cbfdcf3c
treea1b5384fb5bcdc9e36a80969672e8683493beb4a
parent38064806966c04d7cf7525cd78aa6f82bd09e6d0
qemuBuildMemoryBackendStr: Report backend requirement more appropriately

So, when building the '-numa' command line, the
qemuBuildMemoryBackendStr() function does quite a lot of checks to
chose the best backend, or to check if one is in fact needed. However,
it returned that backend is needed even for this little fella:

  <numatune>
    <memory mode="strict" nodeset="0,2"/>
  </numatune>

This can be guaranteed via CGroups entirely, there's no need to use
memory-backend-ram to let qemu know where to get memory from. Well, as
long as there's no <memnode/> element, which explicitly requires the
backend. Long story short, we wouldn't have to care, as qemu works
either way. However, the problem is migration (as always). Previously,
libvirt would have started qemu with:

  -numa node,memory=X

in this case and restricted memory placement in CGroups. Today, libvirt
creates more complicated command line:

  -object memory-backend-ram,id=ram-node0,size=X
  -numa node,memdev=ram-node0

Again, one wouldn't find anything wrong with these two approaches.
Both work just fine. Unless you try to migrated from the older libvirt
into the newer one. These two approaches are, unfortunately, not
compatible. My suggestion is, in order to allow users to migrate, lets
use the older approach for as long as the newer one is not needed.

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