提交 96178e22 编写于 作者: D Daniel Henrique Barboza 提交者: Cole Robinson

qemu: command: move mem.nosharepages validation to qemu_domain.c

Move QEMU_CAPS_MEM_MERGE validation from qemuBuildMachineCommandLine()
to qemuDomainDefValidateMemory().
Reviewed-by: NCole Robinson <crobinso@redhat.com>
Signed-off-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
上级 2628247f
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册