From nobody Sun Feb 8 14:22:22 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=1662650180; cv=none; d=zohomail.com; s=zohoarc; b=Bwgg9jYrWBAADxvdeeEb/8GMUBzxuOq3cX7iNqA5SaiX0hwRq8HJN8QlaXTsUuX3uRZwo+JYJCEJpnDyrimIiIMZSDZUM5unBtcT3gbzplyvreIYWk77a8M/JuosYyZqSQPJK1/SPyRczmuo8e6puzfYStD3BWyLm3pgUhqjc+g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1662650180; 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=np4tmzCWJGDlg2OBUhyTbH1N+R8JxHoie+cC4VM8BkXQahs6YISwaR0wENHGRsZr4KcsYblIqCEXsgan+TcrcCBGKEndctkxlwK+Z9cu3Kp9KSBERtDss8W0LpnLKXbh9LSYcH/BXTTeSyQVw+lkD7UyJtGd02td4Nb4C6hWrMs= 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 1662650180050159.16365753985554; Thu, 8 Sep 2022 08:16:20 -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-461-Qn3ts-gyMryOK4oiW3x4lg-1; Thu, 08 Sep 2022 11:16:16 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 528388EB188; Thu, 8 Sep 2022 15:16:09 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3FEDE1410F36; Thu, 8 Sep 2022 15:16:09 +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 0E2951946A44; Thu, 8 Sep 2022 15:16:09 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 992F91946A41 for ; Thu, 8 Sep 2022 15:16:06 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 6D12814171FE; Thu, 8 Sep 2022 15:16:06 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id D5BF61410F38 for ; Thu, 8 Sep 2022 15:16:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1662650179; 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=Y+kzuwi2xzwKGR0o1xhuWyiryCZb8WfWQWrOamStY/qb+/o1uERxuAof0+ItRRB/Dpa+nD 6YRR3QxIcf6BGnGSkkt6/zlp/XOcoVKbo/pOKlT49r0BbAvVmqS8pLOVCpFrXOeaKF5ID1 Mx8aGOjUxHjT4O30BSTdMsLvgRybF2w= X-MC-Unique: Qn3ts-gyMryOK4oiW3x4lg-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 4/6] remote: remoteOpenConn: Use virConnectOpenAuth instead of virConnectOpen(ReadOnly) Date: Thu, 8 Sep 2022 17:15:58 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.7 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.7 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: 1662650180471100001 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