From nobody Thu Nov 26 12:09:09 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 38.145.34.151 as permitted sender) client-ip=38.145.34.151; 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 38.145.34.151 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=1789663518; cv=none; d=zohomail.com; s=zohoarc; b=I2fgBBLCicvvvfJQs2GjNWfQzeujEPvnOV/tObpngBt8NcIwmSpIX25NnhypQD2c6PWtmNox9FfjTPpadKnSeOjaJCx0NLM1MH82vGi0LKFnkxQ16kDGMkiP2dmh9xuycyRb3iQH4NSNkIF+D6RGSUwUob1kiAWxcrz84P4fgew= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1789663518; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:Subject:Subject:To:To:Message-Id:Cc; bh=4HO1sFnWoKXP3b2KXMidLWtO3yXPUEfAg0i2lAN0Xh8=; b=FgZtCrbuy+1z01PLe3ouo3tK7tf6HhFL1buEJq0rCixC7Fi5H6d2uI/1QMqFSUwg85f6rJDGIKdxSoD8XBqQUAfNKLgEtgAfZ/Hwal99Qsnc5aMBo7hEj5EoNhou2bnk+7a9MH2FSHkc5fls6V+sa5flWa2mU8CgBbwUYb0DBjk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 38.145.34.151 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 [38.145.34.151]) by mx.zohomail.com with SMTPS id 1789663518256498.9053762026115; Thu, 17 Sep 2026 09:45:18 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 993) id A669A3F390; Thu, 17 Sep 2026 12:45:16 -0400 (EDT) Received: from [172.19.199.13] (unknown [10.16.107.18]) by lists.libvirt.org (Postfix) with ESMTP id 35B5A4190C for ; Thu, 17 Sep 2026 12:44:12 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 993) id 7E5BA3F28B; Thu, 17 Sep 2026 12:44:02 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (3072 bits) server-digest SHA256) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 05DB23F2E6 for ; Thu, 17 Sep 2026 12:44:00 -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-659-LH546fo-MmGdYLSD6cVIlQ-1; Thu, 17 Sep 2026 12:43:58 -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 3E2571912C7A for ; Thu, 17 Sep 2026 16:43:57 +0000 (UTC) Received: from speedmetal.openshiftapps.com (unknown [10.44.22.10]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 362831800586 for ; Thu, 17 Sep 2026 16:43:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=4.0.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1789663440; 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; bh=4HO1sFnWoKXP3b2KXMidLWtO3yXPUEfAg0i2lAN0Xh8=; b=FIFsiaNDWCK/fsBxHsRUdrxYyPqkC/iIYtxTZn/wLrYueuoQX7FVI2V+w1PRtbIf9F0Tq6 ogV6w4cnlQOrBS2ejxrx+aKzgL9+bzUznG1Ee1rd41Sah8J7fnUVW/Yd3u4B4hNFDsbr/R OTedG9WqCXmGsmzq/+0vnLVrG/wKPuE= X-MC-Unique: LH546fo-MmGdYLSD6cVIlQ-1 X-Mimecast-MFC-AGG-ID: LH546fo-MmGdYLSD6cVIlQ_1789663437 To: devel@lists.libvirt.org Subject: [PATCH] vsh: Remove 'disconnected' set-only global variable Date: Thu, 17 Sep 2026 18:43:54 +0200 Message-ID: <1ed9be834e3bcf97bfcb8205749ef2742b12413a.1789663434.git.pkrempa@redhat.com> 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: b7QuiDoPK1pHBtREtKbtGMPjn26c9lCTlmJmqRQ23tU_1789663437 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: WUOSA4FKDLHUHVVR4QTR743IZIHT7HLY X-Message-ID-Hash: WUOSA4FKDLHUHVVR4QTR743IZIHT7HLY X-MailFrom: pkrempa@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-devel.lists.libvirt.org-0; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Peter Krempa via Devel Reply-To: Peter Krempa X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1789663522937158500 Content-Type: text/plain; charset="utf-8" From: Peter Krempa The instance of the 'disconnected' global variable in vsh.c is written-only, so can be removed. Caught by new clang: clang -Itools/libvirt_shell.a.p -Itools -I../tools -Iinclude -I../include = -Isrc -I../src -Isrc/util -I../src/util -I. -I.. -I/usr/include/libxml2 -I/= usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/sysprof-6= -I/usr/include/gio-unix-2.0 -I/usr/include/libmount -I/usr/include/blkid -= fdiagnostics-color=3Dalways -D_FILE_OFFSET_BITS=3D64 -Wall -Winvalid-pch -W= extra -std=3Dgnu99 -O2 -g @/builds/libvirt/libvirt/build/c-warnings.txt -fP= IC -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=3D600 -D_FUNCTION_DEF -pthread -DWITH_= GZFILEOP -MD -MQ tools/libvirt_shell.a.p/vsh.c.o -MF tools/libvirt_shell.a.= p/vsh.c.o.d -o tools/libvirt_shell.a.p/vsh.c.o -c ../tools/vsh.c ../tools/vsh.c:242:12: error: variable 'disconnected' set but not used [-We= rror,-Wunused-but-set-global] 242 | static int disconnected; /* we may have been disconnected */ | ^ 1 error generated. This instance exists since the 'vsh' module was split (834c5720e44). 'virsh' contains it's own instance. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- tools/vsh.c | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/tools/vsh.c b/tools/vsh.c index 667cc1a0d2..d1540810ee 100644 --- a/tools/vsh.c +++ b/tools/vsh.c @@ -236,12 +236,6 @@ vshReportError(vshControl *ctl) vshResetLibvirtError(); } -/* - * Detection of disconnections and automatic reconnection support - */ -static int disconnected; /* we may have been disconnected */ - - /* vshCmddefSearch: * @cmdname: name of command to find * @@ -1392,16 +1386,6 @@ vshCommandRun(vshControl *ctl, after =3D g_get_real_time(); - /* try to automatically catch disconnections */ - if (ret !=3D EXIT_SUCCESS && - ((last_error !=3D NULL) && - (((last_error->code =3D=3D VIR_ERR_SYSTEM_ERROR) && - (last_error->domain =3D=3D VIR_FROM_REMOTE)) || - (last_error->code =3D=3D VIR_ERR_RPC) || - (last_error->code =3D=3D VIR_ERR_NO_CONNECT) || - (last_error->code =3D=3D VIR_ERR_INVALID_CONN)))) - disconnected++; - if (ret !=3D EXIT_SUCCESS) vshReportError(ctl); --=20 2.55.0