If the value is VIR_TRISTATE_BOOL_ABSENT we should just omit the element entirely. Signed-off-by: Andrea Bolognani <abologna@xxxxxxxxxx> --- src/qemu/qemu_domain.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index a587ebe86d..5fe05cc09a 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -2205,9 +2205,10 @@ void qemuDomainObjPrivateXMLFormatAllowReboot(virBuffer *buf, virTristateBool allowReboot) { - virBufferAsprintf(buf, "<allowReboot value='%s'/>\n", - virTristateBoolTypeToString(allowReboot)); - + if (allowReboot) { + virBufferAsprintf(buf, "<allowReboot value='%s'/>\n", + virTristateBoolTypeToString(allowReboot)); + } } -- 2.35.1