From patchwork Fri Nov 4 12:00:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kurz X-Patchwork-Id: 13031676 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 38E77C433FE for ; Fri, 4 Nov 2022 12:04:33 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oqvPv-0000H9-NL; Fri, 04 Nov 2022 08:03:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oqvPb-0000E3-9G for qemu-devel@nongnu.org; Fri, 04 Nov 2022 08:03:03 -0400 Received: from us-smtp-delivery-44.mimecast.com ([205.139.111.44]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oqvPZ-00044j-Dx for qemu-devel@nongnu.org; Fri, 04 Nov 2022 08:03:02 -0400 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-527-vJKZLTJiOD2Nd9Vp5mvg_Q-1; Fri, 04 Nov 2022 08:01:02 -0400 X-MC-Unique: vJKZLTJiOD2Nd9Vp5mvg_Q-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0DC8929AB3F7; Fri, 4 Nov 2022 12:01:02 +0000 (UTC) Received: from bahia.redhat.com (unknown [10.39.192.169]) by smtp.corp.redhat.com (Postfix) with ESMTP id B94F9403161; Fri, 4 Nov 2022 12:01:00 +0000 (UTC) From: Greg Kurz To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Paolo Bonzini , Richard Henderson , =?utf-8?q?Daniel_P_=2E_Be?= =?utf-8?q?rrang=C3=A9?= , Stefan Hajnoczi , Greg Kurz Subject: [PATCH 0/2] util/log: Make the per-thread flag immutable Date: Fri, 4 Nov 2022 13:00:57 +0100 Message-Id: <20221104120059.678470-1-groug@kaod.org> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 Received-SPF: softfail client-ip=205.139.111.44; envelope-from=groug@kaod.org; helo=us-smtp-delivery-44.mimecast.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_SOFTFAIL=0.665 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Qemu-devel" Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org While working on the "util/log: Always send errors to logfile when daemonized" series [1], I've encountered some issues with the per-thread flag. They stem from the code not being designed to allow the per-thread flag to be enabled or disabled more than once, but nothing is done to prevent that from happening. This results in unexpected results like the creation of a log file with a `%d` in its name or confusing errors when using the `log` command in the monitor. I'm posting fixes separately now in case it makes sense to merge them during soft freeze. If so, I'll open an issue as explained in this recent mail [2]. [1] https://patchew.org/QEMU/20221019151651.334334-1-groug@kaod.org/ [2] https://lists.nongnu.org/archive/html/qemu-devel/2022-11/msg00137.html Date: Wed, 19 Oct 2022 17:16:49 +0200 Message-ID: <20221019151651.334334-1-groug@kaod.org> Greg Kurz (2): util/log: Make the per-thread flag immutable util/log: Ignore per-thread flag if global file already there util/log.c | 9 +++++++++ 1 file changed, 9 insertions(+) Reviewed-by: Richard Henderson