qemu: command: Split up formatting of -numa and memory devices

They recently were extracted to a separate function. They don't belong
together though. Since -numa formatting is pretty compact, move it to
the main function and rename qemuBuildNumaCommandLine to
qemuBuildMemoryDeviceCommandLine.
This commit is contained in:
Peter Krempa 2016-03-24 15:56:16 +01:00
parent 25c39f76b8
commit 13a4ec678f

View File

@ -7182,18 +7182,14 @@ qemuBuildNumaArgStr(virQEMUDriverConfigPtr cfg,
static int static int
qemuBuildNumaCommandLine(virCommandPtr cmd, qemuBuildMemoryDeviceCommandLine(virCommandPtr cmd,
virQEMUDriverConfigPtr cfg, virQEMUDriverConfigPtr cfg,
virDomainDefPtr def, virDomainDefPtr def,
virQEMUCapsPtr qemuCaps, virQEMUCapsPtr qemuCaps,
virBitmapPtr nodeset) virBitmapPtr nodeset)
{ {
size_t i; 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 /* memory hotplug requires NUMA to be enabled - we already checked
* that memory devices are present only when NUMA is */ * that memory devices are present only when NUMA is */
for (i = 0; i < def->nmems; i++) { for (i = 0; i < def->nmems; i++) {
@ -9260,7 +9256,11 @@ qemuBuildCommandLine(virConnectPtr conn,
if (qemuBuildIOThreadCommandLine(cmd, def, qemuCaps) < 0) if (qemuBuildIOThreadCommandLine(cmd, def, qemuCaps) < 0)
goto error; goto error;
if (qemuBuildNumaCommandLine(cmd, cfg, def, qemuCaps, nodeset) < 0) if (virDomainNumaGetNodeCount(def->numa) &&
qemuBuildNumaArgStr(cfg, def, cmd, qemuCaps, nodeset) < 0)
goto error;
if (qemuBuildMemoryDeviceCommandLine(cmd, cfg, def, qemuCaps, nodeset) < 0)
goto error; goto error;
virUUIDFormat(def->uuid, uuid); virUUIDFormat(def->uuid, uuid);