Message ID | 20220320171135.2704502-34-richard.henderson@linaro.org |
---|---|
State | Superseded |
Headers | show
Delivered-To: patch@linaro.org Received: by 2002:a05:7000:1248:0:0:0:0 with SMTP id z8csp894345mag; Sun, 20 Mar 2022 10:57:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyWFWshgnc/JU1eJ4gbHn+xaA5sdsxuyIG70YjieyJrCD1HrfVqsq7diznACgUayKRoCYHK X-Received: by 2002:ad4:5945:0:b0:440:a706:3eb7 with SMTP id eo5-20020ad45945000000b00440a7063eb7mr13832690qvb.96.1647799078674; Sun, 20 Mar 2022 10:57:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647799078; cv=none; d=google.com; s=arc-20160816; b=zeIQ0ofmfEi4509qGviuSHncuUXvpW6SEKpHyBl+hHohzjLEpEq+YN/y8fCgXbBUXY yCqs0LC3tS71d7H8w5vk3ltxzC8TU+6AWH9TvDqNQ+aF9dOxAhnQ30fQUX3y232kG5uf AEkUcgsQHPhqtCKF/sy4iftqU1PNcT8P4tas626HTsoq5vxdbjabso/BamGYHXCBId/h 7ORKW98tfYhQepcfyDpdGf8Z9Wy6wlEbwUSxtI/34ldkSnt432NTYnvXByV8iLRxQZCh CfmCZKgMpFGyuc3bKSBWQnFid5E7W3wGJSrUzyKpfI+XtS86JIGp8dMlAaG4pNDcYIY5 a2rA== 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=x13T9/TUVJR5WOXUIsAjX0bOPDpTDGONzFnTqPFV7QM=; b=Sr7Dok/EQK1Hg58RjYfnTT6CWxCmLIs8d00MnpoIJrcciMt+vGhWtL4KyCcB7E0d/A 0rlb1/akMi0xQHeUb9aR3/zMmKZKmYppvCe/h5R/K6JdyCxEId3j24ZZuNZpblul7GJA RpG15xhPMW2wzV+XjheK8XB3oFLqF8K8YvKCbR+OnbUu5+L6UeRGix2yq3vv5p6gZekF wEl/Vi6qqGBMXl2IxFLo+y9GTwQrCh+r1xpZPuNr/xEb/knkDK163/8LMYD5QQT589GF zJHyTPcopxnUfk3ZzfQ8ot1dPD5t8h8cgiAgzauSWFclBLDKX9ErEV/a/Nkjq1SqPK/n Bc5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="N/rjaEk8"; 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: <qemu-devel-bounces+patch=linaro.org@nongnu.org> Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id j8-20020a05620a410800b0067e4be23837si1516127qko.124.2022.03.20.10.57.58 for <patch@linaro.org> (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 20 Mar 2022 10:57:58 -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="N/rjaEk8"; 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]:55034 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <qemu-devel-bounces+patch=linaro.org@nongnu.org>) id 1nVzoT-0008Dg-VN for patch@linaro.org; Sun, 20 Mar 2022 13:57:58 -0400 Received: from eggs.gnu.org ([209.51.188.92]:33414) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <richard.henderson@linaro.org>) id 1nVz69-0000UB-W2 for qemu-devel@nongnu.org; Sun, 20 Mar 2022 13:12:11 -0400 Received: from [2607:f8b0:4864:20::529] (port=45992 helo=mail-pg1-x529.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from <richard.henderson@linaro.org>) id 1nVz68-0003WY-Dg for qemu-devel@nongnu.org; Sun, 20 Mar 2022 13:12:09 -0400 Received: by mail-pg1-x529.google.com with SMTP id o13so8738411pgc.12 for <qemu-devel@nongnu.org>; Sun, 20 Mar 2022 10:12:07 -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=x13T9/TUVJR5WOXUIsAjX0bOPDpTDGONzFnTqPFV7QM=; b=N/rjaEk8feoQityhP/wli9aTjqe5JbWSn402XOk8mY5MeLJW4YLB23tM321QnAdC+K OpifwMWfYSSbexIszPRtvpyMxOuh8042aeUvHtgqfRZlIfMardfFvnRI3FqlS8Z64a47 bkVC2IiFHGF51CHrQQoP/dcTETZcXYIRJkVIdBRJKYf/NAWgGTzVHj7hmA/E1mE8Hb2H k2nH6JWKCNGa7qPfz5THtVMxjluxL567PhvuK8jn7rdMw1z5ozweYBHUL5wdaA2Zo5oR 13aHM6UdGRDEr0eiZa7/thTsTA8ndeXKJqL70hjNXDKV4dsmXS1j0TIq1vlI1VUYMojP 4gIQ== 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=x13T9/TUVJR5WOXUIsAjX0bOPDpTDGONzFnTqPFV7QM=; b=QcMw9LpGoeZsX3jsvDNjtQINAGAQEdwlShQZN1xD6BHTdx32+4JQS14lNW0PFU+ckA uXdP/iIDLR0Y4RIY9cvO3YPAcNlfe4fNUa8A8M/MOowuc9QG/1WzeaXv2bKJ2l+Ns91K Pi3qlzubGm6pdKMdpNtf4tx7TloLbHqo4fPM2k8ayZIiQX9QKZ2d6lEiLJieB1M/wEkc 2+BEY+qA/DEqoqK7lsMx9MldS70RHEsl8N30ISTKB41YZKBzb+wnsyEJDShLuPBWjTqj vrrLDlv8aXmw8kn/WQwfG6bxIqQCbBYlhbTTXRRSmmWp2Fmxg6J0ogfsRGdetKme38Cm b4IQ== X-Gm-Message-State: AOAM530IIayzEpsNeQhiVaMpZEcSWMBzcf0iZvLJSApAJa4v9aDmpABh 3CNH6QRWpu5kW7QPry4M2Eyx+JwOq9cOZw== X-Received: by 2002:a63:ad4d:0:b0:378:4b82:b881 with SMTP id y13-20020a63ad4d000000b003784b82b881mr15525869pgo.282.1647796327064; Sun, 20 Mar 2022 10:12:07 -0700 (PDT) Received: from localhost.localdomain (174-21-142-130.tukw.qwest.net. [174.21.142.130]) by smtp.gmail.com with ESMTPSA id q12-20020a17090aa00c00b001bc6f1baaaesm17149697pjp.39.2022.03.20.10.12.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 20 Mar 2022 10:12:06 -0700 (PDT) From: Richard Henderson <richard.henderson@linaro.org> To: qemu-devel@nongnu.org Subject: [PULL for-7.1 33/36] util/log: Combine two logfile closes Date: Sun, 20 Mar 2022 10:11:32 -0700 Message-Id: <20220320171135.2704502-34-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220320171135.2704502-1-richard.henderson@linaro.org> References: <20220320171135.2704502-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::529 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::529; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x529.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: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <https://lists.nongnu.org/archive/html/qemu-devel> List-Post: <mailto:qemu-devel@nongnu.org> List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help> List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Cc: alex.bennee@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" <qemu-devel-bounces+patch=linaro.org@nongnu.org> |
Series |
Logging cleanup and per-thread logfiles
|
expand
|
diff --git a/util/log.c b/util/log.c index f1f6d09c90..596de0050f 100644 --- a/util/log.c +++ b/util/log.c @@ -166,12 +166,6 @@ static void qemu_set_log_internal(const char *filename, bool changed_name, g_free(global_filename); global_filename = newname; filename = newname; - - if (logfile) { - qatomic_rcu_set(&global_file, NULL); - call_rcu(logfile, qemu_logfile_free, rcu); - logfile = NULL; - } } else { filename = global_filename; } @@ -191,11 +185,12 @@ static void qemu_set_log_internal(const char *filename, bool changed_name, daemonized = is_daemonized(); need_to_open_file = log_flags && (!daemonized || filename); - if (logfile && !need_to_open_file) { + if (logfile && (!need_to_open_file || changed_name)) { qatomic_rcu_set(&global_file, NULL); call_rcu(logfile, qemu_logfile_free, rcu); - return; + logfile = NULL; } + if (!logfile && need_to_open_file) { FILE *fd;
Merge the close from the changed_name block with the close from the !need_to_open_file block. Signed-off-by: Richard Henderson <richard.henderson@linaro.org> --- util/log.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-)