From nobody Wed Dec 17 07:06:06 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1744276967; cv=none; d=zohomail.com; s=zohoarc; b=ZX7C2iCPGDNmwICHAUjRZgR2nQNJWOlKhSN8RgO96e8HNqGI2W1UZ0ylc1lnWG1WXcgmTDmUhrDCfG5DaXTRczfRRc+EEuhGDZ4vhxgmAAKB00o8F8sHdhh2v+oqjHGjWlF9lOqFLed9oXQ9zVdXRP4+Ph5NMYIYiVruh3tD7PE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1744276967; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id:Cc; bh=5TgXYF+lKI8vBBGm5yjppYzh+BMfDVM1RVjKOJtOBuU=; b=F9L0zEpszcK8stGL1UhUgSJQs+avoV1hSDDKexLVqKWGGODEMFH6WpfikJxkDsHB5JhUzNxcsSKfhNAQKUlI1zv2VLc9hNYeKsKAQ3eeT9K7YBFoJ/nOLunLhFLgDKhGakHsptQKONjtZCy5Y+40O0OFRZqKFRr/xUzEpg+UgQU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1744276967255381.41142308840756; Thu, 10 Apr 2025 02:22:47 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 976DD14F8; Thu, 10 Apr 2025 05:22:46 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 442121446; Thu, 10 Apr 2025 05:22:12 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 52593135A; Thu, 10 Apr 2025 05:22:07 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id D15451402 for ; Thu, 10 Apr 2025 05:22:06 -0400 (EDT) Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-191-6hF_-Al7MxSQG1edWFGSEQ-1; Thu, 10 Apr 2025 05:22:04 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 2B72B180AF53 for ; Thu, 10 Apr 2025 09:22:04 +0000 (UTC) Received: from moe.brq.redhat.com (unknown [10.43.3.236]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 87C771828A87 for ; Thu, 10 Apr 2025 09:22:03 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1744276926; h=from:from: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; bh=hgUaZmHE9Y9o8PvSilZFIgyqwxBvVs1BbQm86tQj3Lo=; b=eQ4Ae3F8Vc9Zy4vo6g9l8deat12TXkge3nbW9VeWww7IWk1k7cD/BqZwa9aCP3TPDM58X2 7h1BQ4Do7OdUe2vfoclFPOlnLMylWcNCZduDo42fLCkwTZdlrKBx2LBt+04//bqGGcVms2 ctCQ26lP390dULZztpH1U7sTvG6rXo4= X-MC-Unique: 6hF_-Al7MxSQG1edWFGSEQ-1 X-Mimecast-MFC-AGG-ID: 6hF_-Al7MxSQG1edWFGSEQ_1744276924 To: devel@lists.libvirt.org Subject: [PATCH 1/2] virinhibitor: Suppress reporting an error when D-Bus is unavailable in virInhibitorAcquire() Date: Thu, 10 Apr 2025 11:21:59 +0200 Message-ID: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: uJQontLmsr0tV7rQy-ViftjK0QV9ZQbOXzYjDF68Ofw_1744276924 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: TW3SC45KSI6T7N5YS53J37R4RDSDWWOV X-Message-ID-Hash: TW3SC45KSI6T7N5YS53J37R4RDSDWWOV X-MailFrom: mprivozn@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: From: Michal Privoznik via Devel Reply-To: Michal Privoznik X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1744276969370019000 Content-Type: text/plain; charset="utf-8"; x-default="true" From: Michal Privoznik At the beginning of virInhibitorAcquire() the system D-Bus connection is obtained by calling virGDBusGetSystemBus(). If there's no D-Bus available then an debug message is printed out and function returns early. Problem is, in case of no D-Bus an error message was reported by virGDBusGetSystemBus() and thus logs were polluted which may mislead users. Just check whether D-Bus is available first (by calling virGDBusHasSystemBus()). If it is then virGDBusGetSystemBus() should return a valid connection. Nevertheless, respect previous logic and don't propagate error to the caller, just return 0. Resolves: https://issues.redhat.com/browse/RHEL-79088 Signed-off-by: Michal Privoznik Reviewed-by: Jiri Denemark --- src/util/virinhibitor.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/util/virinhibitor.c b/src/util/virinhibitor.c index a95021de5a..6796938936 100644 --- a/src/util/virinhibitor.c +++ b/src/util/virinhibitor.c @@ -70,11 +70,14 @@ virInhibitorAcquire(const char *what, VIR_DEBUG("what=3D%s who=3D%s why=3D%s mode=3D%s", NULLSTR(what), NULLSTR(who), NULLSTR(why), NULLSTR(mode)); =20 - if (!(systemBus =3D virGDBusGetSystemBus())) { + if (!virGDBusHasSystemBus()) { VIR_DEBUG("system dbus not available, skipping system inhibitor"); return 0; } =20 + if (!(systemBus =3D virGDBusGetSystemBus())) + return 0; + if (virSystemdHasLogind() < 0) { VIR_DEBUG("logind not available, skipping system inhibitor"); return 0; --=20 2.49.0 From nobody Wed Dec 17 07:06:06 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1744276982; cv=none; d=zohomail.com; s=zohoarc; b=N4vQkdB1OkWZpWow+TNHMUVVtnfcP3xRTYNCasADQ6pzb1EkSfhhzx/dMslxmDM8KBuPWHIXqYmZg38X2ipYpHWzC8QRBQv+iQZ7wLVUN1B5/tL1xPFQTfimNYU+CR9nozF1TOnkOmojHz5je/s0PMoRU3gH9eunW8PLAeLzXYI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1744276982; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id:Cc; bh=8VgChVcRjlX91gR0PWF47GRIhek2Jm2F2VAQ3TZz/5c=; b=AzuQLDrYP06j06VNJ8rVFIo44UrWES/Wp3dhPfTCN4DbexEqZuLltfjETiVYPmeB6YzZEEtw0w7Ua/9lcXsA5gVFUpJ18Fgoh9mZjDKYwI97IQWXBpdPr66h7g8kZdi1hcdGTaF57i1mWdHSY+O0dbIDXhdxzj1YXRzLDje42Gw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 174427698252023.7266379176383; Thu, 10 Apr 2025 02:23:02 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id EF0C11504; Thu, 10 Apr 2025 05:23:01 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id BDD4F1710; Thu, 10 Apr 2025 05:22:15 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id E938B1402; Thu, 10 Apr 2025 05:22:07 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 8D915135A for ; Thu, 10 Apr 2025 05:22:07 -0400 (EDT) Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-653-uxnm388zO7Sz8ub2Np7i7g-1; Thu, 10 Apr 2025 05:22:05 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 2B1A4180899B for ; Thu, 10 Apr 2025 09:22:05 +0000 (UTC) Received: from moe.brq.redhat.com (unknown [10.43.3.236]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 86E7A1828A95 for ; Thu, 10 Apr 2025 09:22:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1744276927; h=from:from: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; bh=vxwVYb7pQPKoQaNa+xRFJikLHz+B8+gBvZuPPrYFd6E=; b=a56BhglHw3Epxzfof5L0PkRBjUdaE36yA+hRfbHhgxHGRKaN6VQAeVenXLBJGTm3qZN+v5 A3SZ/Irc0F6ZYObp+G0AYCo7wy+KkE+lxGzdiKXqOeYrPCQdK0OOgGqI50ALC1XH6dHHNn Zoj3cOsbPX/d4qR5cfa3DQDicSdDFd8= X-MC-Unique: uxnm388zO7Sz8ub2Np7i7g-1 X-Mimecast-MFC-AGG-ID: uxnm388zO7Sz8ub2Np7i7g_1744276925 To: devel@lists.libvirt.org Subject: [PATCH 2/2] network: Suppress reporting an error when D-Bus is unavailable in networkStateInitialize() Date: Thu, 10 Apr 2025 11:22:00 +0200 Message-ID: <75ad4e3a7b4ff9c3b23a1f752fb4843d2426a899.1744276808.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: c3XYrcrbfE8MJaNtHgUDntPa_pKEcLuGjyLT3BEd-Sw_1744276925 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: 4MGLXTWE6DWBHSCTBYUI4U5VETHQZ65R X-Message-ID-Hash: 4MGLXTWE6DWBHSCTBYUI4U5VETHQZ65R X-MailFrom: mprivozn@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: From: Michal Privoznik via Devel Reply-To: Michal Privoznik X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1744276982815019000 Content-Type: text/plain; charset="utf-8"; x-default="true" From: Michal Privoznik When the network driver initializes itself, it tries to subscribe to signals from Firewalld sent over system D-Bus. Well, the code is written in best effort mode, i.e. lack of D-Bus is not considered an error. Problem is, virGDBusGetSystemBus() which is used to obtain system D-Bus prints out an error in case of lacking system D-Bus. This pollutes the logs (which may mislead users) and goes against the best-effort nature of aforementioned code. Check for the system D-Bus presence via virGDBusHasSystemBus() first. Signed-off-by: Michal Privoznik Reviewed-by: Jiri Denemark --- src/network/bridge_driver.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c index 2cad1c8cbe..34b655e816 100644 --- a/src/network/bridge_driver.c +++ b/src/network/bridge_driver.c @@ -710,7 +710,8 @@ networkStateInitialize(bool privileged, network_driver->networkEventState =3D virObjectEventStateNew(); =20 #ifdef WITH_FIREWALLD - if (!(sysbus =3D virGDBusGetSystemBus())) { + if (!virGDBusHasSystemBus() || + !(sysbus =3D virGDBusGetSystemBus())) { VIR_WARN("DBus not available, disabling firewalld support " "in bridge_network_driver: %s", virGetLastErrorMessage()); } else { --=20 2.49.0