From: Peter Krempa Date: Wed, 1 Mar 2017 17:15:05 +0000 (+0100) Subject: qemu: command: Truncate the chardev logging file even if append is not present X-Git-Tag: v3.1.0~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=215a8a976466117104d216f1f336c2c3ad51d010;p=thirdparty%2Flibvirt.git qemu: command: Truncate the chardev logging file even if append is not present Our documentation states that the chardev logging file is truncated unless append='on' is specified. QEMU also behaves the same way and truncates the file unless we provide the argument. The new virlogd implementation did not honor if the argument was missing and continued to append to the file. Truncate the file even when the 'append' attribute is not present to behave the same with both implementations and adhere to the docs. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1420205 --- diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 41eecfd187..46bd2e2682 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -4827,7 +4827,8 @@ qemuBuildChrChardevFileStr(virLogManagerPtr logManager, int flags = 0; int logfd; - if (appendval == VIR_TRISTATE_SWITCH_OFF) + if (appendval == VIR_TRISTATE_SWITCH_ABSENT || + appendval == VIR_TRISTATE_SWITCH_OFF) flags |= VIR_LOG_MANAGER_PROTOCOL_DOMAIN_OPEN_LOG_FILE_TRUNCATE; if ((logfd = virLogManagerDomainOpenLogFile(logManager,