From nobody Tue Sep 9 19:10:18 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=1747638436; cv=none; d=zohomail.com; s=zohoarc; b=TiabUmhtDdpOd+mEF6j6WKGEA+hUzQ9by6DSYUn4A4EiOUFst8A0A5Qi/n4umdbFnLu2qxl2ueDkm2fnqj3+H3n19V3NnUVecJRT097rDnybDV2TwDwYFE+THVWWfTHDY0XrTW41pXEgG0ZkgsRlpnBhYcs+ebNZ4MpI3Wik8Pg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1747638436; h=Content-Transfer-Encoding:Cc:Cc: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; bh=cOFqhJHddNWbieRsUX7jR6u0hloHSfmjBNSdxUVAwac=; b=PQ5FRt4s5H3sIksFXo43lj8YbPoZPxwCpMdgK75uOdzpcAL4VLlaOW0iLhb5XS+Amw7GH3tDxoaoLmVQplL/nRFvE5QwFCfbzhPLvUyxN5cvtU8LplPIO/Q3Iz6ATA0n3YjVmgNPaq1t5mS7zrjB3Ru0sJYIVM9toaQNejstSZk= 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 1747638436960506.485506611828; Mon, 19 May 2025 00:07:16 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 03FCA15EC; Mon, 19 May 2025 03:07:16 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id CF1E915B4; Mon, 19 May 2025 03:06:23 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 1FFBD13A7; Sat, 17 May 2025 12:33:11 -0400 (EDT) Received: from mr3.vodafonemail.de (mr3.vodafonemail.de [145.253.228.163]) (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 53DFC14B6 for ; Sat, 17 May 2025 12:33:10 -0400 (EDT) Received: from smtp.vodafone.de (unknown [10.0.0.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by mr3.vodafonemail.de (Postfix) with ESMTPS id 4b08dJ6hM2z2Fvg; Sat, 17 May 2025 16:33:08 +0000 (UTC) Received: from sappc2.fritz.box (port-92-196-200-89.dynamic.as20676.net [92.196.200.89]) (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 smtp.vodafone.de (Postfix) with ESMTPSA id 4b08d63Gd7z90qx; Sat, 17 May 2025 16:32:55 +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=-1.5 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW,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=vodafonemail.de; s=vfde-mb-mr2-23sep; t=1747499589; bh=N+iosMHcDD3twQnh7BA6JaYq+RvDGy42cDLJzEobwu0=; h=From:To:Subject:Date:Message-Id:X-Mailer:In-Reply-To:References: From; b=Iv6vObJFeFxb7uHiGuHnynRvwzNMTUzLGdiDQqMNM1FGMCNtKxpJhCgxEyXAL2zNO tRFP9BjtQCIi7ApY6jmeRb5Cl2prVjegH01lrfC7sneV99KM8cBOlS2lUR6dVbZJKz 3J4UNa/L3UX9K2IJAyfgnER0IAQ/iyffPYxg64aA= To: devel@lists.libvirt.org Subject: [PATCHv2 1/2] virsh: Add option '--no-pkttyagent' Date: Sat, 17 May 2025 18:32:16 +0200 Message-Id: <20250517163217.264674-2-farblos@vodafonemail.de> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250517163217.264674-1-farblos@vodafonemail.de> References: <20250517163217.264674-1-farblos@vodafonemail.de> MIME-Version: 1.0 X-purgate-server: smtpa07 X-purgate-type: clean X-purgate: clean X-purgate-size: 3634 X-purgate-ID: 155817::1747499584-FED2D28F-1DFF2F55/0/0 Content-Transfer-Encoding: quoted-printable X-MailFrom: farblos@vodafonemail.de X-Mailman-Rule-Hits: nonmember-moderation 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 Message-ID-Hash: 4OX26AC64KUZRVDVCUMJILIJKNSXGEBW X-Message-ID-Hash: 4OX26AC64KUZRVDVCUMJILIJKNSXGEBW X-Mailman-Approved-At: Mon, 19 May 2025 07:06:20 -0400 CC: Jens Schmidt , Peter Krempa 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: Jens Schmidt via Devel Reply-To: Jens Schmidt X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1747638438738116600 Content-Type: text/plain; charset="utf-8" From: Jens Schmidt In scripts repeated execution of virsh can result in a lot of journal noise when pkttyagent gets registered with polkitd each time. Closes: https://gitlab.com/libvirt/libvirt/-/issues/757 Signed-off-by: Jens Schmidt Reviewed-by: Peter Krempa --- docs/manpages/virsh.rst | 8 ++++++++ tools/virsh.c | 13 ++++++++++++- tools/vsh.h | 1 + 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/docs/manpages/virsh.rst b/docs/manpages/virsh.rst index 0a54f6deff..3a00778467 100644 --- a/docs/manpages/virsh.rst +++ b/docs/manpages/virsh.rst @@ -140,6 +140,14 @@ Output elapsed time information for each command. =20 =20 =20 +- ``--no-pkttyagent`` + +Do not register ``pkttyagent`` as authentication agent with the +polkit system daemon, even if ``virsh`` has been started from a +terminal. + + + - ``-v``, ``--version[=3Dshort]`` =20 Ignore all other arguments, and prints the version of the libvirt library diff --git a/tools/virsh.c b/tools/virsh.c index 800e280c7a..c893216637 100644 --- a/tools/virsh.c +++ b/tools/virsh.c @@ -117,7 +117,8 @@ virshConnect(vshControl *ctl, const char *uri, bool rea= donly) keepalive_forced =3D true; } =20 - if (virPolkitAgentAvailable() && + if (!ctl->no_pkttyagent && + virPolkitAgentAvailable() && !(pkagent =3D virPolkitAgentCreate())) virResetLastError(); =20 @@ -446,6 +447,7 @@ virshUsage(void) " -q | --quiet quiet mode\n" " -r | --readonly connect readonly\n" " -t | --timing print timing informatio= n\n" + " --no-pkttyagent suppress registration o= f pkttyagent\n" " -v short version\n" " -V long version\n" " --version[=3DTYPE] version, TYPE is shor= t or long (default short)\n" @@ -642,6 +644,7 @@ virshParseArgv(vshControl *ctl, int argc, char **argv) { "quiet", no_argument, NULL, 'q' }, { "readonly", no_argument, NULL, 'r' }, { "timing", no_argument, NULL, 't' }, + { "no-pkttyagent", no_argument, NULL, 0 }, { "version", optional_argument, NULL, 'v' }, { NULL, 0, NULL, 0 }, }; @@ -739,6 +742,14 @@ virshParseArgv(vshControl *ctl, int argc, char **argv) case 'V': virshShowVersion(ctl); exit(EXIT_SUCCESS); + case 0: + if (STREQ(opt[longindex].name, "no-pkttyagent")) { + ctl->no_pkttyagent =3D true; + break; + } else { + vshError(ctl, "%s", _("unknown option")); + exit(EXIT_FAILURE); + } case ':': for (i =3D 0; opt[i].name !=3D NULL; i++) { if (opt[i].val =3D=3D optopt) diff --git a/tools/vsh.h b/tools/vsh.h index 8b87c00ff4..3b75216e11 100644 --- a/tools/vsh.h +++ b/tools/vsh.h @@ -200,6 +200,7 @@ struct _vshControl { bool imode; /* interactive mode? */ bool quiet; /* quiet mode */ bool timing; /* print timing info? */ + bool no_pkttyagent; /* suppress registration of pkttyagent? */ int debug; /* print debug messages? */ char *logfile; /* log file name */ int log_fd; /* log file descriptor */ --=20 2.39.5 From nobody Tue Sep 9 19:10:18 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=1747638453; cv=none; d=zohomail.com; s=zohoarc; b=UlBRs4fY+2MufD98urnc5ewbuIL/51amZdmeHwKCNRsSpC1qBhJ3cXUUN2/NVRCdTFF85QvS1mjdvt78StOEyfsUrDBs8aGvz2tvqd4McL/njoECnFrdS9DTnrriotnLb6IIql8UY/hZ+xVBSYyiLPpkxqOXuVvmw/wqYlmSV/s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1747638453; h=Content-Transfer-Encoding:Cc:Cc: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; bh=yOjxylPvQTteU4R/Jah0dmjLOfPgohwUgmolJC43prs=; b=loFNdhtVWY1e3edP3H+ptNRk6rG2kBQLv1shM96sIcWZ1mP4j55TdhFJ/HOivC7q6uT7YBR50e2VrT07qgxdvRdMFbSQJYt1Hsf9XyKEabpo3tVh1zENjMFwqL3SoRQ/t+iNjwZ7ZMQDAJzOajPWjfEICBpEcXADhepc9xm1WRA= 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 174763845335223.261912651482817; Mon, 19 May 2025 00:07:33 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 74C4D1568; Mon, 19 May 2025 03:07:32 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 3325016F4; Mon, 19 May 2025 03:06:25 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 1AE8114C1; Sat, 17 May 2025 12:33:28 -0400 (EDT) Received: from mr3.vodafonemail.de (mr3.vodafonemail.de [145.253.228.163]) (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 780E313A7 for ; Sat, 17 May 2025 12:33:27 -0400 (EDT) Received: from smtp.vodafone.de (unknown [10.0.0.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by mr3.vodafonemail.de (Postfix) with ESMTPS id 4b08df53Cmz2GM9; Sat, 17 May 2025 16:33:26 +0000 (UTC) Received: from sappc2.fritz.box (port-92-196-200-89.dynamic.as20676.net [92.196.200.89]) (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 smtp.vodafone.de (Postfix) with ESMTPSA id 4b08dS1Q2mz90qx; Sat, 17 May 2025 16:33:13 +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=-1.5 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW,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=vodafonemail.de; s=vfde-mb-mr2-23sep; t=1747499606; bh=Qs/C/L3uGbEnJIFdap868uaffJTuo9ps+NiNiMlQFHk=; h=From:To:Subject:Date:Message-Id:X-Mailer:In-Reply-To:References: From; b=gFXPIwBXVhcrELfUhIaAY12PIXGU+Lv+lHIhvDE86aw/5eyG5KHplszrERVb+CEnE 4sCgUiK8euC+U4SzSzZ7yxCuBGArAUHTS8JrdirfAQqGqfu/MMbm6+9auzbZ/XYfBu 5PQFRG8UzxgLXbnfIsN5QbU/Hrym86yi9bj5JVkg= To: devel@lists.libvirt.org Subject: [PATCHv2 2/2] NEWS: Mention new option '--no-pkttyagent' Date: Sat, 17 May 2025 18:32:17 +0200 Message-Id: <20250517163217.264674-3-farblos@vodafonemail.de> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250517163217.264674-1-farblos@vodafonemail.de> References: <20250517163217.264674-1-farblos@vodafonemail.de> MIME-Version: 1.0 X-purgate-server: smtpa07 X-purgate-type: clean X-purgate: clean X-purgate-size: 560 X-purgate-ID: 155817::1747499602-FED2D28F-D259ADE4/0/0 Content-Transfer-Encoding: quoted-printable X-MailFrom: farblos@vodafonemail.de X-Mailman-Rule-Hits: nonmember-moderation 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 Message-ID-Hash: MZWNU3UB2RA7GYI2WTC32WLK5KHJFULP X-Message-ID-Hash: MZWNU3UB2RA7GYI2WTC32WLK5KHJFULP X-Mailman-Approved-At: Mon, 19 May 2025 07:06:22 -0400 CC: Jens Schmidt , Peter Krempa 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: Jens Schmidt via Devel Reply-To: Jens Schmidt X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1747638454441116600 Content-Type: text/plain; charset="utf-8" From: Jens Schmidt Signed-off-by: Jens Schmidt Reviewed-by: Peter Krempa --- NEWS.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/NEWS.rst b/NEWS.rst index 0da3bf4d79..d12d473ceb 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -17,6 +17,10 @@ v11.4.0 (unreleased) =20 * **New features** =20 + * virsh: Add option ``--no-pkttyagent`` + + That option suppresses registration of pkttyagent with polkitd. + * **Improvements** =20 * **Bug fixes** --=20 2.39.5