From nobody Sun Feb 8 16:30:58 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=1564420356; cv=none; d=zoho.com; s=zohoarc; b=QCr77GOu7p8o2SIaCgnRXi01zOmQqmL1jUEVp+VMyW9zUii6ay/Brcbnlr4ni9rQoeSX9No8we9qZlhFGOnfqgYe3QzMkd+/HKgZGs0fu2lJsuGD7RO7OyyEuazXr4KwW5nwdb9mroJlYqWR7I74T9+4vkveFjr3O9CJ56LKxcc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1564420356; 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=9P9p7t8n4f8IzZv6uymKuUEtT+o5UkuhQjwOfjLOtsw=; b=iIf8lJ/3JOllS0zibMrKfFaOFgscH/BW2U4fc78nexNDjKpf9TXx762bn4w1o0D2McRqplgP2+gMHZF+PJZidIL1qDYDk64Bp4ZaDKqc4d2vGFktUryyz9PvbWdOo8sn0V0tai4lwHOabZXQ+V87cBUbfbQiAemcsgG/EA/+qnc= 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 1564420356507831.1488274479166; Mon, 29 Jul 2019 10:12:36 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DAED5796E0; Mon, 29 Jul 2019 17:12:34 +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 B995660C68; Mon, 29 Jul 2019 17:12:34 +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 80AD31972D; Mon, 29 Jul 2019 17:12:34 +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 x6THCQ8D028136 for ; Mon, 29 Jul 2019 13:12:26 -0400 Received: by smtp.corp.redhat.com (Postfix) id CDF875C206; Mon, 29 Jul 2019 17:12:26 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-112-51.ams2.redhat.com [10.36.112.51]) by smtp.corp.redhat.com (Postfix) with ESMTP id A1D295C1A1; Mon, 29 Jul 2019 17:12:25 +0000 (UTC) From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Date: Mon, 29 Jul 2019 18:11:15 +0100 Message-Id: <20190729171130.25484-34-berrange@redhat.com> In-Reply-To: <20190729171130.25484-1-berrange@redhat.com> References: <20190729171130.25484-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 Cc: Andrea Bolognani Subject: [libvirt] [PATCH v3 33/48] 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.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Mon, 29 Jul 2019 17:12:35 +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 | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/src/libvirt-admin.c b/src/libvirt-admin.c index 74dedf64d8..fa077d5a46 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,27 +123,29 @@ 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, "%s/run/libvirt/%s-admin-sock", + LOCALSTATEDIR, + 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