提交 b827edda 编写于 作者: J John Ferlan

qemu: Introduce qemuBuildNumaCommandLine

Add new function to manage adding the '-numa' options to the command
line removing that task from the mainline qemuBuildCommandLine
Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
上级 70681e35
...@@ -5519,6 +5519,44 @@ qemuBuildNumaArgStr(virQEMUDriverConfigPtr cfg, ...@@ -5519,6 +5519,44 @@ qemuBuildNumaArgStr(virQEMUDriverConfigPtr cfg,
} }
static int
qemuBuildNumaCommandLine(virCommandPtr cmd,
virQEMUDriverConfigPtr cfg,
virDomainDefPtr def,
virQEMUCapsPtr qemuCaps,
virBitmapPtr nodeset)
{
size_t i;
if (virDomainNumaGetNodeCount(def->numa) &&
qemuBuildNumaArgStr(cfg, def, cmd, qemuCaps, nodeset) < 0)
return -1;
/* memory hotplug requires NUMA to be enabled - we already checked
* that memory devices are present only when NUMA is */
for (i = 0; i < def->nmems; i++) {
char *backStr;
char *dimmStr;
if (!(backStr = qemuBuildMemoryDimmBackendStr(def->mems[i], def,
qemuCaps, cfg)))
return -1;
if (!(dimmStr = qemuBuildMemoryDeviceStr(def->mems[i]))) {
VIR_FREE(backStr);
return -1;
}
virCommandAddArgList(cmd, "-object", backStr, "-device", dimmStr, NULL);
VIR_FREE(backStr);
VIR_FREE(dimmStr);
}
return 0;
}
static int static int
qemuBuildGraphicsVNCCommandLine(virQEMUDriverConfigPtr cfg, qemuBuildGraphicsVNCCommandLine(virQEMUDriverConfigPtr cfg,
virCommandPtr cmd, virCommandPtr cmd,
...@@ -6927,32 +6965,8 @@ qemuBuildCommandLine(virConnectPtr conn, ...@@ -6927,32 +6965,8 @@ qemuBuildCommandLine(virConnectPtr conn,
if (qemuBuildIOThreadCommandLine(cmd, def, qemuCaps) < 0) if (qemuBuildIOThreadCommandLine(cmd, def, qemuCaps) < 0)
goto error; goto error;
if (virDomainNumaGetNodeCount(def->numa) && if (qemuBuildNumaCommandLine(cmd, cfg, def, qemuCaps, nodeset) < 0)
qemuBuildNumaArgStr(cfg, def, cmd, qemuCaps, nodeset) < 0)
goto error;
/* memory hotplug requires NUMA to be enabled - we already checked
* that memory devices are present only when NUMA is */
for (i = 0; i < def->nmems; i++) {
char *backStr;
char *dimmStr;
if (!(backStr = qemuBuildMemoryDimmBackendStr(def->mems[i], def,
qemuCaps, cfg)))
goto error;
if (!(dimmStr = qemuBuildMemoryDeviceStr(def->mems[i]))) {
VIR_FREE(backStr);
goto error; goto error;
}
virCommandAddArgList(cmd, "-object", backStr, "-device", dimmStr, NULL);
VIR_FREE(backStr);
VIR_FREE(dimmStr);
}
virCommandAddArgList(cmd, "-uuid", uuid, NULL); virCommandAddArgList(cmd, "-uuid", uuid, NULL);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册