mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-08 22:15:21 +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,
|
||||
virQEMUCaps *qemuCaps)
|
||||
{
|
||||
virTristateSwitch dump = def->mem.dump_core;
|
||||
size_t i;
|
||||
|
||||
if (def->mem.dump_core) {
|
||||
virBufferAsprintf(buf, ",dump-guest-core=%s",
|
||||
virTristateSwitchTypeToString(def->mem.dump_core));
|
||||
} else {
|
||||
virBufferAsprintf(buf, ",dump-guest-core=%s",
|
||||
cfg->dumpGuestCore ? "on" : "off");
|
||||
}
|
||||
if (dump == VIR_TRISTATE_SWITCH_ABSENT)
|
||||
dump = virTristateSwitchFromBool(cfg->dumpGuestCore);
|
||||
|
||||
virBufferAsprintf(buf, ",dump-guest-core=%s", virTristateSwitchTypeToString(dump));
|
||||
|
||||
if (def->mem.nosharepages)
|
||||
virBufferAddLit(buf, ",mem-merge=off");
|
||||
|
Loading…
Reference in New Issue
Block a user