From nobody Mon Feb 9 02:15:46 2026 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=1637450039; cv=none; d=zohomail.com; s=zohoarc; b=jHN+zRtZfOSwcYFexOtQksWctm6lLhu9SGUZJJgM+zGsdNmu6aRTahbIT6HQxBxZvh7iEsGMqhD55URQnD/poklRh0ikGfGN0o52Gacsl4L9pSxQ0VCXkWfOcp/8rn66t9wv50mgehwXMnThd/PEekLJCeiaz1bUzr8jiNVtdRM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1637450039; 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=AMpV93v3PMewnmAoO22z0KwJXStWwjnZw+S/yGgY3Hc=; b=BsPSMbNMAsg5CMVzWPhIu/xGyHszUzyAYlYa4Bu608x1+AqjtN5lPnYNJPi9kSmIZ4w8W3kLwmrigCOR++fanQGgrbYq4YJ/rLq4sEgOpXxCMz1Sflm7aTXNpwURMZb0pk+T+GFo7Ru63vCwlCaDncTnT0A4Ju1dt3SBR8elV5g= 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 1637450039922429.93143244659245; Sat, 20 Nov 2021 15:13:59 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-45-_GsyxWNIM7-XDeBwCOMC9A-1; Sat, 20 Nov 2021 18:13:57 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 788E018125C2; Sat, 20 Nov 2021 23:13:52 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 583965C1A1; Sat, 20 Nov 2021 23:13:52 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 298391832E85; Sat, 20 Nov 2021 23:13:52 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1AKNAPmv001756 for ; Sat, 20 Nov 2021 18:10:25 -0500 Received: by smtp.corp.redhat.com (Postfix) id 234F82026D5D; Sat, 20 Nov 2021 23:10:25 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast03.extmail.prod.ext.rdu2.redhat.com [10.11.55.19]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1E3DB2026D48 for ; Sat, 20 Nov 2021 23:10:19 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A7750811E76 for ; Sat, 20 Nov 2021 23:10:19 +0000 (UTC) Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-533-oSLky6pJNDqDIQB47Qud3Q-1; Sat, 20 Nov 2021 18:10:18 -0500 Received: by mail-ed1-f71.google.com with SMTP id m12-20020a056402430c00b003e9f10bbb7dso4069346edc.18 for ; Sat, 20 Nov 2021 15:10:18 -0800 (PST) Received: from carol.localdomain (k8r.cz. [95.82.177.71]) by smtp.gmail.com with ESMTPSA id gn26sm1735271ejc.14.2021.11.20.15.10.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 20 Nov 2021 15:10:16 -0800 (PST) Received: from carol.redhat.com (carol.k8r.cz [IPv6:::1]) by carol.localdomain (Postfix) with ESMTP id 25D09C20040 for ; Sun, 21 Nov 2021 00:10:16 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1637450038; 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=AMpV93v3PMewnmAoO22z0KwJXStWwjnZw+S/yGgY3Hc=; b=IDTvV0ush07zLmbdrSrD6mnzlQ1affN9och/i5DdqN5OUh8PUFHZAjPtFbi7cuWkk2TUf4 7YH+lc38pawF+aYbeVoGLrg2iovuFXfAsWveoQYNxA8rnPDL3lVf76Ocsj+WeDX+GMHIAB 6R6diodCNhucsPghUTqNSuAcmVWChHk= X-MC-Unique: _GsyxWNIM7-XDeBwCOMC9A-1 X-MC-Unique: oSLky6pJNDqDIQB47Qud3Q-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=AMpV93v3PMewnmAoO22z0KwJXStWwjnZw+S/yGgY3Hc=; b=7W7KetiOE0m1je465CjCaOgJa/D4z3QnTvIJ5cHlpuGrZ3Y1DLIh9sCcE2pSJBwxTf N9IH4WWsHABw/fp2vuquOSsA2dr0zvIt2RB8LuuqNLFZ7ulXc9C+VKm6hSpN1o/zdue7 hus97nlDS5WEFzBNCOmNLtPX6qX14e4QPybO5ollASpV2keuZnYWj8q371RidJEPMqVo aFxx9bph7t2DfTMnlod6Gwy3rg+Emr5eVZst7L9r0Xdqk32O0Dv9Y+DNN8cUhjoNwgi+ 8vAx9tl61p7K2q4qMOth03BJCI17tvZbF4iBOCxE4dymfFL7f6sNgIv1xUzCq6XfgRvu cy2w== X-Gm-Message-State: AOAM530b07Bdr5sz55xtHSfrkf7bO/YShMZwF7ttTIjyBs6vkpb4GrW5 a+z9rI50EaL1BwKo3sH6Mo96EJ5cEkC37adKjAg+eG7q3dgdPJbvWP239T3s09qnj3lkEi/b4pY za10k/6VUD30M6MUkPCeDe0EP5wNRWMEDR3lq8lK60CoKZKmXSdvYQzQ/ntCscwQqHTpd2qk= X-Received: by 2002:a17:907:961d:: with SMTP id gb29mr23918905ejc.102.1637449817108; Sat, 20 Nov 2021 15:10:17 -0800 (PST) X-Google-Smtp-Source: ABdhPJxH7p2kRKYFlH5W2X4wGUd+hQOUMsRFkMDIr44VLn1V2PLLAw7E9qLc6cgY9oNm4teO5u+M4Q== X-Received: by 2002:a17:907:961d:: with SMTP id gb29mr23918861ejc.102.1637449816842; Sat, 20 Nov 2021 15:10:16 -0800 (PST) From: Martin Kletzander To: libvir-list@redhat.com Subject: [PATCH 1/7] virsh: Remove needless variable Date: Sun, 21 Nov 2021 00:10:02 +0100 Message-Id: <2d199135785369a174bff4f12a0cf5a20f541861.1637449540.git.mkletzan@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com 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: 1637450041864100003 Content-Type: text/plain; charset="utf-8" It only redundantly reflects whether pkagent !=3D NULL. Signed-off-by: Martin Kletzander Reviewed-by: J=C3=A1n Tomko --- tools/virsh.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tools/virsh.c b/tools/virsh.c index b9f3f851d3ec..da35c5c2b9c1 100644 --- a/tools/virsh.c +++ b/tools/virsh.c @@ -119,7 +119,6 @@ virshConnect(vshControl *ctl, const char *uri, bool rea= donly) bool keepalive_forced =3D false; virPolkitAgent *pkagent =3D NULL; int authfail =3D 0; - bool agentCreated =3D false; =20 if (ctl->keepalive_interval >=3D 0) { interval =3D ctl->keepalive_interval; @@ -141,12 +140,11 @@ virshConnect(vshControl *ctl, const char *uri, bool r= eadonly) goto cleanup; =20 err =3D virGetLastError(); - if (!agentCreated && + if (!pkagent && err && err->domain =3D=3D VIR_FROM_POLKIT && err->code =3D=3D VIR_ERR_AUTH_UNAVAILABLE) { - if (!pkagent && !(pkagent =3D virPolkitAgentCreate())) + if (!(pkagent =3D virPolkitAgentCreate())) goto cleanup; - agentCreated =3D true; } else if (err && err->domain =3D=3D VIR_FROM_POLKIT && err->code =3D=3D VIR_ERR_AUTH_FAILED) { authfail++; --=20 2.34.0