From nobody Sun Feb 8 17:37:25 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=1563897932; cv=none; d=zoho.com; s=zohoarc; b=kWlDekj37rGkkeZG7qLraSLnYrbqpNc0iBRQxp5NT9F9RRQ/FQpEfXDmOzYnUJXllvB8otfaHGRbg9wH7kRtYoQe4puY21U83QRd3yVx5NM3HGy5+HFwwgrzpkSV3BU7CIvSz9rVWkC4PbcMx0L9Lzl9Nj4VBYMSlajTPqqw7R8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1563897932; 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:ARC-Authentication-Results; bh=wQBdLIuPC40ltdvfJz66BreHYfIH+MuhE2joS+8FpjM=; b=PPXDikdlDUtH6mXvV48Nm/PK4o5epe/kyDB5HncdmLdkTwbOTt4zZntr96L+Moa1HtNG8drAILDJ3uDi3PA3BNNYWZBnXFxU+meUTc39u8S90CktHCopy0f5x85Hwoqyj75c3xFHhUzHethlwgB+PCluyqOv0Hn+DBlmpOO89i8= 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 1563897932463149.20935542344182; Tue, 23 Jul 2019 09:05:32 -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 38FB63082B3F; Tue, 23 Jul 2019 16:05:31 +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 E4ADC1853E; Tue, 23 Jul 2019 16:05:30 +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 8403C19731; Tue, 23 Jul 2019 16:05:30 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x6NG5N2B025276 for ; Tue, 23 Jul 2019 12:05:23 -0400 Received: by smtp.corp.redhat.com (Postfix) id 138945C25A; Tue, 23 Jul 2019 16:05:23 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.36.112.10]) by smtp.corp.redhat.com (Postfix) with ESMTP id 499B55C234; Tue, 23 Jul 2019 16:05:22 +0000 (UTC) From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Date: Tue, 23 Jul 2019 17:03:10 +0100 Message-Id: <20190723160319.18153-33-berrange@redhat.com> In-Reply-To: <20190723160319.18153-1-berrange@redhat.com> References: <20190723160319.18153-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 32/41] 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.45]); Tue, 23 Jul 2019 16:05:31 +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. Signed-off-by: Daniel P. Berrang=C3=A9 --- src/libvirt-admin.c | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/src/libvirt-admin.c b/src/libvirt-admin.c index 74dedf64d8..97290b337f 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 @@ -101,6 +97,7 @@ virAdmInitialize(void) return 0; } =20 + static char * getSocketPath(virURIPtr uri) { @@ -127,27 +124,28 @@ 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 { + 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 (STREQ_NULLABLE(uri->path, "/system")) { - if (virAsprintf(&sock_path, LOCALSTATEDIR "/run/libvirt/%s", - sockbase) < 0) + if (virAsprintf(&sock_path, LOCALSTATEDIR "/run/libvirt/%s-adm= in-sock", + legacy ? "libvirt" : uri->scheme) < 0) goto error; } else if (STREQ_NULLABLE(uri->path, "/session")) { - if (!rundir || virAsprintf(&sock_path, "%s/%s", rundir, - sockbase) < 0) + if (!rundir || virAsprintf(&sock_path, "%s/%s-admin-sock", run= dir, + legacy ? "libvirt" : uri->scheme) <= 0) goto error; } else { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list