]> xenbits.xensource.com Git - 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)
committerMartin Kletzander <mkletzan@redhat.com>
Mon, 3 Nov 2014 15:43:22 +0000 (16:43 +0100)
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>
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 2e5af4f9419fbaa4454c7ad75c29d6ef55a4ac94..207e2b04657b3a9588f751f6747ae264d9bdc3c0 100644 (file)
@@ -6636,7 +6636,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;
@@ -6796,7 +6797,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;
 
@@ -7764,7 +7765,8 @@ qemuBuildCommandLine(virConnectPtr conn,
                      virNetDevVPortProfileOp vmop,
                      qemuBuildCommandLineCallbacksPtr callbacks,
                      bool standalone,
-                     bool enableFips)
+                     bool enableFips,
+                     virBitmapPtr nodeset)
 {
     virErrorPtr originalError = NULL;
     size_t i, j;
@@ -7992,7 +7994,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 2eaf77d0b29f7509fa891e5468674c436a8cacb8..4f5bc7f62736f9a38d30ab54d403a36c40a5b695 100644 (file)
@@ -6472,7 +6472,8 @@ static char *qemuConnectDomainXMLToNative(virConnectPtr conn,
                                      VIR_NETDEV_VPORT_PROFILE_OP_NO_OP,
                                      &buildCommandLineCallbacks,
                                      true,
-                                     qemuCheckFips())))
+                                     qemuCheckFips(),
+                                     NULL)))
         goto cleanup;
 
     ret = virCommandToString(cmd);
index ba8ba82665869082af3d0375b38306d2a16a93ec..26d494825a78f20a256769bf5a33cb67fc44d995 100644 (file)
@@ -4362,7 +4362,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 0e9fab9d10848f62a9b6adff38a8827ef28410a2..9b8e3e20fc0deab64b8f0a3d7442f9bcde54f9b8 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()) {