From patchwork Sat Mar 26 13:25:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 554366 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:1248:0:0:0:0 with SMTP id z8csp6435989mag; Sat, 26 Mar 2022 06:47:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz95wjT6pDV9nFyKE5mZuuzRk0sVVEhNMvkxhbG5LfGVivPpZsCB0ANJdWL5NCj+jk0293z X-Received: by 2002:a05:6214:d6f:b0:440:ffe0:be96 with SMTP id 15-20020a0562140d6f00b00440ffe0be96mr13482805qvs.103.1648302472292; Sat, 26 Mar 2022 06:47:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648302472; cv=none; d=google.com; s=arc-20160816; b=yfwbQVjIfV1sSwITDD2E+gNwejNajydg6mAwHrPyakq1BTJ2YyXejAyi12Pvh/eb4h tsmAL0O3t80iXxpVsMVfAWhNrKa7CJthJhOgL+5gBNShQvchws+HGHhGr8Y4mdxGKiWO W5dJ/S4HceDg+2606vZ5zTuxbRAaB7EovT+jSio1U2AAt9MpVcnhCDUY+JQR/mcYX3tF t7d9xvOSuTn9NF171/IoRZYfRMMfAcHIu0CkyJyOkqF4atV+M0uX0l8lW2CXCCV8/HPO FwbkUw28hB54FRqEc+Dy32EmOgiwvTWRfaMWF/JrTZfJa7ehr1xkzdYQw/g7nhiJRNZr wK8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=tAM8l8umDTOu711aIMp31KRAq18xpQUFDBfm3PD7em4=; b=WpYz6ABQ/jN23+1s+1xDS9OH3MtDtJvoWGlbfTs9Aol2HzbMZaY/4R8Vp3gNVE2O+i cZWR8kKp//kGLNfyADyzpYiUDFSGSrQQhLayknRmogITblC0jNxQImiWmTn6YgXmY7o2 lPn+/IECh42j8edQwV8ItWi9eU1bUr13yjG1WySBHZw9/oVhF7HWmZTCwr2sr/Tkrbqw Nu+7Te5SMeK4E4UdmPW+Yy1yRD/DO+Aqka15y/c7/quFiwI9Y8q9D6az1PnGIn/WekWD uwJst+EcNZUGsRHKk1DEHUdpnX2ijJe851/akghTbiRiro9X+UBj4Bjqjlx5gkKL9ZJT 29kw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BNQUIdUy; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id g16-20020ac870d0000000b002e1fbf3bf93si2858583qtp.388.2022.03.26.06.47.52 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 26 Mar 2022 06:47:52 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BNQUIdUy; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:50750 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nY6lj-000410-P4 for patch@linaro.org; Sat, 26 Mar 2022 09:47:51 -0400 Received: from eggs.gnu.org ([209.51.188.92]:34802) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nY6U9-0002ov-Tj for qemu-devel@nongnu.org; Sat, 26 Mar 2022 09:29:41 -0400 Received: from [2607:f8b0:4864:20::234] (port=45720 helo=mail-oi1-x234.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nY6U8-0005yS-EQ for qemu-devel@nongnu.org; Sat, 26 Mar 2022 09:29:41 -0400 Received: by mail-oi1-x234.google.com with SMTP id 12so11072747oix.12 for ; Sat, 26 Mar 2022 06:29:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=tAM8l8umDTOu711aIMp31KRAq18xpQUFDBfm3PD7em4=; b=BNQUIdUyW12rPVzyDZtNkkk27GgsLQDiq0rWh5/IsmhUcyQLn2lMCdiKExaECvNE1Y EhHVsLDhQhI1rtUEON3yuxufOH4wdIJTzGFmsTvCznYy6KhJXqIo8R9Ysw598Q+i8vNB Vw4iePBT8S8+HW98dZe4xwJf/iR8ZIRXWfUH+Qd7+DCdcini/+n5prIzEJ8+14CY/mxS XhrUe1FLPtshVU4qgEPKoi6h8yKeEFjijD68AUzEW97CuILFJwBfM61B/q94kQ4Od5N/ pt96y5lku82eAhRKLLn8n0vrk8o9VBnjJUvmP89MOc2gIbg3RuGSD4scYHsng1yL+mfU gK0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=tAM8l8umDTOu711aIMp31KRAq18xpQUFDBfm3PD7em4=; b=ylSvkJrw9mlzEG0Xz7F+XN1pYv+bSle9PpiKbWYmnpKKyAIrQECI0uI8S6FqwDWDFu Yp/6IR/4wkCOJIo+pH7cCUGom7hSuaKa+LetzdiqoFr/7VGRBCM+boDZmupvuFA60MqQ 3Zk5a6ej+G9/Z2cpykVjBs9t9flxJAead7MYASCTBSomXJhBMWdOwtSCkjWvQIbMCn/H GC/Ia3ncQAXjezfRbaie/x5/PwqHT5gfqfN45CUzpyABKkk6Q7sIMDpZOJF6TaRlEhxr /7zdVik9htLGfHROXkrBlC28zazi3nKXM431QA9Yh12WbOrcd6CixxRUgEgiGLUca+4o PMtA== X-Gm-Message-State: AOAM532fuLxDEMiTjGVkh2wRWCrx68H5pj3e7xFcKDGz0AqwfgRrxsnw lHkqldKl+xZWXYNtaw+Ts8L5TtHb/6MO3JxM X-Received: by 2002:a05:6808:9b4:b0:2ef:9e41:4f6f with SMTP id e20-20020a05680809b400b002ef9e414f6fmr7752317oig.40.1648301379350; Sat, 26 Mar 2022 06:29:39 -0700 (PDT) Received: from localhost.localdomain (168.189-204-159.bestelclientes.com.mx. [189.204.159.168]) by smtp.gmail.com with ESMTPSA id s24-20020a056808209800b002da3b9bf8e0sm4394509oiw.32.2022.03.26.06.29.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 26 Mar 2022 06:29:38 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 32/39] util/log: Rename logfilename to global_filename Date: Sat, 26 Mar 2022 07:25:27 -0600 Message-Id: <20220326132534.543738-41-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220326132534.543738-1-richard.henderson@linaro.org> References: <20220326132534.543738-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::234 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::234; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x234.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: , Cc: alex.bennee@linaro.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Rename to emphasize this is the file-scope global variable. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson Reviewed-by: Alex Bennée --- util/log.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/util/log.c b/util/log.c index 491a8f97f9..b3f79deb6c 100644 --- a/util/log.c +++ b/util/log.c @@ -34,7 +34,7 @@ typedef struct QemuLogFile { FILE *fd; } QemuLogFile; -static char *logfilename; +static char *global_filename; static QemuMutex qemu_logfile_mutex; static QemuLogFile *qemu_logfile; int qemu_loglevel; @@ -151,8 +151,8 @@ static bool qemu_set_log_internal(const char *filename, bool changed_name, } } - g_free(logfilename); - logfilename = newname; + g_free(global_filename); + global_filename = newname; filename = newname; if (logfile) { @@ -161,7 +161,7 @@ static bool qemu_set_log_internal(const char *filename, bool changed_name, logfile = NULL; } } else { - filename = logfilename; + filename = global_filename; } #ifdef CONFIG_TRACE_LOG @@ -173,9 +173,8 @@ static bool qemu_set_log_internal(const char *filename, bool changed_name, * In all cases we only log if qemu_loglevel is set. * Also: * If not daemonized we will always log either to stderr - * or to a file (if there is a logfilename). - * If we are daemonized, - * we will only log if there is a logfilename. + * or to a file (if there is a filename). + * If we are daemonized, we will only log if there is a filename. */ need_to_open_file = log_flags && (!is_daemonized() || filename);