mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-24 05:25:18 +00:00
qemuAppendDomainMemoryMachineParams: Refactor formatting of 'dump-guest-core'
Use virTristateSwitchFromBool to fill in the default if user didn't request it explicitly. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
c7c5d65183
commit
ecb8c93196
@ -6625,15 +6625,13 @@ qemuAppendDomainMemoryMachineParams(virBuffer *buf,
|
|||||||
const virDomainDef *def,
|
const virDomainDef *def,
|
||||||
virQEMUCaps *qemuCaps)
|
virQEMUCaps *qemuCaps)
|
||||||
{
|
{
|
||||||
|
virTristateSwitch dump = def->mem.dump_core;
|
||||||
size_t i;
|
size_t i;
|
||||||
|
|
||||||
if (def->mem.dump_core) {
|
if (dump == VIR_TRISTATE_SWITCH_ABSENT)
|
||||||
virBufferAsprintf(buf, ",dump-guest-core=%s",
|
dump = virTristateSwitchFromBool(cfg->dumpGuestCore);
|
||||||
virTristateSwitchTypeToString(def->mem.dump_core));
|
|
||||||
} else {
|
virBufferAsprintf(buf, ",dump-guest-core=%s", virTristateSwitchTypeToString(dump));
|
||||||
virBufferAsprintf(buf, ",dump-guest-core=%s",
|
|
||||||
cfg->dumpGuestCore ? "on" : "off");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (def->mem.nosharepages)
|
if (def->mem.nosharepages)
|
||||||
virBufferAddLit(buf, ",mem-merge=off");
|
virBufferAddLit(buf, ",mem-merge=off");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user