From patchwork Wed Apr 20 18:06:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 564005 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:6886:0:0:0:0 with SMTP id m6csp4419743map; Wed, 20 Apr 2022 11:37:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzuDibCbipHCFEBYgiaoMNIyoZbYYg6OCkjZpqorG462N6UlY/h+STg3kbdMt3mgfuwG/eE X-Received: by 2002:a25:404c:0:b0:641:d636:1610 with SMTP id n73-20020a25404c000000b00641d6361610mr21401820yba.209.1650479854981; Wed, 20 Apr 2022 11:37:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650479854; cv=none; d=google.com; s=arc-20160816; b=JA0VxVcbJnbFakdPNDqE6WY51zNB8rBdrncnseWUbVzlwIPg9nNh2V1HAeIc3yR/2h MRWXeQRL+xgL17VuRoQD3hMNHfCXwKq9PgLJsevnf5FNTDQ46Oqwpw6gOYW2yb3veUNm erYoizTf5pM4tajASAvq8+hw0yTryYva+wEcLYuFhipkoL6qcLlYWJ/rrgCrPiItJgt1 pW714et/2dNZ4IODViVPq0fU18bO693I0QHlC/yBAvH5L1a/Gvi24ZPIs3D6z1XFdsUQ sMpy60Qp21QpOIKRN5dHyjU8DiMEwSB55LP5eMvn/iJ22f2IAl0c4oALeky2ZZatK124 SKyg== 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=/s0wl9WGt9PyoXN9DcmhdMDO6XLUI9CxJxFlhTlZYAE=; b=sH7Awadkd1CP+W9dQJMszt+lpTj3Ka1kteqb7RfHtZqzj9BFcALMZh/5wwuMy+4CkB zkHocncWynDx58IDqnv4wLL4I+I6eOeHZSkvsV19yiK4QLeKAwGs+GDD+QQALSwltlGe Shp2IRSEnoIAMy49qqMJCvkw0FMP47g7Ywl4rCS9++6/JOnIqFMw1aVple0bCq9PcBwj 4Xxmm3nsNecm4e02Qfi3sMNSjGzw7PxWvSRlJG5Jdq9sEBQRCr3567NZUFlwny3qbTOa q4hUlXSQZa4u175jdt476GuKGoeinzSBukFxXpChbyP+nPblF3pwM1Fbigxa9SkdXhfR aw0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=sOZrUBeq; 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 67-20020a810346000000b002ec27f6d9d8si595369ywd.238.2022.04.20.11.37.34 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 20 Apr 2022 11:37:34 -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=sOZrUBeq; 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]:53992 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nhFCo-0000fT-Ge for patch@linaro.org; Wed, 20 Apr 2022 14:37:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53574) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhEj8-0006Ko-1K for qemu-devel@nongnu.org; Wed, 20 Apr 2022 14:06:54 -0400 Received: from mail-pg1-x52f.google.com ([2607:f8b0:4864:20::52f]:34771) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nhEj6-0001Mr-FX for qemu-devel@nongnu.org; Wed, 20 Apr 2022 14:06:53 -0400 Received: by mail-pg1-x52f.google.com with SMTP id t4so2342787pgc.1 for ; Wed, 20 Apr 2022 11:06:52 -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=/s0wl9WGt9PyoXN9DcmhdMDO6XLUI9CxJxFlhTlZYAE=; b=sOZrUBeqcmKoLsRnM3X8fvRQP7TiplfcXZ5+qZ+V/7QX3LAu6pQtDRepwsoOG3Zjuz iiefIFsUD2vtOY2Z4hVJsUQEpE6kjN86pPJFlGQabWs6F7hVmhinZbmLZ4mav3Qqda+D roBl5aVQgmWNMWxh0ZOMXBjghRVV/K5ihSY0l1lEpNHKpBDXPHv/7Q2wWXfyA3+ET1nc IT7BeRPcA3Omb/rWl501tfq3JZKAfcbbxIrcX9nYc8jQ/w2S4wsitF1JlrT0tI05o0JM 3s3KHzlhfWiPxysvf9CNjSPw8XKueNWS9KAXnwcxBjuhSu3ReYg+6O0US+kJANT+hdU7 8+Ww== 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=/s0wl9WGt9PyoXN9DcmhdMDO6XLUI9CxJxFlhTlZYAE=; b=c1ng0Pe2zVCuPHx+mowDolMsYbT5OTCxBMa5BUokyrHcVwoH5y13Hs3EMtRMcT8092 HjUkJVELGvbeCBy7pEWG43jDLEcjqnTSD1GNdx8ao3iI2iuuyGO6Vs2CmOPfmxnMh7HJ jJRQ8PRO9k6uxfvcohaC+knqexV893pzXantCxinP52tjriq+4UMLZPSljauJBfRo3np UXzkaVZwDMXzCbQqSNK96txk3FStjJUtaA4N6hQdziDbGYadtVcZxzG+Ld9CVMR5h3EX hHvTfPugZBM3UcxJGDOqqWnkSGVr9k39U5f12LxtFdcQ+SIq8XdG/VXNvtRhQwAEIyyv XlYQ== X-Gm-Message-State: AOAM531mzau4U8nYlQ56AdfP54tvwKyd+plkN6Zmg0a2WUi9qXLf60tb NlLiwR46HGehRnt/b2ylbsM3V3K7VGMvkg== X-Received: by 2002:a63:6fc4:0:b0:393:9567:16dc with SMTP id k187-20020a636fc4000000b00393956716dcmr20043211pgc.593.1650478010992; Wed, 20 Apr 2022 11:06:50 -0700 (PDT) Received: from stoup.. (174-21-142-130.tukw.qwest.net. [174.21.142.130]) by smtp.gmail.com with ESMTPSA id i2-20020a17090a058200b001d2fc489b8asm56681pji.25.2022.04.20.11.06.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Apr 2022 11:06:50 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 30/39] softmmu: Use qemu_set_log_filename_flags Date: Wed, 20 Apr 2022 11:06:09 -0700 Message-Id: <20220420180618.1183855-31-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220420180618.1183855-1-richard.henderson@linaro.org> References: <20220420180618.1183855-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::52f; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x52f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham 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: =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Perform all logfile setup at startup in one step. Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson Message-Id: <20220417183019.755276-31-richard.henderson@linaro.org> --- softmmu/vl.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/softmmu/vl.c b/softmmu/vl.c index fe9de2f896..f679d48d74 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -2560,19 +2560,16 @@ static void qemu_process_early_options(void) #endif /* Open the logfile at this point and set the log mask if necessary. */ - if (log_file) { - qemu_set_log_filename(log_file, &error_fatal); - } - if (log_mask) { - int mask; - mask = qemu_str_to_log_mask(log_mask); - if (!mask) { - qemu_print_log_usage(stdout); - exit(1); + { + int mask = 0; + if (log_mask) { + mask = qemu_str_to_log_mask(log_mask); + if (!mask) { + qemu_print_log_usage(stdout); + exit(1); + } } - qemu_set_log(mask, &error_fatal); - } else { - qemu_set_log(0, &error_fatal); + qemu_set_log_filename_flags(log_file, mask, &error_fatal); } qemu_add_default_firmwarepath();