render / rpms / libvirt

Forked from rpms/libvirt 9 months ago
Clone
9119d9
From 3640c2a3c884829af460409e428fc3a439b2fdf2 Mon Sep 17 00:00:00 2001
9119d9
Message-Id: <3640c2a3c884829af460409e428fc3a439b2fdf2@dist-git>
9119d9
From: Martin Kletzander <mkletzan@redhat.com>
9119d9
Date: Tue, 4 Nov 2014 11:04:26 +0100
9119d9
Subject: [PATCH] qemu: make advice from numad available when building
9119d9
 commandline
9119d9
9119d9
Particularly in qemuBuildNumaArgStr(), there was a need for the advice
9119d9
due to memory backing, which needs to know the nodeset it will be pinned
9119d9
to.  With newer qemu this caused the following error when starting
9119d9
domain:
9119d9
9119d9
  error: internal error: Advice from numad is needed in case of
9119d9
  automatic numa placement
9119d9
9119d9
even when starting perfectly valid domain, e.g.:
9119d9
9119d9
  ...
9119d9
  <vcpu placement='auto'>4</vcpu>
9119d9
  <numatune>
9119d9
    <memory mode='strict' placement='auto'/>
9119d9
  </numatune>
9119d9
  <cpu>
9119d9
    <numa>
9119d9
      <cell id='0' cpus='0' memory='524288'/>
9119d9
      <cell id='1' cpus='1' memory='524288'/>
9119d9
    </numa>
9119d9
  </cpu>
9119d9
  ...
9119d9
9119d9
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1138545
9119d9
9119d9
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
9119d9
(cherry picked from commit 11a48758a7d6c946062c130b6186ae3eadd58e39)
9119d9
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
9119d9
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
9119d9
---
9119d9
 src/qemu/qemu_command.c  | 10 ++++++----
9119d9
 src/qemu/qemu_command.h  |  3 ++-
9119d9
 src/qemu/qemu_driver.c   |  3 ++-
9119d9
 src/qemu/qemu_process.c  |  3 ++-
9119d9
 tests/qemuxml2argvtest.c |  3 ++-
9119d9
 tests/qemuxmlnstest.c    |  2 +-
9119d9
 6 files changed, 15 insertions(+), 9 deletions(-)
9119d9
9119d9
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
9119d9
index e4962ee..6c4a8b5 100644
9119d9
--- a/src/qemu/qemu_command.c
9119d9
+++ b/src/qemu/qemu_command.c
9119d9
@@ -6605,7 +6605,8 @@ static int
9119d9
 qemuBuildNumaArgStr(virQEMUDriverConfigPtr cfg,
9119d9
                     const virDomainDef *def,
9119d9
                     virCommandPtr cmd,
9119d9
-                    virQEMUCapsPtr qemuCaps)
9119d9
+                    virQEMUCapsPtr qemuCaps,
9119d9
+                    virBitmapPtr nodeset)
9119d9
 {
9119d9
     size_t i, j;
9119d9
     virBuffer buf = VIR_BUFFER_INITIALIZER;
9119d9
@@ -6765,7 +6766,7 @@ qemuBuildNumaArgStr(virQEMUDriverConfigPtr cfg,
9119d9
 
9119d9
             virBufferAsprintf(&buf, ",size=%dM,id=ram-node%zu", cellmem, i);
9119d9
 
9119d9
-            if (virDomainNumatuneMaybeFormatNodeset(def->numatune, NULL,
9119d9
+            if (virDomainNumatuneMaybeFormatNodeset(def->numatune, nodeset,
9119d9
                                                     &nodemask, i) < 0)
9119d9
                 goto cleanup;
9119d9
 
9119d9
@@ -7733,7 +7734,8 @@ qemuBuildCommandLine(virConnectPtr conn,
9119d9
                      virNetDevVPortProfileOp vmop,
9119d9
                      qemuBuildCommandLineCallbacksPtr callbacks,
9119d9
                      bool standalone,
9119d9
-                     bool enableFips)
9119d9
+                     bool enableFips,
9119d9
+                     virBitmapPtr nodeset)
9119d9
 {
9119d9
     virErrorPtr originalError = NULL;
9119d9
     size_t i, j;
9119d9
@@ -7950,7 +7952,7 @@ qemuBuildCommandLine(virConnectPtr conn,
9119d9
     }
9119d9
 
9119d9
     if (def->cpu && def->cpu->ncells)
9119d9
-        if (qemuBuildNumaArgStr(cfg, def, cmd, qemuCaps) < 0)
9119d9
+        if (qemuBuildNumaArgStr(cfg, def, cmd, qemuCaps, nodeset) < 0)
9119d9
             goto error;
9119d9
 
9119d9
     if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_UUID))
9119d9
diff --git a/src/qemu/qemu_command.h b/src/qemu/qemu_command.h
9119d9
index aa40c9e..f7d3c2d 100644
9119d9
--- a/src/qemu/qemu_command.h
9119d9
+++ b/src/qemu/qemu_command.h
9119d9
@@ -79,7 +79,8 @@ virCommandPtr qemuBuildCommandLine(virConnectPtr conn,
9119d9
                                    virNetDevVPortProfileOp vmop,
9119d9
                                    qemuBuildCommandLineCallbacksPtr callbacks,
9119d9
                                    bool forXMLToArgv,
9119d9
-                                   bool enableFips)
9119d9
+                                   bool enableFips,
9119d9
+                                   virBitmapPtr nodeset)
9119d9
     ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(11);
9119d9
 
9119d9
 /* Generate '-device' string for chardev device */
9119d9
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
9119d9
index 0f68abc..d419689 100644
9119d9
--- a/src/qemu/qemu_driver.c
9119d9
+++ b/src/qemu/qemu_driver.c
9119d9
@@ -6473,7 +6473,8 @@ static char *qemuConnectDomainXMLToNative(virConnectPtr conn,
9119d9
                                      VIR_NETDEV_VPORT_PROFILE_OP_NO_OP,
9119d9
                                      &buildCommandLineCallbacks,
9119d9
                                      true,
9119d9
-                                     qemuCheckFips())))
9119d9
+                                     qemuCheckFips(),
9119d9
+                                     NULL)))
9119d9
         goto cleanup;
