mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-10 23:07:44 +00:00
qemu: command: move mem.nosharepages validation to qemu_domain.c
Move QEMU_CAPS_MEM_MERGE validation from qemuBuildMachineCommandLine() to qemuDomainDefValidateMemory(). Reviewed-by: Cole Robinson <crobinso@redhat.com> Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
This commit is contained in:
parent
2628247f84
commit
96178e2238
@ -7120,16 +7120,8 @@ qemuBuildMachineCommandLine(virCommandPtr cmd,
|
||||
cfg->dumpGuestCore ? "on" : "off");
|
||||
}
|
||||
|
||||
if (def->mem.nosharepages) {
|
||||
if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_MEM_MERGE)) {
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||
_("disable shared memory is not available "
|
||||
"with this QEMU binary"));
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (def->mem.nosharepages)
|
||||
virBufferAddLit(&buf, ",mem-merge=off");
|
||||
}
|
||||
|
||||
if (def->keywrap &&
|
||||
!qemuAppendKeyWrapMachineParms(&buf, qemuCaps, def->keywrap))
|
||||
|
@ -5180,6 +5180,13 @@ qemuDomainDefValidateMemory(const virDomainDef *def,
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (mem->nosharepages && !virQEMUCapsGet(qemuCaps, QEMU_CAPS_MEM_MERGE)) {
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||
_("disable shared memory is not available "
|
||||
"with this QEMU binary"));
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user