From nobody Tue Feb 10 03:45:03 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=1644854686; cv=none; d=zohomail.com; s=zohoarc; b=GseTpXcoEbUcJLLJLBLWxseNazutTztztiYep2uyBe3v3/bs1wzOouMO9u4HyR6iIuYBGyLj2/bB0S+6MAfsG3tHVBLC++g18D8UtX6RFeMqW1wckbrvLkhE6VBhZwhXBi5MCXlMy0huklCxPGrhTfWy9uKzpn1PsSg+L2c4UGc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1644854686; 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=mJq+HrZDOWvsytzzvDiG8YBR+7Tkb1zkGGH8SzbnCvc=; b=lGDfEPuB7KKYalnRYZrLazEavHCZRGhRW75EsdWkRLgVJGAhVY004tPxXoZQz7he4LmfcCRuExhTYSK+G13ae1Q4tILYXvl01P9vOgbIRN1EYorklRAt9sCJQaiCDfSPEWw8UZwKtmeVnO7rAIscok73k7jrZrrF/z0M7RYlvZI= 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 1644854686800383.5861547181196; Mon, 14 Feb 2022 08:04:46 -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-540-IUscmE91OXmegNXB0ZcYkw-1; Mon, 14 Feb 2022 11:04:45 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0FAA8839A45; Mon, 14 Feb 2022 16:04:40 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E177878A93; Mon, 14 Feb 2022 16:04:39 +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 B1EC84A705; Mon, 14 Feb 2022 16:04:39 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 21EG4ZX9022403 for ; Mon, 14 Feb 2022 11:04:35 -0500 Received: by smtp.corp.redhat.com (Postfix) id E2B527D5B4; Mon, 14 Feb 2022 16:04:35 +0000 (UTC) Received: from harajuku.usersys.redhat.com.homenet.telecomitalia.it (unknown [10.40.194.9]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 506A07CD68 for ; Mon, 14 Feb 2022 16:04:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1644854686; 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=mJq+HrZDOWvsytzzvDiG8YBR+7Tkb1zkGGH8SzbnCvc=; b=F0r8uGhZxYyrmcgGwMTrd9YOJeVjVNln89HfNH5SJEnq86cXUZQjdKIEKTgMH+G7sAMM4b pQUb6yT7WlLGIojg427DK9zJ4dqS6tb5jXVfJx7t678pht5fGrbue/B/REc+8CmbIaba0C 2OoaqoLC4nYhvv4E75fBAP8l/ct+Un4= X-MC-Unique: IUscmE91OXmegNXB0ZcYkw-1 From: Andrea Bolognani To: libvir-list@redhat.com Subject: [libvirt PATCH v2 3/6] virnetclient: Handle netcatPath presence all at once Date: Mon, 14 Feb 2022 17:03:32 +0100 Message-Id: <20220214160335.174432-4-abologna@redhat.com> In-Reply-To: <20220214160335.174432-1-abologna@redhat.com> References: <20220214160335.174432-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 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.14 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: 1644854706992100003 Content-Type: text/plain; charset="utf-8" Signed-off-by: Andrea Bolognani --- src/rpc/virnetclient.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/src/rpc/virnetclient.c b/src/rpc/virnetclient.c index 7e7e9d52a6..9c7047c7f8 100644 --- a/src/rpc/virnetclient.c +++ b/src/rpc/virnetclient.c @@ -425,13 +425,17 @@ virNetClientSSHHelperCommand(virNetClientProxy proxy, g_autofree char *nccmd =3D NULL; g_autofree char *helpercmd =3D NULL; =20 - /* If user gave a 'netcat' path in the URI, we must - * assume they want the legacy 'nc' based proxy, not - * our new virt-ssh-helper - */ - if (proxy =3D=3D VIR_NET_CLIENT_PROXY_AUTO && - netcatPath !=3D NULL) { - proxy =3D VIR_NET_CLIENT_PROXY_NETCAT; + if (netcatPath) { + if (proxy =3D=3D VIR_NET_CLIENT_PROXY_AUTO) { + /* If user gave a 'netcat' path in the URI, we must + * assume they want the legacy 'nc' based proxy, not + * our new virt-ssh-helper */ + proxy =3D VIR_NET_CLIENT_PROXY_NETCAT; + } else if (proxy =3D=3D VIR_NET_CLIENT_PROXY_NATIVE) { + virReportError(VIR_ERR_INVALID_ARG, "%s", + _("netcat path not valid with native proxy mode= ")); + return NULL; + } } =20 nccmd =3D g_strdup_printf( @@ -459,11 +463,6 @@ virNetClientSSHHelperCommand(virNetClientProxy proxy, return g_strdup_printf("sh -c '%s'", nccmd); =20 case VIR_NET_CLIENT_PROXY_NATIVE: - if (netcatPath) { - virReportError(VIR_ERR_INVALID_ARG, "%s", - _("netcat path not valid with native proxy mode= ")); - return NULL; - } return g_strdup_printf("sh -c '%s'", helpercmd); =20 case VIR_NET_CLIENT_PROXY_LAST: --=20 2.35.1