From nobody Mon Feb 9 06:34:03 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=1662724754; cv=none; d=zohomail.com; s=zohoarc; b=NguBxhWQUJEA4ZrtKeNKAb8vgz1sdJW59unJp+jYtzYAlJTbWVCd1GFmPtfXVglDwH7Q0522CVvTeNsQS2QtlegPpDSatZwJOpK7hi/9XLrJh+US5Oj5AEviLvD4mnkzVatVMadaOvmo+MgkjjLLGLM+ry3yu5/DyeNCdn+60Zg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1662724754; 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=02AwTtRYuY8iieRmb+bsVRYpJzRFt+pRcD4FHguLyUU=; b=E42Amsl20jR2ls4/3ajYFQ1coCukM7mf70PsPQe3uKUcu+myojCfKXu1cjbatHsYPAo8iQ/bM7ZsCoVJHeCy41g6A6Dykn30lF0qcfSbb/ZHWkGJNO4g8RDJ25uYOJtjgnik8h7Vc0WB/yTS+yIIEZDxGxZqtwOUIjrzA3u6LnI= 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 1662724754913737.1181596769114; Fri, 9 Sep 2022 04:59: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-618-RveGjlE9PjOzq_w7Liw1YQ-1; Fri, 09 Sep 2022 07:58:29 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 597B5823F18; Fri, 9 Sep 2022 11:58:27 +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 47A6AC15BB3; Fri, 9 Sep 2022 11:58:27 +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 320BD1946A42; Fri, 9 Sep 2022 11:58:27 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id AC3A81946A41 for ; Fri, 9 Sep 2022 11:58:24 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 9E4622166B29; Fri, 9 Sep 2022 11:58:24 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id 190B62166B26 for ; Fri, 9 Sep 2022 11:58:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1662724753; 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=02AwTtRYuY8iieRmb+bsVRYpJzRFt+pRcD4FHguLyUU=; b=Z4XzOWgMugKpo3llXmEvknOsejAdoQ8qmAPyUf9EyrgrJrkCmWOlBhEUww81D+CvaxWBl/ RrfXF1ph8B8jxsWysDySBfFyYmRlPMXRWJaL0sgg0eoJLEtxYYtnPLXkjZjRQWZceQc+zF aGD7uQ416iGxk/Xq0D2hSgZOx12uT+E= X-MC-Unique: RveGjlE9PjOzq_w7Liw1YQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH v2 4/9] remote: remoteOpenConn: Use virConnectOpenAuth instead of virConnectOpen(ReadOnly) Date: Fri, 9 Sep 2022 13:58:14 +0200 Message-Id: <0d756470786c4a9a4f0da185d5a8b83f08c4bf3f.1662723003.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 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 2.85 on 10.11.54.8 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: 1662724756059100003 Content-Type: text/plain; charset="utf-8" virConnectOpenAuth provides an unified interface with using 'flags' to select the proper mode. Signed-off-by: Peter Krempa --- src/remote/remote_daemon_dispatch.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/remote/remote_daemon_dispatch.c b/src/remote/remote_daemon= _dispatch.c index dc5790f077..061e0f7811 100644 --- a/src/remote/remote_daemon_dispatch.c +++ b/src/remote/remote_daemon_dispatch.c @@ -1790,6 +1790,7 @@ remoteOpenConn(const char *uri, { g_autoptr(virTypedParamList) identparams =3D NULL; g_autoptr(virConnect) newconn =3D NULL; + unsigned int connectFlags =3D 0; VIR_DEBUG("Getting secondary uri=3D%s readonly=3D%d preserveIdent=3D%d= conn=3D%p", NULLSTR(uri), readonly, preserveIdentity, conn); @@ -1814,11 +1815,9 @@ remoteOpenConn(const char *uri, VIR_DEBUG("Opening driver %s", uri); if (readonly) - newconn =3D virConnectOpenReadOnly(uri); - else - newconn =3D virConnectOpen(uri); + connectFlags |=3D VIR_CONNECT_RO; - if (!newconn) + if (!(newconn =3D virConnectOpenAuth(uri, NULL, connectFlags))) return -1; VIR_DEBUG("Opened driver %p", newconn); --=20 2.37.1