[libvirt] [PATCH] qemu: Use memory-object-file when needed

Martin Kletzander mkletzan at redhat.com
Tue Jan 12 17:58:09 UTC 2016


On Tue, Jan 12, 2016 at 06:48:02PM +0100, Martin Kletzander wrote:
>We were missing a check for '!nodemask' in the condition that decides
>whether we need memory-object-file or not.  We only used userNodeset,
>but forgot that we might need to use nodemask even if that's not set.
>
>Even though there was a test for this, the args file was incorrect, so
>it is very nicely visible what this change does function-wise.  Even
>with that I added the same test but instead of auto nodeset I specified
>one in numatune/memory just to make sure it fixes the problem.
>
>Signed-off-by: Martin Kletzander <mkletzan at redhat.com>
>---
> src/qemu/qemu_command.c                            |  3 ++-
> .../qemuxml2argv-numatune-auto-prefer.args         |  4 ++-
> ...emuxml2argv-numatune-hugepages-no-memnode.args} |  3 ++-
> .../qemuxml2argv-numatune-hugepages-no-memnode.xml | 29 ++++++++++++++++++++++
> tests/qemuxml2argvtest.c                           |  2 ++
> 5 files changed, 38 insertions(+), 3 deletions(-)
> copy tests/qemuxml2argvdata/{qemuxml2argv-numatune-auto-prefer.args => qemuxml2argv-numatune-hugepages-no-memnode.args} (72%)
> create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-numatune-hugepages-no-memnode.xml
>

I forgot to run 'git commit --amend' before 'git send-email', so this
needs to be considered squashed in:

diff --git c/src/qemu/qemu_command.c i/src/qemu/qemu_command.c
index debaea491be8..55f19a27272c 100644
--- c/src/qemu/qemu_command.c
+++ i/src/qemu/qemu_command.c
@@ -5238,8 +5238,7 @@ qemuBuildMemoryBackendStr(unsigned long long size,
     }

     /* If none of the following is requested... */
-    if (!pagesize && !userNodeset && !memAccess &&
-        !nodeSpecified && !nodemask && !force) {
+    if (!pagesize && !nodemask && !memAccess && !nodeSpecified && !force) {
         /* report back that using the new backend is not necessary
          * to achieve the desired configuration */
         ret = 1;
--

Basically I just used 'nodemask' instead of 'userNodeset'.  It works
even without this diff because nodemask will always be set if
userNodeset is set, it's just redundant to specify both.

Martin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20160112/6066517e/attachment-0001.sig>


More information about the libvir-list mailing list