def, mem, true, false, &nodemask) < 0)
return -1;
- if (qemuBuildThreadContextProps(&tcProps, &props, priv, nodemask) < 0)
+ if (qemuBuildThreadContextProps(&tcProps, &props, def, priv, nodemask) < 0)
return -1;
if (tcProps &&
int
qemuBuildThreadContextProps(virJSONValue **tcProps,
virJSONValue **memProps,
+ const virDomainDef *def,
qemuDomainObjPrivate *priv,
virBitmap *nodemask)
{
g_autoptr(virJSONValue) props = NULL;
+ virBitmap *emulatorpin = NULL;
+ g_autoptr(virBitmap) emulatorNodes = NULL;
g_autofree char *tcAlias = NULL;
const char *memalias = NULL;
bool prealloc = false;
!prealloc)
return 0;
+ emulatorpin = qemuDomainEvaluateCPUMask(def,
+ def->cputune.emulatorpin,
+ priv->autoNodeset);
+
+ if (emulatorpin && virNumaIsAvailable()) {
+ if (virNumaCPUSetToNodeset(emulatorpin, &emulatorNodes) < 0)
+ return -1;
+
+ virBitmapIntersect(emulatorNodes, nodemask);
+
+ if (virBitmapIsAllClear(emulatorNodes))
+ return 0;
+
+ nodemask = emulatorNodes;
+ }
+
memalias = virJSONValueObjectGetString(*memProps, "id");
if (!memalias) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
def, &mem, false, true, &nodemask) < 0)
return -1;
- if (qemuBuildThreadContextProps(&tcProps, &props, priv, nodemask) < 0)
+ if (qemuBuildThreadContextProps(&tcProps, &props, def, priv, nodemask) < 0)
return -1;
if (tcProps &&
g_autoptr(virJSONValue) tcProps = NULL;
if (qemuBuildThreadContextProps(&tcProps, &nodeBackends[i],
- priv, nodemask[i]) < 0)
+ def, priv, nodemask[i]) < 0)
goto cleanup;
if (tcProps &&
-no-shutdown \
-boot strict=on \
-device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0x2"}' \
--object '{"qom-type":"thread-context","id":"tc-memdimm0","node-affinity":[1,2,3]}' \
+-object '{"qom-type":"thread-context","id":"tc-memdimm0","node-affinity":[1,2]}' \
-object '{"qom-type":"memory-backend-file","id":"memdimm0","mem-path":"/dev/hugepages2M/libvirt/qemu/-1-QEMUGuest1","prealloc":true,"size":536870912,"host-nodes":[1,2,3],"policy":"bind","prealloc-context":"tc-memdimm0"}' \
-device '{"driver":"pc-dimm","node":0,"memdev":"memdimm0","id":"dimm0","slot":0,"addr":4294967296}' \
-object '{"qom-type":"memory-backend-ram","id":"memdimm2","size":536870912}' \