From nobody Thu May 2 08:45:04 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.25 as permitted sender) client-ip=209.132.183.25; envelope-from=libvir-list-bounces@redhat.com; helo=mx4-phx2.redhat.com; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.25 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx4-phx2.redhat.com (mx4-phx2.redhat.com [209.132.183.25]) by mx.zohomail.com with SMTPS id 1488388753274507.3899514784554; Wed, 1 Mar 2017 09:19:13 -0800 (PST) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx4-phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v21HEsZF021289; Wed, 1 Mar 2017 12:14:55 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v21HErFY007282 for ; Wed, 1 Mar 2017 12:14:54 -0500 Received: from andariel.brq.redhat.com ([10.34.250.113]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v21HEqmu007601; Wed, 1 Mar 2017 12:14:53 -0500 From: Peter Krempa To: libvir-list@redhat.com Date: Wed, 1 Mar 2017 18:15:05 +0100 Message-Id: <15b6928e1345f4241ec89c0cd227715ef299fcbf.1488388457.git.pkrempa@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-loop: libvir-list@redhat.com Cc: Peter Krempa Subject: [libvirt] [PATCH] qemu: command: Truncate the chardev logging file even if append is not present X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Our documentation states that the chardev logging file is truncated unless append=3D'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 present to behave the same with both implementations and adhere to the docs. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=3D1420205 --- src/qemu/qemu_command.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 41eecfd18..46bd2e268 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -4827,7 +4827,8 @@ qemuBuildChrChardevFileStr(virLogManagerPtr logManage= r, int flags =3D 0; int logfd; - if (appendval =3D=3D VIR_TRISTATE_SWITCH_OFF) + if (appendval =3D=3D VIR_TRISTATE_SWITCH_ABSENT || + appendval =3D=3D VIR_TRISTATE_SWITCH_OFF) flags |=3D VIR_LOG_MANAGER_PROTOCOL_DOMAIN_OPEN_LOG_FILE_TRUNC= ATE; if ((logfd =3D virLogManagerDomainOpenLogFile(logManager, --=20 2.11.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list