1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2024-12-22 17:34:18 +03:00

qemu: make advice from numad available when building commandline

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>
This commit is contained in:
Martin Kletzander 2014-10-30 07:34:30 +01:00
parent e43854a498
commit 11a48758a7
6 changed files with 15 additions and 9 deletions

View 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))

View 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 */

View 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);

View 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 */

View 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;

View 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()) {