9119d9
 
9119d9
     ret = virCommandToString(cmd);
9119d9
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
9119d9
index 7101311..ed095a2 100644
9119d9
--- a/src/qemu/qemu_process.c
9119d9
+++ b/src/qemu/qemu_process.c
9119d9
@@ -4360,7 +4360,8 @@ int qemuProcessStart(virConnectPtr conn,
9119d9
                                      priv->monJSON, priv->qemuCaps,
9119d9
                                      migrateFrom, stdin_fd, snapshot, vmop,
9119d9
                                      &buildCommandLineCallbacks, false,
9119d9
-                                     qemuCheckFips())))
9119d9
+                                     qemuCheckFips(),
9119d9
+                                     nodemask)))
9119d9
         goto cleanup;
9119d9
 
9119d9
     /* now that we know it is about to start call the hook if present */
9119d9
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
9119d9
index dafe683..3efe3c9 100644
9119d9
--- a/tests/qemuxml2argvtest.c
9119d9
+++ b/tests/qemuxml2argvtest.c
9119d9
@@ -362,7 +362,8 @@ static int testCompareXMLToArgvFiles(const char *xml,
9119d9
                                      migrateFrom, migrateFd, NULL,
9119d9
                                      VIR_NETDEV_VPORT_PROFILE_OP_NO_OP,
9119d9
                                      &testCallbacks, false,
9119d9
-                                     (flags & FLAG_FIPS)))) {
9119d9
+                                     (flags & FLAG_FIPS),
9119d9
+                                     NULL))) {
9119d9
         if (!virtTestOOMActive() &&
9119d9
             (flags & FLAG_EXPECT_FAILURE)) {
9119d9
             ret = 0;
9119d9
diff --git a/tests/qemuxmlnstest.c b/tests/qemuxmlnstest.c
9119d9
index b3a608c..2f37a26 100644
9119d9
--- a/tests/qemuxmlnstest.c
9119d9
+++ b/tests/qemuxmlnstest.c
9119d9
@@ -119,7 +119,7 @@ static int testCompareXMLToArgvFiles(const char *xml,
9119d9
                                      vmdef, &monitor_chr, json, extraFlags,
9119d9
                                      migrateFrom, migrateFd, NULL,
9119d9
                                      VIR_NETDEV_VPORT_PROFILE_OP_NO_OP,
9119d9
-                                     &testCallbacks, false, false)))
9119d9
+                                     &testCallbacks, false, false, NULL)))
9119d9
         goto fail;
9119d9
 
9119d9
     if (!virtTestOOMActive()) {
9119d9
-- 
9119d9
2.1.3
9119d9