qemuBuildCommandLine() is calling qemuDomainAlignMemorySizes(),
which is an operation that changes live XML and domain and has
little to do with the command line build process.
Move it to qemuProcessPrepareDomain() where we're supposed to
make live XML and domain changes before launch. qemuProcessStart()
is setting VIR_QEMU_PROCESS_START_NEW if !migrate && !snapshot,
same conditions used in qemuBuildCommandLine() to call
qemuDomainAlignMemorySizes(), making this change seamless.
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
qemuBuildDomainLoaderCommandLine(cmd, def, qemuCaps);
- if (!migrateURI && !snapshot && qemuDomainAlignMemorySizes(def) < 0)
- return NULL;
-
if (qemuBuildMemCommandLine(cmd, def, qemuCaps, priv) < 0)
return NULL;
if (qemuExtDevicesPrepareDomain(driver, vm) < 0)
return -1;
+ if (flags & VIR_QEMU_PROCESS_START_NEW) {
+ VIR_DEBUG("Aligning guest memory");
+ if (qemuDomainAlignMemorySizes(vm->def) < 0)
+ return -1;
+ }
+
for (i = 0; i < vm->def->nchannels; i++) {
if (qemuDomainPrepareChannel(vm->def->channels[i],
priv->channelTargetDir) < 0)