From nobody Sun Feb 8 06:05:27 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 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=1565277236; cv=none; d=zoho.com; s=zohoarc; b=d6dndKMbdVP40LVjNp8BgFr81wBJwhuzHExSaiLXY0/quN3iziLB2IPKLWK1MyRF0lPUFbUIkoivbMRgXUi9VRJz++GYySS/6Wvr1gRRr43ebpJeagOqyDJmAqRbvBpPzl3inCl+aSZgGM3aYCEQ9RITg/ZD4AlKhXuNzRYzID0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1565277236; h=Content-Type:Content-Transfer-Encoding:Cc: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:ARC-Authentication-Results; bh=eMQLkO2uKGhQeVHr1AUgjpa8rfVPBNuRt5bVeUoRF34=; b=Dz2UkqgmJUNr8BGkAh1EvOory9o2V693bYlw9qy/vjhtDvrpPneE1WEvhm2mFeLLekr3r3t31UAVaxOGPPuC1hsc2Ap74m3pIkRxFICpZ0oPtRTAmCtMLXmVK4nRYgo0ciyq21MVg8GR34QztGuxLNFEsus6bmrTp9tymhQ0A/8= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 15652772362921002.718812464201; Thu, 8 Aug 2019 08:13:56 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D2BEE315C01F; Thu, 8 Aug 2019 15:13:54 +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 A1549F6E8; Thu, 8 Aug 2019 15:13:54 +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 61EFB180BAA9; Thu, 8 Aug 2019 15:13:54 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x78FC0np027958 for ; Thu, 8 Aug 2019 11:12:00 -0400 Received: by smtp.corp.redhat.com (Postfix) id 951E710002B9; Thu, 8 Aug 2019 15:12:00 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-112-28.ams2.redhat.com [10.36.112.28]) by smtp.corp.redhat.com (Postfix) with ESMTP id A3E8A1001948; Thu, 8 Aug 2019 15:11:59 +0000 (UTC) From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Date: Thu, 8 Aug 2019 16:10:35 +0100 Message-Id: <20190808151044.11385-34-berrange@redhat.com> In-Reply-To: <20190808151044.11385-1-berrange@redhat.com> References: <20190808151044.11385-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Cc: Andrea Bolognani Subject: [libvirt] [PATCH v4 33/42] admin: add ability to connect to the per-driver daemon sockets 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: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Thu, 08 Aug 2019 15:13:55 +0000 (UTC) The admin client now supports addressing the per-driver daemons using the obvious URI schemes for each daemon. eg virtqemud:///system virtqemud:///session, etc. Reviewed-by: Andrea Bolognani Signed-off-by: Daniel P. Berrang=C3=A9 --- src/libvirt-admin.c | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/src/libvirt-admin.c b/src/libvirt-admin.c index 4ae50b188f..e102506948 100644 --- a/src/libvirt-admin.c +++ b/src/libvirt-admin.c @@ -36,10 +36,6 @@ =20 #define VIR_FROM_THIS VIR_FROM_ADMIN =20 -#define LIBVIRTD_ADMIN_SOCK_NAME "libvirt-admin-sock" -#define VIRTLOGD_ADMIN_SOCK_NAME "virtlogd-admin-sock" -#define VIRTLOCKD_ADMIN_SOCK_NAME "virtlockd-admin-sock" - =20 VIR_LOG_INIT("libvirt-admin"); =20 @@ -127,20 +123,31 @@ getSocketPath(virURIPtr uri) } =20 if (!sock_path) { - const char *sockbase =3D NULL; - if (STREQ_NULLABLE(uri->scheme, "libvirtd")) { - sockbase =3D LIBVIRTD_ADMIN_SOCK_NAME; - } else if (STREQ_NULLABLE(uri->scheme, "virtlogd")) { - sockbase =3D VIRTLOGD_ADMIN_SOCK_NAME; - } else if (STREQ_NULLABLE(uri->scheme, "virtlockd")) { - sockbase =3D VIRTLOCKD_ADMIN_SOCK_NAME; - } else { + VIR_AUTOFREE(char *) sockbase =3D NULL; + bool legacy =3D false; + + if (!uri->scheme) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + "%s", _("No URI scheme specified")); + goto error; + } + if (STREQ(uri->scheme, "libvirtd")) { + legacy =3D true; + } else if (!STRPREFIX(uri->scheme, "virt")) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("Unsupported URI scheme '%s'"), - NULLSTR(uri->scheme)); + uri->scheme); goto error; } =20 + if (legacy) { + if (VIR_STRDUP(sockbase, "libvirt-admin-sock") < 0) + goto error; + } else { + if (virAsprintf(&sockbase, "%s-admin-sock", uri->scheme) < 0) + goto error; + } + if (STREQ_NULLABLE(uri->path, "/system")) { if (virAsprintf(&sock_path, LOCALSTATEDIR "/run/libvirt/%s", sockbase) < 0) --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list