mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
admin: add ability to connect to the per-driver daemon sockets
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 <abologna@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
parent
b28fd43a5e
commit
fe7d392c85
@ -36,10 +36,6 @@
|
|||||||
|
|
||||||
#define VIR_FROM_THIS VIR_FROM_ADMIN
|
#define VIR_FROM_THIS VIR_FROM_ADMIN
|
||||||
|
|
||||||
#define LIBVIRTD_ADMIN_SOCK_NAME "libvirt-admin-sock"
|
|
||||||
#define VIRTLOGD_ADMIN_SOCK_NAME "virtlogd-admin-sock"
|
|
||||||
#define VIRTLOCKD_ADMIN_SOCK_NAME "virtlockd-admin-sock"
|
|
||||||
|
|
||||||
|
|
||||||
VIR_LOG_INIT("libvirt-admin");
|
VIR_LOG_INIT("libvirt-admin");
|
||||||
|
|
||||||
@ -127,17 +123,28 @@ getSocketPath(virURIPtr uri)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!sock_path) {
|
if (!sock_path) {
|
||||||
const char *sockbase = NULL;
|
VIR_AUTOFREE(char *) sockbase = NULL;
|
||||||
if (STREQ_NULLABLE(uri->scheme, "libvirtd")) {
|
bool legacy = false;
|
||||||
sockbase = LIBVIRTD_ADMIN_SOCK_NAME;
|
|
||||||
} else if (STREQ_NULLABLE(uri->scheme, "virtlogd")) {
|
if (!uri->scheme) {
|
||||||
sockbase = VIRTLOGD_ADMIN_SOCK_NAME;
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||||
} else if (STREQ_NULLABLE(uri->scheme, "virtlockd")) {
|
"%s", _("No URI scheme specified"));
|
||||||
sockbase = VIRTLOCKD_ADMIN_SOCK_NAME;
|
goto error;
|
||||||
} else {
|
}
|
||||||
|
if (STREQ(uri->scheme, "libvirtd")) {
|
||||||
|
legacy = true;
|
||||||
|
} else if (!STRPREFIX(uri->scheme, "virt")) {
|
||||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||||
_("Unsupported URI scheme '%s'"),
|
_("Unsupported URI scheme '%s'"),
|
||||||
NULLSTR(uri->scheme));
|
uri->scheme);
|
||||||
|
goto error;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (legacy) {
|
||||||
|
if (VIR_STRDUP(sockbase, "libvirt-admin-sock") < 0)
|
||||||
|
goto error;
|
||||||
|
} else {
|
||||||
|
if (virAsprintf(&sockbase, "%s-admin-sock", uri->scheme) < 0)
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user