From nobody Mon Feb 9 04:45:54 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.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.133.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=1675675151; cv=none; d=zohomail.com; s=zohoarc; b=GBuZwSZsZpLLe15Lm+P/ox1qatwlA8p2yNLFbP8KZR1TXfssOssiBuMu9wTaIBVcY9gNiPgiurIy7X68Bk8E5dLPy2X0IN4IustQ4JvXws/czKT2HDnepH5clTSTa++ukdP4DRU4R7tUN6E2MlfRHd8m+cRbr5NQZSKK/waOylo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675675151; 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=+1hxokLBiaGIfru+1V/TWxEjBj3QRoXX2azwdhKRMwY=; b=XlmYS8Rrz8YeDChp7M4mKqSzdiRFeBFRPkx3tBbzWaTQE8D1Skf8oQA0Zd2JPEpd9J1elVwmaxNL+tOJF6zJn2EH81BZc3Wejt1Nn4MOrC+1EsYO+uwNy6MPkE3i6PF52oBIXJJHxHlOhOxKLSDtctrJmK8OzYevviOik0copHM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.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.133.124]) by mx.zohomail.com with SMTPS id 1675675151122469.22369607851533; Mon, 6 Feb 2023 01:19:11 -0800 (PST) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-451-lQlDyF1sO0yb1MEJO41OBQ-1; Mon, 06 Feb 2023 04:17:13 -0500 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 84F081C04183; Mon, 6 Feb 2023 09:17:08 +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 6FE42C15BA0; Mon, 6 Feb 2023 09:17:08 +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 60B47194658C; Mon, 6 Feb 2023 09:17:08 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 2FE0C194658D for ; Mon, 6 Feb 2023 09:17:06 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 14556492B23; Mon, 6 Feb 2023 09:17:06 +0000 (UTC) Received: from maggie.redhat.com (unknown [10.43.2.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id B0D89492B21 for ; Mon, 6 Feb 2023 09:17:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1675675150; 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=+1hxokLBiaGIfru+1V/TWxEjBj3QRoXX2azwdhKRMwY=; b=RrQxN0DpYllP47MuGxyaMogxDNOFW5zuiqOeyd8pEHjF3NlCj1rZGUDsc6RTCZumbooF9E lRtS8RUn29tVdBLy8G46WUedwmlW06egpFi3fwYN3hrbeBNys05Y0bCjERH4rDQaQvv8Cf zObZ4DL8mKpPpyRKLrF5oQWOeWlW+aw= X-MC-Unique: lQlDyF1sO0yb1MEJO41OBQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 07/10] virt-ssh-helper: Accept ?socket= in connection URI Date: Mon, 6 Feb 2023 10:16:55 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 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 3.1 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: 1675675151825100001 Content-Type: text/plain; charset="utf-8"; x-default="true" Similarly to the previous commit, let's accept "socket" parameter in the connection URI. This change will allow us to use virt-ssh-helper instead of 'nc' in all cases (done in one of future commits). Please note, when the parameter is used it effectively disables automatic daemon spawning and an error is reported. But this is intentional - so that the helper behaves just like regular virConnectOpen() with different transport than ssh, e.g. unix. But this 'change' is acceptable - there's no way for users to make our remote code pass the argument to virt-ssh-helper, yet. Signed-off-by: Michal Privoznik Reviewed-by: Peter Krempa --- src/remote/remote_ssh_helper.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/remote/remote_ssh_helper.c b/src/remote/remote_ssh_helper.c index 3b4de7f214..0eafc70d16 100644 --- a/src/remote/remote_ssh_helper.c +++ b/src/remote/remote_ssh_helper.c @@ -436,6 +436,7 @@ int main(int argc, char **argv) virURIParam *var =3D &uri->params[i]; =20 VIR_EXTRACT_URI_ARG_STR("mode", mode_str); + VIR_EXTRACT_URI_ARG_STR("socket", sock_path); } =20 if (mode_str && @@ -444,11 +445,12 @@ int main(int argc, char **argv) exit(EXIT_FAILURE); } =20 - sock_path =3D remoteGetUNIXSocket(transport, - mode, - driver, - flags, - &daemon_path); + if (!sock_path && + !(sock_path =3D remoteGetUNIXSocket(transport, mode, + driver, flags, &daemon_path))) { + g_printerr(_("%s: failed to generate UNIX socket path"), argv[0]); + exit(EXIT_FAILURE); + } =20 if (virNetSocketNewConnectUNIX(sock_path, daemon_path, &sock) < 0) { g_printerr(_("%s: cannot connect to '%s': %s\n"), --=20 2.39.1