]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: make advice from numad available when building commandline
authorMartin Kletzander <mkletzan@redhat.com>
Thu, 30 Oct 2014 06:34:30 +0000 (07:34 +0100)
committerCole Robinson <crobinso@redhat.com>
Sat, 15 Nov 2014 21:02:06 +0000 (16:02 -0500)
Particularly in qemuBuildNumaArgStr(), there was a need for the advice
due to memory backing, which needs to know the nodeset it will be pinned
to.  With newer qemu this caused the following error when starting
domain:

  error: internal error: Advice from numad is needed in case of
  automatic numa placement

even when starting perfectly valid domain, e.g.:

  ...
  <vcpu placement='auto'>4</vcpu>
  <numatune>
    <memory mode='strict' placement='auto'/>
  </numatune>
  <cpu>
    <numa>
      <cell id='0' cpus='0' memory='524288'/>
      <cell id='1' cpus='1' memory='524288'/>
    </numa>
  </cpu>
  ...

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

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
(cherry picked from commit 11a48758a7d6c946062c130b6186ae3eadd58e39)

src/qemu/qemu_command.c
src/qemu/qemu_command.h
src/qemu/qemu_driver.c
src/qemu/qemu_process.c
tests/qemuxml2argvtest.c
tests/qemuxmlnstest.c

index cd3444574ff3cf4f7cd5e0ca9ec9146589a956ac..5ef3cbf374811e6b6ad1093ddbaebeb2b25d815e 100644 (file)
@@ -6632,7 +6632,8 @@ static int
 qemuBuildNumaArgStr(virQEMUDriverConfigPtr cfg,
                     const virDomainDef *def,
                     virCommandPtr cmd,
-                    virQEMUCapsPtr qemuCaps)
+                    virQEMUCapsPtr qemuCaps,
+                    virBitmapPtr nodeset)
 {
     size_t i, j;
     virBuffer buf = VIR_BUFFER_INITIALIZER;
@@ -6792,7 +6793,7 @@ qemuBuildNumaArgStr(virQEMUDriverConfigPtr cfg,
 
             virBufferAsprintf(&buf, ",size=%dM,id=ram-node%zu", cellmem, i);
 
-            if (virDomainNumatuneMaybeFormatNodeset(def->numatune, NULL,
+            if (virDomainNumatuneMaybeFormatNodeset(def->numatune, nodeset,
                                                     &nodemask, i) < 0)
                 goto cleanup;
 
@@ -7653,7 +7654,8 @@ qemuBuildCommandLine(virConnectPtr conn,
                      virNetDevVPortProfileOp vmop,
                      qemuBuildCommandLineCallbacksPtr callbacks,
                      bool standalone,
-                     bool enableFips)
+                     bool enableFips,
+                     virBitmapPtr nodeset)
 {
     virErrorPtr originalError = NULL;
     size_t i, j;
@@ -7870,7 +7872,7 @@ qemuBuildCommandLine(virConnectPtr conn,
     }
 
     if (def->cpu && def->cpu->ncells)
-        if (qemuBuildNumaArgStr(cfg, def, cmd, qemuCaps) < 0)
+        if (qemuBuildNumaArgStr(cfg, def, cmd, qemuCaps, nodeset) < 0)
             goto error;
 
     if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_UUID))
index aa40c9ee3a6b18bf0f53e7210dea0c2ec1ea946d..f7d3c2d16c574041e8583763be4de3b4d9f17a2f 100644 (file)
@@ -79,7 +79,8 @@ virCommandPtr qemuBuildCommandLine(virConnectPtr conn,
                                    virNetDevVPortProfileOp vmop,
                                    qemuBuildCommandLineCallbacksPtr callbacks,
                                    bool forXMLToArgv,
-                                   bool enableFips)
+                                   bool enableFips,
+                                   virBitmapPtr nodeset)
     ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(11);
 
 /* Generate '-device' string for chardev device */
index 32faf496103495ba722147fa9bbd968df0917b41..368c1996c1de228e1e77940e069414ff1bc0401a 100644 (file)
@@ -6271,7 +6271,8 @@ static char *qemuConnectDomainXMLToNative(virConnectPtr conn,
                                      VIR_NETDEV_VPORT_PROFILE_OP_NO_OP,
                                      &buildCommandLineCallbacks,
                                      true,
-                                     qemuCheckFips())))
+                                     qemuCheckFips(),
+                                     NULL)))
         goto cleanup;
 
     ret = virCommandToString(cmd);
index 38bd605da00da971b0c9db106903ec871d7bcce1..e527fb80ffe0f981c311bee968733b28cf123a5e 100644 (file)
@@ -4320,7 +4320,8 @@ int qemuProcessStart(virConnectPtr conn,
                                      priv->monJSON, priv->qemuCaps,
                                      migrateFrom, stdin_fd, snapshot, vmop,
                                      &buildCommandLineCallbacks, false,
-                                     qemuCheckFips())))
+                                     qemuCheckFips(),
+                                     nodemask)))
         goto cleanup;
 
     /* now that we know it is about to start call the hook if present */
index 483ca90324ce716a288769bb77bcabf71ccb36b8..cdafa1e6594e9803d1c402a334a8341ab3d679e0 100644 (file)
@@ -362,7 +362,8 @@ static int testCompareXMLToArgvFiles(const char *xml,
                                      migrateFrom, migrateFd, NULL,
                                      VIR_NETDEV_VPORT_PROFILE_OP_NO_OP,
                                      &testCallbacks, false,
-                                     (flags & FLAG_FIPS)))) {
+                                     (flags & FLAG_FIPS),
+                                     NULL))) {
         if (!virtTestOOMActive() &&
             (flags & FLAG_EXPECT_FAILURE)) {
             ret = 0;
index b3a608cc3eec792c945512299fd631f598add249..2f37a260bdd6554755056ff7a6cb39685a50a6ee 100644 (file)
@@ -119,7 +119,7 @@ static int testCompareXMLToArgvFiles(const char *xml,
                                      vmdef, &monitor_chr, json, extraFlags,
                                      migrateFrom, migrateFd, NULL,
                                      VIR_NETDEV_VPORT_PROFILE_OP_NO_OP,
-                                     &testCallbacks, false, false)))
+                                     &testCallbacks, false, false, NULL)))
         goto fail;
 
     if (!virtTestOOMActive()) {