From nobody Sun Dec 22 01:49:01 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1685027894; cv=none; d=zohomail.com; s=zohoarc; b=a0rjth1UTkn6EBO01XvXMwQOwfenCDnIYZGOY3OOsNYo1YkUOiaR4q8PIi5Z5uyNLFIdx6GeuUlWDnnjuCfrlaTEF3TZYgZBW+0fXUvXVPvSRn7Od+ndK4Cp9tc8G2pySKBK1yP5psyt0c9gAldtyKSwWitVBSjWL4i94QEEN6c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1685027894; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=qZRAAdZ+LLpMa2EZVicg7FCW4nfIdMcm/lzrmpiTbMM=; b=eg77ON3aITMy0YEHiXKN3hse3gX3M8mHxfWJD5oyaRY9x/yV9TKGfq7X3rflQ4tUAB5akVYQjEYf7j7qqW4TMb0h5d//jUNAngpVFpZneNvgMdMhNr35i+gjmWkHAShPsyMye60zDergZVcJylG8qGMCXYuX/PM1ZMeg6C+OVRE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1685027894273727.344245011683; Thu, 25 May 2023 08:18:14 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-480-04CoILGLPKuyjtIeE1D_HQ-1; Thu, 25 May 2023 11:15:54 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B6D2D1012BA3; Thu, 25 May 2023 15:15:30 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id A125B2023452; Thu, 25 May 2023 15:15:30 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 1876219465BA; Thu, 25 May 2023 15:15:30 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id CE50819465B3 for ; Thu, 25 May 2023 15:13:49 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id E485940140A; Thu, 25 May 2023 15:13:49 +0000 (UTC) Received: from speedmetal.lan (unknown [10.45.242.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6AC7A401026 for ; Thu, 25 May 2023 15:13:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1685027893; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=qZRAAdZ+LLpMa2EZVicg7FCW4nfIdMcm/lzrmpiTbMM=; b=Qc1fSzzmnOPK86zS9pD/+u+rvCjyrTiH1Y+iXzEt0ppoc2GZMikrrDI63YV7EtOViZ+csv LnP2f6CeUNbJHxTcI1PzG5VwBfw3hBN0LEv6GPfX8xn8ZWYZgeslvbXb8pbfsFqluH5IVD 3F1eeaxW0YtY3EnwY12opYyo6ttcCYw= X-MC-Unique: 04CoILGLPKuyjtIeE1D_HQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 03/18] virRaiseErrorLog: Don't skip error printing when enabling debug logging env variable Date: Thu, 25 May 2023 17:13:30 +0200 Message-Id: <717f7bd450f1dbe6f1284fc4afdd73de8638ce8e.1685027511.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1685027895046100001 Content-Type: text/plain; charset="utf-8" When a user requests debug logging by setting the environment variable: LIBVIRT_DEBUG=3D1 we should log any errors regardless of the setting of e.g. 'LIBVIRT_LOG_OUTPUTS' as the code will log every 'debug' and 'info' level message to stderr but will skip 'error' level messages. This obviously makes debugging things very complicated as you can get to a situation when the error itself is missing. This can happen e.g. in tests. Fix the issue by probing the default log level and calling the logger if it's set for VIR_LOG_DEBUG. Signed-off-by: Peter Krempa --- src/util/virerror.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/util/virerror.c b/src/util/virerror.c index 0bfa803b1f..453f19514e 100644 --- a/src/util/virerror.c +++ b/src/util/virerror.c @@ -775,9 +775,11 @@ void virRaiseErrorLog(const char *filename, * hate & thus disable that too. If the daemon has set * a priority filter though, we should always forward * all errors to the logging code. + * Similarly when debug priority is the default we want to log the err= or. */ if (virLogGetNbOutputs() > 0 || - virErrorLogPriorityFilter) + virErrorLogPriorityFilter || + virLogGetDefaultPriority() =3D=3D VIR_LOG_DEBUG) virLogMessage(&virLogSelf, priority, filename, linenr, funcname, --=20 2.40.1