mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-21 20:15:17 +00:00
Add whitelisting of users. Remove IP whitelisting. Make auth schemes configurable
This commit is contained in:
parent
bb5371f668
commit
cfb62c9d5e
14
ChangeLog
14
ChangeLog
@ -1,3 +1,17 @@
|
||||
Wed Dec 5 10:29:00 EST 2007 Daniel P. Berrange <berrange@redhat.com>
|
||||
|
||||
* qemud/Makefile.am: Fix VPATH build for remote_generate_stubs.pl
|
||||
* qemud/internal.h: Add saslusername to client data & username
|
||||
whitelist to server data
|
||||
* qemud/libvirtd.conf: Add config param for whitelisting users.
|
||||
Remove config param for whitelisting IP addrs. Cleanup whitespace
|
||||
and syntax errors in default values
|
||||
* qemud/qemud.c, qemud/remote.c: Remove IP whitelisting. Add
|
||||
username whitelisting against SASL authenticated username.
|
||||
Makefile socket authentication schemes configurable.
|
||||
* qemud/remote_dispatch_prototypes.h, remote_generate_stubs.pl:
|
||||
Add a struct qemud_server * parameter to every dispatch function
|
||||
|
||||
Wed Dec 5 10:25:00 EST 2007 Daniel P. Berrange <berrange@redhat.com>
|
||||
|
||||
* src/remote_internal.c, qemud/qemud.c, qemud/internal.h,
|
||||
|
@ -101,14 +101,14 @@ remote.c: remote_dispatch_prototypes.h \
|
||||
remote_dispatch_localvars.h \
|
||||
remote_dispatch_proc_switch.h
|
||||
|
||||
remote_dispatch_prototypes.h: remote_generate_stubs.pl remote_protocol.x
|
||||
perl -w remote_generate_stubs.pl -i remote_protocol.x > $@
|
||||
remote_dispatch_prototypes.h: $(srcdir)/remote_generate_stubs.pl remote_protocol.x
|
||||
perl -w $(srcdir)/remote_generate_stubs.pl -i $(srcdir)/remote_protocol.x > $@
|
||||
|
||||
remote_dispatch_localvars.h: remote_generate_stubs.pl remote_protocol.x
|
||||
perl -w remote_generate_stubs.pl -v remote_protocol.x > $@
|
||||
remote_dispatch_localvars.h: $(srcdir)/remote_generate_stubs.pl remote_protocol.x
|
||||
perl -w $(srcdir)/remote_generate_stubs.pl -v $(srcdir)/remote_protocol.x > $@
|
||||
|
||||
remote_dispatch_proc_switch.h: remote_generate_stubs.pl remote_protocol.x
|
||||
perl -w remote_generate_stubs.pl -w remote_protocol.x > $@
|
||||
remote_dispatch_proc_switch.h: $(srcdir)/remote_generate_stubs.pl remote_protocol.x
|
||||
perl -w $(srcdir)/remote_generate_stubs.pl -w $(srcdir)/remote_protocol.x > $@
|
||||
|
||||
if LIBVIRT_INIT_SCRIPTS_RED_HAT
|
||||
install-init: libvirtd.init
|
||||
|
@ -109,6 +109,7 @@ struct qemud_client {
|
||||
const char *saslEncoded;
|
||||
unsigned int saslEncodedLength;
|
||||
unsigned int saslEncodedOffset;
|
||||
char *saslUsername;
|
||||
#endif
|
||||
|
||||
unsigned int incomingSerial;
|
||||
@ -151,6 +152,9 @@ struct qemud_server {
|
||||
#ifdef HAVE_AVAHI
|
||||
struct libvirtd_mdns *mdns;
|
||||
#endif
|
||||
#if HAVE_SASL
|
||||
char **saslUsernameWhitelist;
|
||||
#endif
|
||||
};
|
||||
|
||||
void qemudLog(int priority, const char *fmt, ...)
|
||||
|
@ -3,6 +3,11 @@
|
||||
# For further information consult http://libvirt.org/format.html
|
||||
|
||||
|
||||
#################################################################
|
||||
#
|
||||
# Network connectivitiy controls
|
||||
#
|
||||
|
||||
# Flag listening for secure TLS connections on the public TCP/IP port.
|
||||
# NB, must pass the --listen flag to the libvirtd process for this to
|
||||
# have any effect.
|
||||
@ -11,28 +16,30 @@
|
||||
# using this capability.
|
||||
#
|
||||
# This is enabled by default, uncomment this to disable it
|
||||
# listen_tls = 0
|
||||
#listen_tls = 0
|
||||
|
||||
# Listen for unencrypted TCP connections on the public TCP/IP port.
|
||||
# NB, must pass the --listen flag to the libvirtd process for this to
|
||||
# have any effect.
|
||||
#
|
||||
# NB, this is insecure. Do not use except for development.
|
||||
# Using the TCP socket requires SASL authentication by default. Only
|
||||
# SASL mechanisms which support data encryption are allowed. This is
|
||||
# DIGEST_MD5 and GSSAPI (Kerberos5)
|
||||
#
|
||||
# This is disabled by default, uncomment this to enable it.
|
||||
# listen_tcp = 1
|
||||
#listen_tcp = 1
|
||||
|
||||
|
||||
|
||||
# Override the port for accepting secure TLS connections
|
||||
# This can be a port number, or service name
|
||||
#
|
||||
# tls_port = "16514"
|
||||
#tls_port = "16514"
|
||||
|
||||
# Override the port for accepting insecure TCP connections
|
||||
# This can be a port number, or service name
|
||||
#
|
||||
# tcp_port = "16509"
|
||||
#
|
||||
#tcp_port = "16509"
|
||||
|
||||
|
||||
|
||||
@ -42,41 +49,125 @@
|
||||
# stopping the Avahi daemon
|
||||
#
|
||||
# This is enabled by default, uncomment this to disable it
|
||||
# mdns_adv = 0
|
||||
#mdns_adv = 0
|
||||
|
||||
# Override the default mDNS advertizement name. This must be
|
||||
# unique on the immediate broadcast network.
|
||||
#
|
||||
#
|
||||
# The default is "Virtualization Host HOSTNAME", where HOSTNAME
|
||||
# is subsituted for the short hostname of the machine (without domain)
|
||||
#
|
||||
# mdns_name "Virtualization Host Joe Demo"
|
||||
#mdns_name = "Virtualization Host Joe Demo"
|
||||
|
||||
|
||||
#################################################################
|
||||
#
|
||||
# UNIX socket access controls
|
||||
#
|
||||
|
||||
# Set the UNIX domain socket group ownership. This can be used to
|
||||
# allow a 'trusted' set of users access to management capabilities
|
||||
# without becoming root.
|
||||
#
|
||||
# This is restricted to 'root' by default.
|
||||
# unix_sock_group "libvirt"
|
||||
#
|
||||
# This is restricted to 'root' by default.
|
||||
#unix_sock_group = "libvirt"
|
||||
|
||||
# Set the UNIX socket permissions for the R/O socket. This is used
|
||||
# for monitoring VM status only
|
||||
#
|
||||
# Default allows any user. If setting group ownership may want to
|
||||
# restrict this to:
|
||||
# unix_sock_ro_perms "0777"
|
||||
#unix_sock_ro_perms = "0777"
|
||||
|
||||
# Set the UNIX socket permissions for the R/W socket. This is used
|
||||
# for full management of VMs
|
||||
#
|
||||
# Default allows only root. If setting group ownership may want to
|
||||
# relax this to:
|
||||
# unix_sock_rw_perms "octal-perms" "0770"
|
||||
#unix_sock_rw_perms = "0770"
|
||||
|
||||
|
||||
|
||||
#################################################################
|
||||
#
|
||||
# Authentication.
|
||||
#
|
||||
# - none: do not perform auth checks. If you can connect to the
|
||||
# socket you are allowed. This is suitable if there are
|
||||
# restrictions on connecting to the socket (eg, UNIX
|
||||
# socket permissions), or if there is a lower layer in
|
||||
# the network providing auth (eg, TLS/x509 certificates)
|
||||
#
|
||||
# - sasl: use SASL infrastructure. The actual auth scheme is then
|
||||
# controlled from /etc/sasl2/libvirt.conf. For the TCP
|
||||
# socket only GSSAPI & DIGEST-MD5 mechanisms will be used.
|
||||
# For non-TCP or TLS sockets, any scheme is allowed.
|
||||
#
|
||||
|
||||
# Set an authentication scheme for UNIX read-only sockets
|
||||
# By default socket permissions allow anyone to connect
|
||||
#
|
||||
# To restrict monitoring of domains you may wish to enable
|
||||
# an authentication mechanism here
|
||||
#auth_unix_ro = "none"
|
||||
|
||||
# Set an authentication scheme for UNIX read-write sockets
|
||||
# By default socket permissions only allow root.
|
||||
#
|
||||
# If the unix_sock_rw_perms are changed you may wish to enable
|
||||
# an authentication mechanism here
|
||||
#auth_unix_rw = "none"
|
||||
|
||||
# Change the authentication scheme for TCP sockets.
|
||||
#
|
||||
# If you don't enable SASL, then all TCP traffic is cleartext.
|
||||
# Don't do this outside of a dev/test scenario. For real world
|
||||
# use, always enable SASL and use the GSSAPI or DIGEST-MD5
|
||||
# mechanism in /etc/sasl2/libvirt.conf
|
||||
#auth_tcp = "sasl"
|
||||
|
||||
# Change the authentication scheme for TLS sockets.
|
||||
#
|
||||
# TLS sockets already have encryption provided by the TLS
|
||||
# layer, and limited authentication is done by certificates
|
||||
#
|
||||
# It is possible to make use of any SASL authentication
|
||||
# mechanism as well, by using 'sasl' for this option
|
||||
#auth_tls = "none"
|
||||
|
||||
|
||||
|
||||
#################################################################
|
||||
#
|
||||
# TLS x509 certificate configuration
|
||||
#
|
||||
|
||||
|
||||
# Override the default server key file path
|
||||
#
|
||||
#key_file = "/etc/pki/libvirt/private/serverkey.pem"
|
||||
|
||||
# Override the default server certificate file path
|
||||
#
|
||||
#cert_file = "/etc/pki/libvirt/servercert.pem"
|
||||
|
||||
# Override the default CA certificate path
|
||||
#
|
||||
#ca_file = "/etc/pki/CA/cacert.pem"
|
||||
|
||||
# Specify a certificate revocation list.
|
||||
#
|
||||
# Defaults to not using a CRL, uncomment to enable it
|
||||
#crl_file = "/etc/pki/CA/crl.pem"
|
||||
|
||||
|
||||
|
||||
#################################################################
|
||||
#
|
||||
# Authorization controls
|
||||
#
|
||||
|
||||
|
||||
# Flag to disable verification of client certificates
|
||||
#
|
||||
# Client certificate verification is the primary authentication mechanism.
|
||||
@ -85,36 +176,11 @@
|
||||
#
|
||||
# Default is to always verify. Uncommenting this will disable
|
||||
# verification - make sure an IP whitelist is set
|
||||
# tls_no_verify_certificate 1
|
||||
#tls_no_verify_certificate = 1
|
||||
|
||||
# Flag to disable verification of client IP address
|
||||
#
|
||||
# Client IP address will be verified against the CommonName field
|
||||
# of the x509 certificate. This has minimal security benefit since
|
||||
# it is easy to spoof source IP.
|
||||
#
|
||||
# Uncommenting this will disable verification
|
||||
# tls_no_verify_address 1
|
||||
|
||||
# Override the default server key file path
|
||||
#
|
||||
# key_file "/etc/pki/libvirt/private/serverkey.pem"
|
||||
|
||||
# Override the default server certificate file path
|
||||
#
|
||||
# cert_file "/etc/pki/libvirt/servercert.pem"
|
||||
|
||||
# Override the default CA certificate path
|
||||
#
|
||||
# ca_file "/etc/pki/CA/cacert.pem"
|
||||
|
||||
# Specify a certificate revocation list.
|
||||
#
|
||||
# Defaults to not using a CRL, uncomment to enable it
|
||||
# crl_file "/etc/pki/CA/crl.pem"
|
||||
|
||||
# A whitelist of allowed x509 Distinguished Names
|
||||
# This list may contain wildcards such as
|
||||
# This list may contain wildcards such as
|
||||
#
|
||||
# "C=GB,ST=London,L=London,O=Red Hat,CN=*"
|
||||
#
|
||||
@ -124,18 +190,23 @@
|
||||
# entirely rather than using empty list to disable these checks
|
||||
#
|
||||
# By default, no DN's are checked
|
||||
# tls_allowed_dn_list ["DN1", "DN2"]
|
||||
#tls_allowed_dn_list = ["DN1", "DN2"]
|
||||
|
||||
|
||||
# A whitelist of allowed client IP addresses
|
||||
# A whitelist of allowed SASL usernames. The format for usernames
|
||||
# depends on the SASL authentication mechanism. Kerberos usernames
|
||||
# look like username@REALM
|
||||
#
|
||||
# This list may contain wildcards such as 192.168.* See the POSIX fnmatch
|
||||
# function for the format of the wildcards.
|
||||
# This list may contain wildcards such as
|
||||
#
|
||||
# "*@EXAMPLE.COM"
|
||||
#
|
||||
# See the POSIX fnmatch function for the format of the wildcards.
|
||||
#
|
||||
# NB If this is an empty list, no client can connect, so comment out
|
||||
# entirely rather than using empty list to disable these checks
|
||||
#
|
||||
# By default, no IP's are checked. This can be IPv4 or IPv6 addresses
|
||||
# tls_allowed_ip_list ["ip1", "ip2", "ip3"]
|
||||
# By default, no Username's are checked
|
||||
#sasl_allowed_username_list = ["joe@EXAMPLE.COM", "fred@EXAMPLE.COM" ]
|
||||
|
||||
|
||||
|
230
qemud/qemud.c
230
qemud/qemud.c
@ -77,12 +77,19 @@ static gid_t unix_sock_gid = 0; /* Only root by default */
|
||||
static int unix_sock_rw_mask = 0700; /* Allow user only */
|
||||
static int unix_sock_ro_mask = 0777; /* Allow world */
|
||||
|
||||
static int auth_unix_rw = REMOTE_AUTH_NONE;
|
||||
static int auth_unix_ro = REMOTE_AUTH_NONE;
|
||||
#if HAVE_SASL
|
||||
static int auth_tcp = REMOTE_AUTH_SASL;
|
||||
#else
|
||||
static int auth_tcp = REMOTE_AUTH_NONE;
|
||||
#endif
|
||||
static int auth_tls = REMOTE_AUTH_NONE;
|
||||
|
||||
static int mdns_adv = 1;
|
||||
static char *mdns_name = NULL;
|
||||
|
||||
static int tls_no_verify_certificate = 0;
|
||||
static int tls_no_verify_address = 0;
|
||||
static char **tls_allowed_ip_list = NULL;
|
||||
static char **tls_allowed_dn_list = NULL;
|
||||
|
||||
static char *key_file = (char *) LIBVIRT_SERVERKEY;
|
||||
@ -448,7 +455,7 @@ static int qemudWritePidFile(const char *pidFile) {
|
||||
}
|
||||
|
||||
static int qemudListenUnix(struct qemud_server *server,
|
||||
const char *path, int readonly) {
|
||||
const char *path, int readonly, int auth) {
|
||||
struct qemud_socket *sock = calloc(1, sizeof(struct qemud_socket));
|
||||
struct sockaddr_un addr;
|
||||
mode_t oldmask;
|
||||
@ -462,6 +469,7 @@ static int qemudListenUnix(struct qemud_server *server,
|
||||
sock->readonly = readonly;
|
||||
sock->port = -1;
|
||||
sock->type = QEMUD_SOCK_TYPE_UNIX;
|
||||
sock->auth = auth;
|
||||
|
||||
if ((sock->fd = socket(PF_UNIX, SOCK_STREAM, 0)) < 0) {
|
||||
qemudLog(QEMUD_ERR, "Failed to create socket: %s",
|
||||
@ -699,32 +707,14 @@ static int qemudInitPaths(struct qemud_server *server,
|
||||
|
||||
static struct qemud_server *qemudInitialize(int sigread) {
|
||||
struct qemud_server *server;
|
||||
struct qemud_socket *sock;
|
||||
char sockname[PATH_MAX];
|
||||
char roSockname[PATH_MAX];
|
||||
#if HAVE_SASL
|
||||
int err;
|
||||
#endif /* HAVE_SASL */
|
||||
|
||||
if (!(server = calloc(1, sizeof(struct qemud_server)))) {
|
||||
qemudLog(QEMUD_ERR, "Failed to allocate struct qemud_server");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* We don't have a dom-0, so start from 1 */
|
||||
server->sigread = sigread;
|
||||
|
||||
roSockname[0] = '\0';
|
||||
|
||||
if (qemudInitPaths(server, sockname, roSockname, PATH_MAX) < 0)
|
||||
goto cleanup;
|
||||
|
||||
if (qemudListenUnix(server, sockname, 0) < 0)
|
||||
goto cleanup;
|
||||
|
||||
if (roSockname[0] != '\0' && qemudListenUnix(server, roSockname, 1) < 0)
|
||||
goto cleanup;
|
||||
|
||||
__virEventRegisterImpl(virEventAddHandleImpl,
|
||||
virEventUpdateHandleImpl,
|
||||
virEventRemoveHandleImpl,
|
||||
@ -734,28 +724,50 @@ static struct qemud_server *qemudInitialize(int sigread) {
|
||||
|
||||
virStateInitialize();
|
||||
|
||||
return server;
|
||||
}
|
||||
|
||||
static struct qemud_server *qemudNetworkInit(struct qemud_server *server) {
|
||||
struct qemud_socket *sock;
|
||||
char sockname[PATH_MAX];
|
||||
char roSockname[PATH_MAX];
|
||||
#if HAVE_SASL
|
||||
if ((err = sasl_server_init(NULL, "libvirt")) != SASL_OK) {
|
||||
qemudLog(QEMUD_ERR, "Failed to initialize SASL authentication %s",
|
||||
sasl_errstring(err, NULL, NULL));
|
||||
int err;
|
||||
#endif /* HAVE_SASL */
|
||||
|
||||
roSockname[0] = '\0';
|
||||
|
||||
if (qemudInitPaths(server, sockname, roSockname, PATH_MAX) < 0)
|
||||
goto cleanup;
|
||||
|
||||
if (qemudListenUnix(server, sockname, 0, auth_unix_rw) < 0)
|
||||
goto cleanup;
|
||||
|
||||
if (roSockname[0] != '\0' && qemudListenUnix(server, roSockname, 1, auth_unix_ro) < 0)
|
||||
goto cleanup;
|
||||
|
||||
#if HAVE_SASL
|
||||
if (auth_unix_rw == REMOTE_AUTH_SASL ||
|
||||
auth_unix_ro == REMOTE_AUTH_SASL ||
|
||||
auth_tcp == REMOTE_AUTH_SASL ||
|
||||
auth_tls == REMOTE_AUTH_SASL) {
|
||||
if ((err = sasl_server_init(NULL, "libvirt")) != SASL_OK) {
|
||||
qemudLog(QEMUD_ERR, "Failed to initialize SASL authentication %s",
|
||||
sasl_errstring(err, NULL, NULL));
|
||||
goto cleanup;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (ipsock) {
|
||||
#if HAVE_SASL
|
||||
if (listen_tcp && remoteListenTCP (server, tcp_port, QEMUD_SOCK_TYPE_TCP, REMOTE_AUTH_SASL) < 0)
|
||||
if (listen_tcp && remoteListenTCP (server, tcp_port, QEMUD_SOCK_TYPE_TCP, auth_tcp) < 0)
|
||||
goto cleanup;
|
||||
#else
|
||||
if (listen_tcp && remoteListenTCP (server, tcp_port, QEMUD_SOCK_TYPE_TCP, REMOTE_AUTH_NONE) < 0)
|
||||
goto cleanup;
|
||||
#endif
|
||||
|
||||
if (listen_tls) {
|
||||
if (remoteInitializeGnuTLS () < 0)
|
||||
goto cleanup;
|
||||
|
||||
if (remoteListenTCP (server, tls_port, QEMUD_SOCK_TYPE_TLS, REMOTE_AUTH_NONE) < 0)
|
||||
if (remoteListenTCP (server, tls_port, QEMUD_SOCK_TYPE_TLS, auth_tls) < 0)
|
||||
goto cleanup;
|
||||
}
|
||||
}
|
||||
@ -975,10 +987,6 @@ remoteCheckCertificate (gnutls_session_t session)
|
||||
static int
|
||||
remoteCheckAccess (struct qemud_client *client)
|
||||
{
|
||||
char addr[NI_MAXHOST];
|
||||
char **wildcards;
|
||||
int found, err;
|
||||
|
||||
/* Verify client certificate. */
|
||||
if (remoteCheckCertificate (client->tlssession) == -1) {
|
||||
qemudLog (QEMUD_ERR, "remoteCheckCertificate: failed to verify client's certificate");
|
||||
@ -986,44 +994,6 @@ remoteCheckAccess (struct qemud_client *client)
|
||||
else qemudLog (QEMUD_INFO, "remoteCheckCertificate: tls_no_verify_certificate is set so the bad certificate is ignored");
|
||||
}
|
||||
|
||||
/*----- IP address check, similar to tcp wrappers -----*/
|
||||
|
||||
/* Convert IP address to printable string (eg. "127.0.0.1" or "::1"). */
|
||||
err = getnameinfo ((struct sockaddr *) &client->addr, client->addrlen,
|
||||
addr, sizeof addr, NULL, 0,
|
||||
NI_NUMERICHOST);
|
||||
if (err != 0) {
|
||||
qemudLog (QEMUD_ERR, "getnameinfo: %s", gai_strerror (err));
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Verify the client is on the list of allowed clients.
|
||||
*
|
||||
* NB: No tls_allowed_ip_list in config file means anyone can access.
|
||||
* If tls_allowed_ip_list is in the config file but empty, means no
|
||||
* one can access (not particularly useful, but it's what the sysadmin
|
||||
* would expect).
|
||||
*/
|
||||
wildcards = tls_allowed_ip_list;
|
||||
if (wildcards) {
|
||||
found = 0;
|
||||
|
||||
while (*wildcards) {
|
||||
if (fnmatch (*wildcards, addr, 0) == 0) {
|
||||
found = 1;
|
||||
break;
|
||||
}
|
||||
wildcards++;
|
||||
}
|
||||
} else
|
||||
found = 1;
|
||||
|
||||
if (!found) {
|
||||
qemudLog (QEMUD_ERR, "remoteCheckAccess: client's IP address (%s) is not on the list of allowed clients (tls_allowed_ip_list)", addr);
|
||||
if (!tls_no_verify_address) return -1;
|
||||
else qemudLog (QEMUD_INFO, "remoteCheckAccess: tls_no_verify_address is set so the client's IP address is ignored");
|
||||
}
|
||||
|
||||
/* Checks have succeeded. Write a '\1' byte back to the client to
|
||||
* indicate this (otherwise the socket is abruptly closed).
|
||||
* (NB. The '\1' byte is sent in an encrypted record).
|
||||
@ -1148,6 +1118,7 @@ static void qemudDispatchClientFailure(struct qemud_server *server, struct qemud
|
||||
|
||||
#if HAVE_SASL
|
||||
if (client->saslconn) sasl_dispose(&client->saslconn);
|
||||
if (client->saslUsername) free(client->saslUsername);
|
||||
#endif
|
||||
if (client->tlssession) gnutls_deinit (client->tlssession);
|
||||
close(client->fd);
|
||||
@ -1649,6 +1620,14 @@ static void qemudCleanup(struct qemud_server *server) {
|
||||
sock = next;
|
||||
}
|
||||
|
||||
if (server->saslUsernameWhitelist) {
|
||||
char **list = server->saslUsernameWhitelist;
|
||||
while (*list) {
|
||||
if (*list)
|
||||
free(*list);
|
||||
list++;
|
||||
}
|
||||
}
|
||||
|
||||
virStateCleanup();
|
||||
|
||||
@ -1780,11 +1759,41 @@ checkType (virConfValuePtr p, const char *filename,
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
|
||||
static int remoteConfigGetAuth(virConfPtr conf, const char *key, int *auth, const char *filename) {
|
||||
virConfValuePtr p;
|
||||
|
||||
p = virConfGetValue (conf, key);
|
||||
if (!p)
|
||||
return 0;
|
||||
|
||||
if (p->type != VIR_CONF_STRING) {
|
||||
qemudLog (QEMUD_ERR, "remoteReadConfigFile: %s: %s: should be a string\n", filename, key);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (!p->str)
|
||||
return 0;
|
||||
|
||||
if (STREQ(p->str, "none")) {
|
||||
*auth = REMOTE_AUTH_NONE;
|
||||
#if HAVE_SASL
|
||||
} else if (STREQ(p->str, "sasl")) {
|
||||
*auth = REMOTE_AUTH_SASL;
|
||||
#endif
|
||||
} else {
|
||||
qemudLog (QEMUD_ERR, "remoteReadConfigFile: %s: %s: unsupported auth %s\n", filename, key, p->str);
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Read the config file if it exists.
|
||||
* Only used in the remote case, hence the name.
|
||||
*/
|
||||
static int
|
||||
remoteReadConfigFile (const char *filename)
|
||||
remoteReadConfigFile (struct qemud_server *server, const char *filename)
|
||||
{
|
||||
virConfPtr conf;
|
||||
|
||||
@ -1805,6 +1814,15 @@ remoteReadConfigFile (const char *filename)
|
||||
GET_CONF_STR (conf, filename, tls_port);
|
||||
GET_CONF_STR (conf, filename, tcp_port);
|
||||
|
||||
if (remoteConfigGetAuth(conf, "auth_unix_rw", &auth_unix_rw, filename) < 0)
|
||||
return -1;
|
||||
if (remoteConfigGetAuth(conf, "auth_unix_ro", &auth_unix_ro, filename) < 0)
|
||||
return -1;
|
||||
if (remoteConfigGetAuth(conf, "auth_tcp", &auth_tcp, filename) < 0)
|
||||
return -1;
|
||||
if (remoteConfigGetAuth(conf, "auth_tls", &auth_tls, filename) < 0)
|
||||
return -1;
|
||||
|
||||
GET_CONF_STR (conf, filename, unix_sock_group);
|
||||
if (unix_sock_group) {
|
||||
if (getuid() != 0) {
|
||||
@ -1848,7 +1866,6 @@ remoteReadConfigFile (const char *filename)
|
||||
GET_CONF_STR (conf, filename, mdns_name);
|
||||
|
||||
GET_CONF_INT (conf, filename, tls_no_verify_certificate);
|
||||
GET_CONF_INT (conf, filename, tls_no_verify_address);
|
||||
|
||||
GET_CONF_STR (conf, filename, key_file);
|
||||
GET_CONF_STR (conf, filename, cert_file);
|
||||
@ -1859,8 +1876,8 @@ remoteReadConfigFile (const char *filename)
|
||||
&tls_allowed_dn_list, filename) < 0)
|
||||
goto free_and_fail;
|
||||
|
||||
if (remoteConfigGetStringList (conf, "tls_allowed_ip_list",
|
||||
&tls_allowed_ip_list, filename) < 0)
|
||||
if (remoteConfigGetStringList (conf, "sasl_allowed_username_list",
|
||||
&server->saslUsernameWhitelist, filename) < 0)
|
||||
goto free_and_fail;
|
||||
|
||||
virConfFree (conf);
|
||||
@ -1888,14 +1905,6 @@ remoteReadConfigFile (const char *filename)
|
||||
tls_allowed_dn_list = NULL;
|
||||
}
|
||||
|
||||
if (tls_allowed_ip_list) {
|
||||
int i;
|
||||
for (i = 0; tls_allowed_ip_list[i]; i++)
|
||||
free (tls_allowed_ip_list[i]);
|
||||
free (tls_allowed_ip_list);
|
||||
tls_allowed_ip_list = NULL;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -2016,13 +2025,6 @@ int main(int argc, char **argv) {
|
||||
}
|
||||
}
|
||||
|
||||
/* Read the config file (if it exists). */
|
||||
if (remoteReadConfigFile (remote_config_file) < 0)
|
||||
goto error1;
|
||||
|
||||
if (godaemon)
|
||||
openlog("libvirtd", 0, 0);
|
||||
|
||||
if (pipe(sigpipe) < 0 ||
|
||||
qemudSetNonBlock(sigpipe[0]) < 0 ||
|
||||
qemudSetNonBlock(sigpipe[1]) < 0) {
|
||||
@ -2030,24 +2032,21 @@ int main(int argc, char **argv) {
|
||||
strerror(errno));
|
||||
goto error1;
|
||||
}
|
||||
|
||||
sigwrite = sigpipe[1];
|
||||
|
||||
sig_action.sa_handler = sig_handler;
|
||||
sig_action.sa_flags = 0;
|
||||
sigemptyset(&sig_action.sa_mask);
|
||||
if (!(server = qemudInitialize(sigpipe[0]))) {
|
||||
ret = 2;
|
||||
goto error1;
|
||||
}
|
||||
|
||||
sigaction(SIGHUP, &sig_action, NULL);
|
||||
sigaction(SIGINT, &sig_action, NULL);
|
||||
sigaction(SIGQUIT, &sig_action, NULL);
|
||||
sigaction(SIGTERM, &sig_action, NULL);
|
||||
sigaction(SIGCHLD, &sig_action, NULL);
|
||||
|
||||
sig_action.sa_handler = SIG_IGN;
|
||||
sigaction(SIGPIPE, &sig_action, NULL);
|
||||
/* Read the config file (if it exists). */
|
||||
if (remoteReadConfigFile (server, remote_config_file) < 0)
|
||||
goto error1;
|
||||
|
||||
if (godaemon) {
|
||||
int pid = qemudGoDaemon();
|
||||
int pid;
|
||||
openlog("libvirtd", 0, 0);
|
||||
pid = qemudGoDaemon();
|
||||
if (pid < 0) {
|
||||
qemudLog(QEMUD_ERR, "Failed to fork as daemon: %s",
|
||||
strerror(errno));
|
||||
@ -2066,10 +2065,18 @@ int main(int argc, char **argv) {
|
||||
goto error1;
|
||||
}
|
||||
|
||||
if (!(server = qemudInitialize(sigpipe[0]))) {
|
||||
ret = 2;
|
||||
goto error2;
|
||||
}
|
||||
sig_action.sa_handler = sig_handler;
|
||||
sig_action.sa_flags = 0;
|
||||
sigemptyset(&sig_action.sa_mask);
|
||||
|
||||
sigaction(SIGHUP, &sig_action, NULL);
|
||||
sigaction(SIGINT, &sig_action, NULL);
|
||||
sigaction(SIGQUIT, &sig_action, NULL);
|
||||
sigaction(SIGTERM, &sig_action, NULL);
|
||||
sigaction(SIGCHLD, &sig_action, NULL);
|
||||
|
||||
sig_action.sa_handler = SIG_IGN;
|
||||
sigaction(SIGPIPE, &sig_action, NULL);
|
||||
|
||||
if (virEventAddHandleImpl(sigpipe[0],
|
||||
POLLIN,
|
||||
@ -2080,6 +2087,11 @@ int main(int argc, char **argv) {
|
||||
goto error2;
|
||||
}
|
||||
|
||||
if (!(server = qemudNetworkInit(server))) {
|
||||
ret = 2;
|
||||
goto error2;
|
||||
}
|
||||
|
||||
qemudRunLoop(server);
|
||||
|
||||
qemudCleanup(server);
|
||||
|
290
qemud/remote.c
290
qemud/remote.c
@ -44,6 +44,7 @@
|
||||
#include <getopt.h>
|
||||
#include <ctype.h>
|
||||
#include <assert.h>
|
||||
#include <fnmatch.h>
|
||||
|
||||
#include "libvirt/virterror.h"
|
||||
|
||||
@ -65,14 +66,18 @@ static void make_nonnull_network (remote_nonnull_network *net_dst, virNetworkPtr
|
||||
|
||||
#include "remote_dispatch_prototypes.h"
|
||||
|
||||
typedef int (*dispatch_fn) (struct qemud_client *client, remote_message_header *req, char *args, char *ret);
|
||||
typedef int (*dispatch_fn) (struct qemud_server *server,
|
||||
struct qemud_client *client,
|
||||
remote_message_header *req,
|
||||
char *args,
|
||||
char *ret);
|
||||
|
||||
/* This function gets called from qemud when it detects an incoming
|
||||
* remote protocol message. At this point, client->buffer contains
|
||||
* the full call message (including length word which we skip).
|
||||
*/
|
||||
void
|
||||
remoteDispatchClientRequest (struct qemud_server *server ATTRIBUTE_UNUSED,
|
||||
remoteDispatchClientRequest (struct qemud_server *server,
|
||||
struct qemud_client *client)
|
||||
{
|
||||
XDR xdr;
|
||||
@ -158,7 +163,7 @@ remoteDispatchClientRequest (struct qemud_server *server ATTRIBUTE_UNUSED,
|
||||
xdr_destroy (&xdr);
|
||||
|
||||
/* Call function. */
|
||||
rv = fn (client, &req, args, ret);
|
||||
rv = fn (server, client, &req, args, ret);
|
||||
xdr_free (args_filter, args);
|
||||
|
||||
/* Dispatch function must return -2, -1 or 0. Anything else is
|
||||
@ -398,7 +403,8 @@ remoteDispatchError (struct qemud_client *client,
|
||||
/*----- Functions. -----*/
|
||||
|
||||
static int
|
||||
remoteDispatchOpen (struct qemud_client *client, remote_message_header *req,
|
||||
remoteDispatchOpen (struct qemud_server *server ATTRIBUTE_UNUSED,
|
||||
struct qemud_client *client, remote_message_header *req,
|
||||
struct remote_open_args *args, void *ret ATTRIBUTE_UNUSED)
|
||||
{
|
||||
const char *name;
|
||||
@ -437,7 +443,8 @@ remoteDispatchOpen (struct qemud_client *client, remote_message_header *req,
|
||||
}
|
||||
|
||||
static int
|
||||
remoteDispatchClose (struct qemud_client *client, remote_message_header *req,
|
||||
remoteDispatchClose (struct qemud_server *server ATTRIBUTE_UNUSED,
|
||||
struct qemud_client *client, remote_message_header *req,
|
||||
void *args ATTRIBUTE_UNUSED, void *ret ATTRIBUTE_UNUSED)
|
||||
{
|
||||
int rv;
|
||||
@ -450,7 +457,8 @@ remoteDispatchClose (struct qemud_client *client, remote_message_header *req,
|
||||
}
|
||||
|
||||
static int
|
||||
remoteDispatchSupportsFeature (struct qemud_client *client, remote_message_header *req,
|
||||
remoteDispatchSupportsFeature (struct qemud_server *server ATTRIBUTE_UNUSED,
|
||||
struct qemud_client *client, remote_message_header *req,
|
||||
remote_supports_feature_args *args, remote_supports_feature_ret *ret)
|
||||
{
|
||||
CHECK_CONN(client);
|
||||
@ -462,7 +470,8 @@ remoteDispatchSupportsFeature (struct qemud_client *client, remote_message_heade
|
||||
}
|
||||
|
||||
static int
|
||||
remoteDispatchGetType (struct qemud_client *client, remote_message_header *req,
|
||||
remoteDispatchGetType (struct qemud_server *server ATTRIBUTE_UNUSED,
|
||||
struct qemud_client *client, remote_message_header *req,
|
||||
void *args ATTRIBUTE_UNUSED, remote_get_type_ret *ret)
|
||||
{
|
||||
const char *type;
|
||||
@ -484,7 +493,8 @@ remoteDispatchGetType (struct qemud_client *client, remote_message_header *req,
|
||||
}
|
||||
|
||||
static int
|
||||
remoteDispatchGetVersion (struct qemud_client *client,
|
||||
remoteDispatchGetVersion (struct qemud_server *server ATTRIBUTE_UNUSED,
|
||||
struct qemud_client *client,
|
||||
remote_message_header *req,
|
||||
void *args ATTRIBUTE_UNUSED,
|
||||
remote_get_version_ret *ret)
|
||||
@ -500,7 +510,8 @@ remoteDispatchGetVersion (struct qemud_client *client,
|
||||
}
|
||||
|
||||
static int
|
||||
remoteDispatchGetHostname (struct qemud_client *client,
|
||||
remoteDispatchGetHostname (struct qemud_server *server ATTRIBUTE_UNUSED,
|
||||
struct qemud_client *client,
|
||||
remote_message_header *req,
|
||||
void *args ATTRIBUTE_UNUSED,
|
||||
remote_get_hostname_ret *ret)
|
||||
@ -516,7 +527,8 @@ remoteDispatchGetHostname (struct qemud_client *client,
|
||||
}
|
||||
|
||||
static int
|
||||
remoteDispatchGetMaxVcpus (struct qemud_client *client,
|
||||
remoteDispatchGetMaxVcpus (struct qemud_server *server ATTRIBUTE_UNUSED,
|
||||
struct qemud_client *client,
|
||||
remote_message_header *req,
|
||||
remote_get_max_vcpus_args *args,
|
||||
remote_get_max_vcpus_ret *ret)
|
||||
@ -532,7 +544,8 @@ remoteDispatchGetMaxVcpus (struct qemud_client *client,
|
||||
}
|
||||
|
||||
static int
|
||||
remoteDispatchNodeGetInfo (struct qemud_client *client,
|
||||
remoteDispatchNodeGetInfo (struct qemud_server *server ATTRIBUTE_UNUSED,
|
||||
struct qemud_client *client,
|
||||
remote_message_header *req,
|
||||
void *args ATTRIBUTE_UNUSED,
|
||||
remote_node_get_info_ret *ret)
|
||||
@ -556,7 +569,8 @@ remoteDispatchNodeGetInfo (struct qemud_client *client,
|
||||
}
|
||||
|
||||
static int
|
||||
remoteDispatchGetCapabilities (struct qemud_client *client,
|
||||
remoteDispatchGetCapabilities (struct qemud_server *server ATTRIBUTE_UNUSED,
|
||||
struct qemud_client *client,
|
||||
remote_message_header *req,
|
||||
void *args ATTRIBUTE_UNUSED,
|
||||
remote_get_capabilities_ret *ret)
|
||||
@ -572,7 +586,8 @@ remoteDispatchGetCapabilities (struct qemud_client *client,
|
||||
}
|
||||
|
||||
static int
|
||||
remoteDispatchDomainGetSchedulerType (struct qemud_client *client,
|
||||
remoteDispatchDomainGetSchedulerType (struct qemud_server *server ATTRIBUTE_UNUSED,
|
||||
struct qemud_client *client,
|
||||
remote_message_header *req,
|
||||
remote_domain_get_scheduler_type_args *args,
|
||||
remote_domain_get_scheduler_type_ret *ret)
|
||||
@ -601,7 +616,8 @@ remoteDispatchDomainGetSchedulerType (struct qemud_client *client,
|
||||
}
|
||||
|
||||
static int
|
||||
remoteDispatchDomainGetSchedulerParameters (struct qemud_client *client,
|
||||
remoteDispatchDomainGetSchedulerParameters (struct qemud_server *server ATTRIBUTE_UNUSED,
|
||||
struct qemud_client *client,
|
||||
remote_message_header *req,
|
||||
remote_domain_get_scheduler_parameters_args *args,
|
||||
remote_domain_get_scheduler_parameters_ret *ret)
|
||||
@ -687,7 +703,8 @@ remoteDispatchDomainGetSchedulerParameters (struct qemud_client *client,
|
||||
}
|
||||
|
||||
static int
|
||||
remoteDispatchDomainSetSchedulerParameters (struct qemud_client *client,
|
||||
remoteDispatchDomainSetSchedulerParameters (struct qemud_server *server ATTRIBUTE_UNUSED,
|
||||
struct qemud_client *client,
|
||||
remote_message_header *req,
|
||||
remote_domain_set_scheduler_parameters_args *args,
|
||||
void *ret ATTRIBUTE_UNUSED)
|
||||
@ -747,7 +764,8 @@ remoteDispatchDomainSetSchedulerParameters (struct qemud_client *client,
|
||||
}
|
||||
|
||||
static int
|
||||
remoteDispatchDomainBlockStats (struct qemud_client *client,
|
||||
remoteDispatchDomainBlockStats (struct qemud_server *server ATTRIBUTE_UNUSED,
|
||||
struct qemud_client *client,
|
||||
remote_message_header *req,
|
||||
remote_domain_block_stats_args *args,
|
||||
remote_domain_block_stats_ret *ret)
|
||||
@ -777,7 +795,8 @@ remoteDispatchDomainBlockStats (struct qemud_client *client,
|
||||
}
|
||||
|
||||
static int
|
||||
remoteDispatchDomainInterfaceStats (struct qemud_client *client,
|
||||
remoteDispatchDomainInterfaceStats (struct qemud_server *server ATTRIBUTE_UNUSED,
|
||||
struct qemud_client *client,
|
||||
remote_message_header *req,
|
||||
remote_domain_interface_stats_args *args,
|
||||
remote_domain_interface_stats_ret *ret)
|
||||
@ -810,7 +829,8 @@ remoteDispatchDomainInterfaceStats (struct qemud_client *client,
|
||||
}
|
||||
|
||||
static int
|
||||
remoteDispatchDomainAttachDevice (struct qemud_client *client,
|
||||
remoteDispatchDomainAttachDevice (struct qemud_server *server ATTRIBUTE_UNUSED,
|
||||
struct qemud_client *client,
|
||||
remote_message_header *req,
|
||||
remote_domain_attach_device_args *args,
|
||||
void *ret ATTRIBUTE_UNUSED)
|
||||
@ -833,7 +853,8 @@ remoteDispatchDomainAttachDevice (struct qemud_client *client,
|
||||
}
|
||||
|
||||
static int
|
||||
remoteDispatchDomainCreate (struct qemud_client *client,
|
||||
remoteDispatchDomainCreate (struct qemud_server *server ATTRIBUTE_UNUSED,
|
||||
struct qemud_client *client,
|
||||
remote_message_header *req,
|
||||
remote_domain_create_args *args,
|
||||
void *ret ATTRIBUTE_UNUSED)
|
||||
@ -856,7 +877,8 @@ remoteDispatchDomainCreate (struct qemud_client *client,
|
||||
}
|
||||
|
||||
static int
|
||||
remoteDispatchDomainCreateLinux (struct qemud_client *client,
|
||||
remoteDispatchDomainCreateLinux (struct qemud_server *server ATTRIBUTE_UNUSED,
|
||||
struct qemud_client *client,
|
||||
remote_message_header *req,
|
||||
remote_domain_create_linux_args *args,
|
||||
remote_domain_create_linux_ret *ret)
|
||||
@ -874,7 +896,8 @@ remoteDispatchDomainCreateLinux (struct qemud_client *client,
|
||||
}
|
||||
|
||||
static int
|
||||
remoteDispatchDomainDefineXml (struct qemud_client *client,
|
||||
remoteDispatchDomainDefineXml (struct qemud_server *server ATTRIBUTE_UNUSED,
|
||||
struct qemud_client *client,
|
||||
remote_message_header *req,
|
||||
remote_domain_define_xml_args *args,
|
||||
remote_domain_define_xml_ret *ret)
|
||||
@ -892,7 +915,8 @@ remoteDispatchDomainDefineXml (struct qemud_client *client,
|
||||
}
|
||||
|
||||
static int
|
||||
remoteDispatchDomainDestroy (struct qemud_client *client,
|
||||
remoteDispatchDomainDestroy (struct qemud_server *server ATTRIBUTE_UNUSED,
|
||||
struct qemud_client *client,
|
||||
remote_message_header *req,
|
||||
remote_domain_destroy_args *args,
|
||||
void *ret ATTRIBUTE_UNUSED)
|
||||
@ -913,7 +937,8 @@ remoteDispatchDomainDestroy (struct qemud_client *client,
|
||||
}
|
||||
|
||||
static int
|
||||
remoteDispatchDomainDetachDevice (struct qemud_client *client,
|
||||
remoteDispatchDomainDetachDevice (struct qemud_server *server ATTRIBUTE_UNUSED,
|
||||
struct qemud_client *client,
|
||||
remote_message_header *req,
|
||||
remote_domain_detach_device_args *args,
|
||||
void *ret ATTRIBUTE_UNUSED)
|
||||
@ -937,7 +962,8 @@ remoteDispatchDomainDetachDevice (struct qemud_client *client,
|
||||
}
|
||||
|
||||
static int
|
||||
remoteDispatchDomainDumpXml (struct qemud_client *client,
|
||||
remoteDispatchDomainDumpXml (struct qemud_server *server ATTRIBUTE_UNUSED,
|
||||
struct qemud_client *client,
|
||||
remote_message_header *req,
|
||||
remote_domain_dump_xml_args *args,
|
||||
remote_domain_dump_xml_ret *ret)
|
||||
@ -962,7 +988,8 @@ remoteDispatchDomainDumpXml (struct qemud_client *client,
|
||||
}
|
||||
|
||||
static int
|
||||
remoteDispatchDomainGetAutostart (struct qemud_client *client,
|
||||
remoteDispatchDomainGetAutostart (struct qemud_server *server ATTRIBUTE_UNUSED,
|
||||
struct qemud_client *client,
|
||||
remote_message_header *req,
|
||||
remote_domain_get_autostart_args *args,
|
||||
remote_domain_get_autostart_ret *ret)
|
||||
@ -985,7 +1012,8 @@ remoteDispatchDomainGetAutostart (struct qemud_client *client,
|
||||
}
|
||||
|
||||
static int
|
||||
remoteDispatchDomainGetInfo (struct qemud_client *client,
|
||||
remoteDispatchDomainGetInfo (struct qemud_server *server ATTRIBUTE_UNUSED,
|
||||
struct qemud_client *client,
|
||||
remote_message_header *req,
|
||||
remote_domain_get_info_args *args,
|
||||
remote_domain_get_info_ret *ret)
|
||||
@ -1017,7 +1045,8 @@ remoteDispatchDomainGetInfo (struct qemud_client *client,
|
||||
}
|
||||
|
||||
static int
|
||||
remoteDispatchDomainGetMaxMemory (struct qemud_client *client,
|
||||
remoteDispatchDomainGetMaxMemory (struct qemud_server *server ATTRIBUTE_UNUSED,
|
||||
struct qemud_client *client,
|
||||
remote_message_header *req,
|
||||
remote_domain_get_max_memory_args *args,
|
||||
remote_domain_get_max_memory_ret *ret)
|
||||
@ -1041,7 +1070,8 @@ remoteDispatchDomainGetMaxMemory (struct qemud_client *client,
|
||||
}
|
||||
|
||||
static int
|
||||
remoteDispatchDomainGetMaxVcpus (struct qemud_client *client,
|
||||
remoteDispatchDomainGetMaxVcpus (struct qemud_server *server ATTRIBUTE_UNUSED,
|
||||
struct qemud_client *client,
|
||||
remote_message_header *req,
|
||||
remote_domain_get_max_vcpus_args *args,
|
||||
remote_domain_get_max_vcpus_ret *ret)
|
||||
@ -1065,7 +1095,8 @@ remoteDispatchDomainGetMaxVcpus (struct qemud_client *client,
|
||||
}
|
||||
|
||||
static int
|
||||
remoteDispatchDomainGetOsType (struct qemud_client *client,
|
||||
remoteDispatchDomainGetOsType (struct qemud_server *server ATTRIBUTE_UNUSED,
|
||||
struct qemud_client *client,
|
||||
remote_message_header *req,
|
||||
remote_domain_get_os_type_args *args,
|
||||
remote_domain_get_os_type_ret *ret)
|
||||
@ -1090,7 +1121,8 @@ remoteDispatchDomainGetOsType (struct qemud_client *client,
|
||||
}
|
||||
|
||||
static int
|
||||
remoteDispatchDomainGetVcpus (struct qemud_client *client,
|
||||
remoteDispatchDomainGetVcpus (struct qemud_server *server ATTRIBUTE_UNUSED,
|
||||
struct qemud_client *client,
|
||||
remote_message_header *req,
|
||||
remote_domain_get_vcpus_args *args,
|
||||
remote_domain_get_vcpus_ret *ret)
|
||||
@ -1154,7 +1186,8 @@ remoteDispatchDomainGetVcpus (struct qemud_client *client,
|
||||
}
|
||||
|
||||
static int
|
||||
remoteDispatchDomainMigratePrepare (struct qemud_client *client,
|
||||
remoteDispatchDomainMigratePrepare (struct qemud_server *server ATTRIBUTE_UNUSED,
|
||||
struct qemud_client *client,
|
||||
remote_message_header *req,
|
||||
remote_domain_migrate_prepare_args *args,
|
||||
remote_domain_migrate_prepare_ret *ret)
|
||||
@ -1189,7 +1222,8 @@ remoteDispatchDomainMigratePrepare (struct qemud_client *client,
|
||||
}
|
||||
|
||||
static int
|
||||
remoteDispatchDomainMigratePerform (struct qemud_client *client,
|
||||
remoteDispatchDomainMigratePerform (struct qemud_server *server ATTRIBUTE_UNUSED,
|
||||
struct qemud_client *client,
|
||||
remote_message_header *req,
|
||||
remote_domain_migrate_perform_args *args,
|
||||
void *ret ATTRIBUTE_UNUSED)
|
||||
@ -1218,7 +1252,8 @@ remoteDispatchDomainMigratePerform (struct qemud_client *client,
|
||||
}
|
||||
|
||||
static int
|
||||
remoteDispatchDomainMigrateFinish (struct qemud_client *client,
|
||||
remoteDispatchDomainMigrateFinish (struct qemud_server *server ATTRIBUTE_UNUSED,
|
||||
struct qemud_client *client,
|
||||
remote_message_header *req,
|
||||
remote_domain_migrate_finish_args *args,
|
||||
remote_domain_migrate_finish_ret *ret)
|
||||
@ -1239,7 +1274,8 @@ remoteDispatchDomainMigrateFinish (struct qemud_client *client,
|
||||
}
|
||||
|
||||
static int
|
||||
remoteDispatchListDefinedDomains (struct qemud_client *client,
|
||||
remoteDispatchListDefinedDomains (struct qemud_server *server ATTRIBUTE_UNUSED,
|
||||
struct qemud_client *client,
|
||||
remote_message_header *req,
|
||||
remote_list_defined_domains_args *args,
|
||||
remote_list_defined_domains_ret *ret)
|
||||
@ -1264,7 +1300,8 @@ remoteDispatchListDefinedDomains (struct qemud_client *client,
|
||||
}
|
||||
|
||||
static int
|
||||
remoteDispatchDomainLookupById (struct qemud_client *client,
|
||||
remoteDispatchDomainLookupById (struct qemud_server *server ATTRIBUTE_UNUSED,
|
||||
struct qemud_client *client,
|
||||
remote_message_header *req,
|
||||
remote_domain_lookup_by_id_args *args,
|
||||
remote_domain_lookup_by_id_ret *ret)
|
||||
@ -1281,7 +1318,8 @@ remoteDispatchDomainLookupById (struct qemud_client *client,
|
||||
}
|
||||
|
||||
static int
|
||||
remoteDispatchDomainLookupByName (struct qemud_client *client,
|
||||
remoteDispatchDomainLookupByName (struct qemud_server *server ATTRIBUTE_UNUSED,
|
||||
struct qemud_client *client,
|
||||
remote_message_header *req,
|
||||
remote_domain_lookup_by_name_args *args,
|
||||
remote_domain_lookup_by_name_ret *ret)
|
||||
@ -1298,7 +1336,8 @@ remoteDispatchDomainLookupByName (struct qemud_client *client,
|
||||
}
|
||||
|
||||
static int
|
||||
remoteDispatchDomainLookupByUuid (struct qemud_client *client,
|
||||
remoteDispatchDomainLookupByUuid (struct qemud_server *server ATTRIBUTE_UNUSED,
|
||||
struct qemud_client *client,
|
||||
remote_message_header *req,
|
||||
remote_domain_lookup_by_uuid_args *args,
|
||||
remote_domain_lookup_by_uuid_ret *ret)
|
||||
@ -1315,7 +1354,8 @@ remoteDispatchDomainLookupByUuid (struct qemud_client *client,
|
||||
}
|
||||
|
||||
static int
|
||||
remoteDispatchNumOfDefinedDomains (struct qemud_client *client,
|
||||
remoteDispatchNumOfDefinedDomains (struct qemud_server *server ATTRIBUTE_UNUSED,
|
||||
struct qemud_client *client,
|
||||
remote_message_header *req,
|
||||
void *args ATTRIBUTE_UNUSED,
|
||||
remote_num_of_defined_domains_ret *ret)
|
||||
@ -1329,7 +1369,8 @@ remoteDispatchNumOfDefinedDomains (struct qemud_client *client,
|
||||
}
|
||||
|
||||
static int
|
||||
remoteDispatchDomainPinVcpu (struct qemud_client *client,
|
||||
remoteDispatchDomainPinVcpu (struct qemud_server *server ATTRIBUTE_UNUSED,
|
||||
struct qemud_client *client,
|
||||
remote_message_header *req,
|
||||
remote_domain_pin_vcpu_args *args,
|
||||
void *ret ATTRIBUTE_UNUSED)
|
||||
@ -1362,7 +1403,8 @@ remoteDispatchDomainPinVcpu (struct qemud_client *client,
|
||||
}
|
||||
|
||||
static int
|
||||
remoteDispatchDomainReboot (struct qemud_client *client,
|
||||
remoteDispatchDomainReboot (struct qemud_server *server ATTRIBUTE_UNUSED,
|
||||
struct qemud_client *client,
|
||||
remote_message_header *req,
|
||||
remote_domain_reboot_args *args,
|
||||
void *ret ATTRIBUTE_UNUSED)
|
||||
@ -1385,7 +1427,8 @@ remoteDispatchDomainReboot (struct qemud_client *client,
|
||||
}
|
||||
|
||||
static int
|
||||
remoteDispatchDomainRestore (struct qemud_client *client,
|
||||
remoteDispatchDomainRestore (struct qemud_server *server ATTRIBUTE_UNUSED,
|
||||
struct qemud_client *client,
|
||||
remote_message_header *req,
|
||||
remote_domain_restore_args *args,
|
||||
void *ret ATTRIBUTE_UNUSED)
|
||||
@ -1399,7 +1442,8 @@ remoteDispatchDomainRestore (struct qemud_client *client,
|
||||
}
|
||||
|
||||
static int
|
||||
remoteDispatchDomainResume (struct qemud_client *client,
|
||||
remoteDispatchDomainResume (struct qemud_server *server ATTRIBUTE_UNUSED,
|
||||
struct qemud_client *client,
|
||||
remote_message_header *req,
|
||||
remote_domain_resume_args *args,
|
||||
void *ret ATTRIBUTE_UNUSED)
|
||||
@ -1422,7 +1466,8 @@ remoteDispatchDomainResume (struct qemud_client *client,
|
||||
}
|
||||
|
||||
static int
|
||||
remoteDispatchDomainSave (struct qemud_client *client,
|
||||
remoteDispatchDomainSave (struct qemud_server *server ATTRIBUTE_UNUSED,
|
||||
struct qemud_client *client,
|
||||
remote_message_header *req,
|
||||
remote_domain_save_args *args,
|
||||
void *ret ATTRIBUTE_UNUSED)
|
||||
@ -1445,7 +1490,8 @@ remoteDispatchDomainSave (struct qemud_client *client,
|
||||
}
|
||||
|
||||
static int
|
||||
remoteDispatchDomainCoreDump (struct qemud_client *client,
|
||||
remoteDispatchDomainCoreDump (struct qemud_server *server ATTRIBUTE_UNUSED,
|
||||
struct qemud_client *client,
|
||||
remote_message_header *req,
|
||||
remote_domain_core_dump_args *args,
|
||||
void *ret ATTRIBUTE_UNUSED)
|
||||
@ -1468,7 +1514,8 @@ remoteDispatchDomainCoreDump (struct qemud_client *client,
|
||||
}
|
||||
|
||||
static int
|
||||
remoteDispatchDomainSetAutostart (struct qemud_client *client,
|
||||
remoteDispatchDomainSetAutostart (struct qemud_server *server ATTRIBUTE_UNUSED,
|
||||
struct qemud_client *client,
|
||||
remote_message_header *req,
|
||||
remote_domain_set_autostart_args *args,
|
||||
void *ret ATTRIBUTE_UNUSED)
|
||||
@ -1491,7 +1538,8 @@ remoteDispatchDomainSetAutostart (struct qemud_client *client,
|
||||
}
|
||||
|
||||
static int
|
||||
remoteDispatchDomainSetMaxMemory (struct qemud_client *client,
|
||||
remoteDispatchDomainSetMaxMemory (struct qemud_server *server ATTRIBUTE_UNUSED,
|
||||
struct qemud_client *client,
|
||||
remote_message_header *req,
|
||||
remote_domain_set_max_memory_args *args,
|
||||
void *ret ATTRIBUTE_UNUSED)
|
||||
@ -1514,7 +1562,8 @@ remoteDispatchDomainSetMaxMemory (struct qemud_client *client,
|
||||
}
|
||||
|
||||
static int
|
||||
remoteDispatchDomainSetMemory (struct qemud_client *client,
|
||||
remoteDispatchDomainSetMemory (struct qemud_server *server ATTRIBUTE_UNUSED,
|
||||
struct qemud_client *client,
|
||||
remote_message_header *req,
|
||||
remote_domain_set_memory_args *args,
|
||||
void *ret ATTRIBUTE_UNUSED)
|
||||
@ -1537,7 +1586,8 @@ remoteDispatchDomainSetMemory (struct qemud_client *client,
|
||||
}
|
||||
|
||||
static int
|
||||
remoteDispatchDomainSetVcpus (struct qemud_client *client,
|
||||
remoteDispatchDomainSetVcpus (struct qemud_server *server ATTRIBUTE_UNUSED,
|
||||
struct qemud_client *client,
|
||||
remote_message_header *req,
|
||||
remote_domain_set_vcpus_args *args,
|
||||
void *ret ATTRIBUTE_UNUSED)
|
||||
@ -1560,7 +1610,8 @@ remoteDispatchDomainSetVcpus (struct qemud_client *client,
|
||||
}
|
||||
|
||||
static int
|
||||
remoteDispatchDomainShutdown (struct qemud_client *client,
|
||||
remoteDispatchDomainShutdown (struct qemud_server *server ATTRIBUTE_UNUSED,
|
||||
struct qemud_client *client,
|
||||
remote_message_header *req,
|
||||
remote_domain_shutdown_args *args,
|
||||
void *ret ATTRIBUTE_UNUSED)
|
||||
@ -1583,7 +1634,8 @@ remoteDispatchDomainShutdown (struct qemud_client *client,
|
||||
}
|
||||
|
||||
static int
|
||||
remoteDispatchDomainSuspend (struct qemud_client *client,
|
||||
remoteDispatchDomainSuspend (struct qemud_server *server ATTRIBUTE_UNUSED,
|
||||
struct qemud_client *client,
|
||||
remote_message_header *req,
|
||||
remote_domain_suspend_args *args,
|
||||
void *ret ATTRIBUTE_UNUSED)
|
||||
@ -1606,7 +1658,8 @@ remoteDispatchDomainSuspend (struct qemud_client *client,
|
||||
}
|
||||
|
||||
static int
|
||||
remoteDispatchDomainUndefine (struct qemud_client *client,
|
||||
remoteDispatchDomainUndefine (struct qemud_server *server ATTRIBUTE_UNUSED,
|
||||
struct qemud_client *client,
|
||||
remote_message_header *req,
|
||||
remote_domain_undefine_args *args,
|
||||
void *ret ATTRIBUTE_UNUSED)
|
||||
@ -1629,7 +1682,8 @@ remoteDispatchDomainUndefine (struct qemud_client *client,
|
||||
}
|
||||
|
||||
static int
|
||||
remoteDispatchListDefinedNetworks (struct qemud_client *client,
|
||||
remoteDispatchListDefinedNetworks (struct qemud_server *server ATTRIBUTE_UNUSED,
|
||||
struct qemud_client *client,
|
||||
remote_message_header *req,
|
||||
remote_list_defined_networks_args *args,
|
||||
remote_list_defined_networks_ret *ret)
|
||||
@ -1654,7 +1708,8 @@ remoteDispatchListDefinedNetworks (struct qemud_client *client,
|
||||
}
|
||||
|
||||
static int
|
||||
remoteDispatchListDomains (struct qemud_client *client,
|
||||
remoteDispatchListDomains (struct qemud_server *server ATTRIBUTE_UNUSED,
|
||||
struct qemud_client *client,
|
||||
remote_message_header *req,
|
||||
remote_list_domains_args *args,
|
||||
remote_list_domains_ret *ret)
|
||||
@ -1678,7 +1733,8 @@ remoteDispatchListDomains (struct qemud_client *client,
|
||||
}
|
||||
|
||||
static int
|
||||
remoteDispatchListNetworks (struct qemud_client *client,
|
||||
remoteDispatchListNetworks (struct qemud_server *server ATTRIBUTE_UNUSED,
|
||||
struct qemud_client *client,
|
||||
remote_message_header *req,
|
||||
remote_list_networks_args *args,
|
||||
remote_list_networks_ret *ret)
|
||||
@ -1703,7 +1759,8 @@ remoteDispatchListNetworks (struct qemud_client *client,
|
||||
}
|
||||
|
||||
static int
|
||||
remoteDispatchNetworkCreate (struct qemud_client *client,
|
||||
remoteDispatchNetworkCreate (struct qemud_server *server ATTRIBUTE_UNUSED,
|
||||
struct qemud_client *client,
|
||||
remote_message_header *req,
|
||||
remote_network_create_args *args,
|
||||
void *ret ATTRIBUTE_UNUSED)
|
||||
@ -1726,7 +1783,8 @@ remoteDispatchNetworkCreate (struct qemud_client *client,
|
||||
}
|
||||
|
||||
static int
|
||||
remoteDispatchNetworkCreateXml (struct qemud_client *client,
|
||||
remoteDispatchNetworkCreateXml (struct qemud_server *server ATTRIBUTE_UNUSED,
|
||||
struct qemud_client *client,
|
||||
remote_message_header *req,
|
||||
remote_network_create_xml_args *args,
|
||||
remote_network_create_xml_ret *ret)
|
||||
@ -1743,7 +1801,8 @@ remoteDispatchNetworkCreateXml (struct qemud_client *client,
|
||||
}
|
||||
|
||||
static int
|
||||
remoteDispatchNetworkDefineXml (struct qemud_client *client,
|
||||
remoteDispatchNetworkDefineXml (struct qemud_server *server ATTRIBUTE_UNUSED,
|
||||
struct qemud_client *client,
|
||||
remote_message_header *req,
|
||||
remote_network_define_xml_args *args,
|
||||
remote_network_define_xml_ret *ret)
|
||||
@ -1760,7 +1819,8 @@ remoteDispatchNetworkDefineXml (struct qemud_client *client,
|
||||
}
|
||||
|
||||
static int
|
||||
remoteDispatchNetworkDestroy (struct qemud_client *client,
|
||||
remoteDispatchNetworkDestroy (struct qemud_server *server ATTRIBUTE_UNUSED,
|
||||
struct qemud_client *client,
|
||||
remote_message_header *req,
|
||||
remote_network_destroy_args *args,
|
||||
void *ret ATTRIBUTE_UNUSED)
|
||||
@ -1783,7 +1843,8 @@ remoteDispatchNetworkDestroy (struct qemud_client *client,
|
||||
}
|
||||
|
||||
static int
|
||||
remoteDispatchNetworkDumpXml (struct qemud_client *client,
|
||||
remoteDispatchNetworkDumpXml (struct qemud_server *server ATTRIBUTE_UNUSED,
|
||||
struct qemud_client *client,
|
||||
remote_message_header *req,
|
||||
remote_network_dump_xml_args *args,
|
||||
remote_network_dump_xml_ret *ret)
|
||||
@ -1808,7 +1869,8 @@ remoteDispatchNetworkDumpXml (struct qemud_client *client,
|
||||
}
|
||||
|
||||
static int
|
||||
remoteDispatchNetworkGetAutostart (struct qemud_client *client,
|
||||
remoteDispatchNetworkGetAutostart (struct qemud_server *server ATTRIBUTE_UNUSED,
|
||||
struct qemud_client *client,
|
||||
remote_message_header *req,
|
||||
remote_network_get_autostart_args *args,
|
||||
remote_network_get_autostart_ret *ret)
|
||||
@ -1831,7 +1893,8 @@ remoteDispatchNetworkGetAutostart (struct qemud_client *client,
|
||||
}
|
||||
|
||||
static int
|
||||
remoteDispatchNetworkGetBridgeName (struct qemud_client *client,
|
||||
remoteDispatchNetworkGetBridgeName (struct qemud_server *server ATTRIBUTE_UNUSED,
|
||||
struct qemud_client *client,
|
||||
remote_message_header *req,
|
||||
remote_network_get_bridge_name_args *args,
|
||||
remote_network_get_bridge_name_ret *ret)
|
||||
@ -1856,7 +1919,8 @@ remoteDispatchNetworkGetBridgeName (struct qemud_client *client,
|
||||
}
|
||||
|
||||
static int
|
||||
remoteDispatchNetworkLookupByName (struct qemud_client *client,
|
||||
remoteDispatchNetworkLookupByName (struct qemud_server *server ATTRIBUTE_UNUSED,
|
||||
struct qemud_client *client,
|
||||
remote_message_header *req,
|
||||
remote_network_lookup_by_name_args *args,
|
||||
remote_network_lookup_by_name_ret *ret)
|
||||
@ -1873,7 +1937,8 @@ remoteDispatchNetworkLookupByName (struct qemud_client *client,
|
||||
}
|
||||
|
||||
static int
|
||||
remoteDispatchNetworkLookupByUuid (struct qemud_client *client,
|
||||
remoteDispatchNetworkLookupByUuid (struct qemud_server *server ATTRIBUTE_UNUSED,
|
||||
struct qemud_client *client,
|
||||
remote_message_header *req,
|
||||
remote_network_lookup_by_uuid_args *args,
|
||||
remote_network_lookup_by_uuid_ret *ret)
|
||||
@ -1890,7 +1955,8 @@ remoteDispatchNetworkLookupByUuid (struct qemud_client *client,
|
||||
}
|
||||
|
||||
static int
|
||||
remoteDispatchNetworkSetAutostart (struct qemud_client *client,
|
||||
remoteDispatchNetworkSetAutostart (struct qemud_server *server ATTRIBUTE_UNUSED,
|
||||
struct qemud_client *client,
|
||||
remote_message_header *req,
|
||||
remote_network_set_autostart_args *args,
|
||||
void *ret ATTRIBUTE_UNUSED)
|
||||
@ -1913,7 +1979,8 @@ remoteDispatchNetworkSetAutostart (struct qemud_client *client,
|
||||
}
|
||||
|
||||
static int
|
||||
remoteDispatchNetworkUndefine (struct qemud_client *client,
|
||||
remoteDispatchNetworkUndefine (struct qemud_server *server ATTRIBUTE_UNUSED,
|
||||
struct qemud_client *client,
|
||||
remote_message_header *req,
|
||||
remote_network_undefine_args *args,
|
||||
void *ret ATTRIBUTE_UNUSED)
|
||||
@ -1936,7 +2003,8 @@ remoteDispatchNetworkUndefine (struct qemud_client *client,
|
||||
}
|
||||
|
||||
static int
|
||||
remoteDispatchNumOfDefinedNetworks (struct qemud_client *client,
|
||||
remoteDispatchNumOfDefinedNetworks (struct qemud_server *server ATTRIBUTE_UNUSED,
|
||||
struct qemud_client *client,
|
||||
remote_message_header *req,
|
||||
void *args ATTRIBUTE_UNUSED,
|
||||
remote_num_of_defined_networks_ret *ret)
|
||||
@ -1950,7 +2018,8 @@ remoteDispatchNumOfDefinedNetworks (struct qemud_client *client,
|
||||
}
|
||||
|
||||
static int
|
||||
remoteDispatchNumOfDomains (struct qemud_client *client,
|
||||
remoteDispatchNumOfDomains (struct qemud_server *server ATTRIBUTE_UNUSED,
|
||||
struct qemud_client *client,
|
||||
remote_message_header *req,
|
||||
void *args ATTRIBUTE_UNUSED,
|
||||
remote_num_of_domains_ret *ret)
|
||||
@ -1964,7 +2033,8 @@ remoteDispatchNumOfDomains (struct qemud_client *client,
|
||||
}
|
||||
|
||||
static int
|
||||
remoteDispatchNumOfNetworks (struct qemud_client *client,
|
||||
remoteDispatchNumOfNetworks (struct qemud_server *server ATTRIBUTE_UNUSED,
|
||||
struct qemud_client *client,
|
||||
remote_message_header *req,
|
||||
void *args ATTRIBUTE_UNUSED,
|
||||
remote_num_of_networks_ret *ret)
|
||||
@ -1979,7 +2049,8 @@ remoteDispatchNumOfNetworks (struct qemud_client *client,
|
||||
|
||||
|
||||
static int
|
||||
remoteDispatchAuthList (struct qemud_client *client,
|
||||
remoteDispatchAuthList (struct qemud_server *server ATTRIBUTE_UNUSED,
|
||||
struct qemud_client *client,
|
||||
remote_message_header *req ATTRIBUTE_UNUSED,
|
||||
void *args ATTRIBUTE_UNUSED,
|
||||
remote_auth_list_ret *ret)
|
||||
@ -2034,7 +2105,8 @@ static char *addrToString(struct qemud_client *client,
|
||||
* XXX callbacks for stuff like password verification ?
|
||||
*/
|
||||
static int
|
||||
remoteDispatchAuthSaslInit (struct qemud_client *client,
|
||||
remoteDispatchAuthSaslInit (struct qemud_server *server ATTRIBUTE_UNUSED,
|
||||
struct qemud_client *client,
|
||||
remote_message_header *req,
|
||||
void *args ATTRIBUTE_UNUSED,
|
||||
remote_auth_sasl_init_ret *ret)
|
||||
@ -2223,11 +2295,67 @@ remoteSASLCheckSSF (struct qemud_client *client,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
remoteSASLCheckAccess (struct qemud_server *server,
|
||||
struct qemud_client *client,
|
||||
remote_message_header *req) {
|
||||
const void *val;
|
||||
int err;
|
||||
char **wildcards;
|
||||
|
||||
err = sasl_getprop(client->saslconn, SASL_USERNAME, &val);
|
||||
if (err != SASL_OK) {
|
||||
qemudLog(QEMUD_ERR, "cannot query SASL username on connection %d (%s)",
|
||||
err, sasl_errstring(err, NULL, NULL));
|
||||
remoteDispatchFailAuth(client, req);
|
||||
sasl_dispose(&client->saslconn);
|
||||
client->saslconn = NULL;
|
||||
return -1;
|
||||
}
|
||||
if (val == NULL) {
|
||||
qemudLog(QEMUD_ERR, "no client username was found");
|
||||
remoteDispatchFailAuth(client, req);
|
||||
sasl_dispose(&client->saslconn);
|
||||
client->saslconn = NULL;
|
||||
return -1;
|
||||
}
|
||||
REMOTE_DEBUG("SASL client username %s", (const char *)val);
|
||||
|
||||
client->saslUsername = strdup((const char*)val);
|
||||
if (client->saslUsername == NULL) {
|
||||
qemudLog(QEMUD_ERR, "out of memory copying username");
|
||||
remoteDispatchFailAuth(client, req);
|
||||
sasl_dispose(&client->saslconn);
|
||||
client->saslconn = NULL;
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* If the list is not set, allow any DN. */
|
||||
wildcards = server->saslUsernameWhitelist;
|
||||
if (!wildcards)
|
||||
return 0; /* No ACL, allow all */
|
||||
|
||||
while (*wildcards) {
|
||||
if (fnmatch (*wildcards, client->saslUsername, 0) == 0)
|
||||
return 0; /* Allowed */
|
||||
wildcards++;
|
||||
}
|
||||
|
||||
/* Denied */
|
||||
qemudLog(QEMUD_ERR, "SASL client %s not allowed in whitelist", client->saslUsername);
|
||||
remoteDispatchFailAuth(client, req);
|
||||
sasl_dispose(&client->saslconn);
|
||||
client->saslconn = NULL;
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* This starts the SASL authentication negotiation.
|
||||
*/
|
||||
static int
|
||||
remoteDispatchAuthSaslStart (struct qemud_client *client,
|
||||
remoteDispatchAuthSaslStart (struct qemud_server *server,
|
||||
struct qemud_client *client,
|
||||
remote_message_header *req,
|
||||
remote_auth_sasl_start_args *args,
|
||||
remote_auth_sasl_start_ret *ret)
|
||||
@ -2291,6 +2419,10 @@ remoteDispatchAuthSaslStart (struct qemud_client *client,
|
||||
if (remoteSASLCheckSSF(client, req) < 0)
|
||||
return -2;
|
||||
|
||||
/* Check username whitelist ACL */
|
||||
if (remoteSASLCheckAccess(server, client, req) < 0)
|
||||
return -2;
|
||||
|
||||
REMOTE_DEBUG("Authentication successful %d", client->fd);
|
||||
ret->complete = 1;
|
||||
client->auth = REMOTE_AUTH_NONE;
|
||||
@ -2301,7 +2433,8 @@ remoteDispatchAuthSaslStart (struct qemud_client *client,
|
||||
|
||||
|
||||
static int
|
||||
remoteDispatchAuthSaslStep (struct qemud_client *client,
|
||||
remoteDispatchAuthSaslStep (struct qemud_server *server,
|
||||
struct qemud_client *client,
|
||||
remote_message_header *req,
|
||||
remote_auth_sasl_step_args *args,
|
||||
remote_auth_sasl_step_ret *ret)
|
||||
@ -2365,6 +2498,10 @@ remoteDispatchAuthSaslStep (struct qemud_client *client,
|
||||
if (remoteSASLCheckSSF(client, req) < 0)
|
||||
return -2;
|
||||
|
||||
/* Check username whitelist ACL */
|
||||
if (remoteSASLCheckAccess(server, client, req) < 0)
|
||||
return -2;
|
||||
|
||||
REMOTE_DEBUG("Authentication successful %d", client->fd);
|
||||
ret->complete = 1;
|
||||
client->auth = REMOTE_AUTH_NONE;
|
||||
@ -2376,7 +2513,8 @@ remoteDispatchAuthSaslStep (struct qemud_client *client,
|
||||
|
||||
#else /* HAVE_SASL */
|
||||
static int
|
||||
remoteDispatchAuthSaslInit (struct qemud_client *client,
|
||||
remoteDispatchAuthSaslInit (struct qemud_server *server ATTRIBUTE_UNUSED,
|
||||
struct qemud_client *client,
|
||||
remote_message_header *req,
|
||||
void *args ATTRIBUTE_UNUSED,
|
||||
remote_auth_sasl_init_ret *ret ATTRIBUTE_UNUSED)
|
||||
@ -2387,7 +2525,8 @@ remoteDispatchAuthSaslInit (struct qemud_client *client,
|
||||
}
|
||||
|
||||
static int
|
||||
remoteDispatchAuthSaslStart (struct qemud_client *client,
|
||||
remoteDispatchAuthSaslStart (struct qemud_server *server ATTRIBUTE_UNUSED,
|
||||
struct qemud_client *client,
|
||||
remote_message_header *req,
|
||||
remote_auth_sasl_start_args *args ATTRIBUTE_UNUSED,
|
||||
remote_auth_sasl_start_ret *ret ATTRIBUTE_UNUSED)
|
||||
@ -2398,7 +2537,8 @@ remoteDispatchAuthSaslStart (struct qemud_client *client,
|
||||
}
|
||||
|
||||
static int
|
||||
remoteDispatchAuthSaslStep (struct qemud_client *client,
|
||||
remoteDispatchAuthSaslStep (struct qemud_server *server ATTRIBUTE_UNUSED,
|
||||
struct qemud_client *client,
|
||||
remote_message_header *req,
|
||||
remote_auth_sasl_step_args *args ATTRIBUTE_UNUSED,
|
||||
remote_auth_sasl_step_ret *ret ATTRIBUTE_UNUSED)
|
||||
|
@ -2,72 +2,72 @@
|
||||
* Do not edit this file. Any changes you make will be lost.
|
||||
*/
|
||||
|
||||
static int remoteDispatchAuthList (struct qemud_client *client, remote_message_header *req, void *args, remote_auth_list_ret *ret);
|
||||
static int remoteDispatchAuthSaslInit (struct qemud_client *client, remote_message_header *req, void *args, remote_auth_sasl_init_ret *ret);
|
||||
static int remoteDispatchAuthSaslStart (struct qemud_client *client, remote_message_header *req, remote_auth_sasl_start_args *args, remote_auth_sasl_start_ret *ret);
|
||||
static int remoteDispatchAuthSaslStep (struct qemud_client *client, remote_message_header *req, remote_auth_sasl_step_args *args, remote_auth_sasl_step_ret *ret);
|
||||
static int remoteDispatchClose (struct qemud_client *client, remote_message_header *req, void *args, void *ret);
|
||||
static int remoteDispatchDomainAttachDevice (struct qemud_client *client, remote_message_header *req, remote_domain_attach_device_args *args, void *ret);
|
||||
static int remoteDispatchDomainBlockStats (struct qemud_client *client, remote_message_header *req, remote_domain_block_stats_args *args, remote_domain_block_stats_ret *ret);
|
||||
static int remoteDispatchDomainCoreDump (struct qemud_client *client, remote_message_header *req, remote_domain_core_dump_args *args, void *ret);
|
||||
static int remoteDispatchDomainCreate (struct qemud_client *client, remote_message_header *req, remote_domain_create_args *args, void *ret);
|
||||
static int remoteDispatchDomainCreateLinux (struct qemud_client *client, remote_message_header *req, remote_domain_create_linux_args *args, remote_domain_create_linux_ret *ret);
|
||||
static int remoteDispatchDomainDefineXml (struct qemud_client *client, remote_message_header *req, remote_domain_define_xml_args *args, remote_domain_define_xml_ret *ret);
|
||||
static int remoteDispatchDomainDestroy (struct qemud_client *client, remote_message_header *req, remote_domain_destroy_args *args, void *ret);
|
||||
static int remoteDispatchDomainDetachDevice (struct qemud_client *client, remote_message_header *req, remote_domain_detach_device_args *args, void *ret);
|
||||
static int remoteDispatchDomainDumpXml (struct qemud_client *client, remote_message_header *req, remote_domain_dump_xml_args *args, remote_domain_dump_xml_ret *ret);
|
||||
static int remoteDispatchDomainGetAutostart (struct qemud_client *client, remote_message_header *req, remote_domain_get_autostart_args *args, remote_domain_get_autostart_ret *ret);
|
||||
static int remoteDispatchDomainGetInfo (struct qemud_client *client, remote_message_header *req, remote_domain_get_info_args *args, remote_domain_get_info_ret *ret);
|
||||
static int remoteDispatchDomainGetMaxMemory (struct qemud_client *client, remote_message_header *req, remote_domain_get_max_memory_args *args, remote_domain_get_max_memory_ret *ret);
|
||||
static int remoteDispatchDomainGetMaxVcpus (struct qemud_client *client, remote_message_header *req, remote_domain_get_max_vcpus_args *args, remote_domain_get_max_vcpus_ret *ret);
|
||||
static int remoteDispatchDomainGetOsType (struct qemud_client *client, remote_message_header *req, remote_domain_get_os_type_args *args, remote_domain_get_os_type_ret *ret);
|
||||
static int remoteDispatchDomainGetSchedulerParameters (struct qemud_client *client, remote_message_header *req, remote_domain_get_scheduler_parameters_args *args, remote_domain_get_scheduler_parameters_ret *ret);
|
||||
static int remoteDispatchDomainGetSchedulerType (struct qemud_client *client, remote_message_header *req, remote_domain_get_scheduler_type_args *args, remote_domain_get_scheduler_type_ret *ret);
|
||||
static int remoteDispatchDomainGetVcpus (struct qemud_client *client, remote_message_header *req, remote_domain_get_vcpus_args *args, remote_domain_get_vcpus_ret *ret);
|
||||
static int remoteDispatchDomainInterfaceStats (struct qemud_client *client, remote_message_header *req, remote_domain_interface_stats_args *args, remote_domain_interface_stats_ret *ret);
|
||||
static int remoteDispatchDomainLookupById (struct qemud_client *client, remote_message_header *req, remote_domain_lookup_by_id_args *args, remote_domain_lookup_by_id_ret *ret);
|
||||
static int remoteDispatchDomainLookupByName (struct qemud_client *client, remote_message_header *req, remote_domain_lookup_by_name_args *args, remote_domain_lookup_by_name_ret *ret);
|
||||
static int remoteDispatchDomainLookupByUuid (struct qemud_client *client, remote_message_header *req, remote_domain_lookup_by_uuid_args *args, remote_domain_lookup_by_uuid_ret *ret);
|
||||
static int remoteDispatchDomainMigrateFinish (struct qemud_client *client, remote_message_header *req, remote_domain_migrate_finish_args *args, remote_domain_migrate_finish_ret *ret);
|
||||
static int remoteDispatchDomainMigratePerform (struct qemud_client *client, remote_message_header *req, remote_domain_migrate_perform_args *args, void *ret);
|
||||
static int remoteDispatchDomainMigratePrepare (struct qemud_client *client, remote_message_header *req, remote_domain_migrate_prepare_args *args, remote_domain_migrate_prepare_ret *ret);
|
||||
static int remoteDispatchDomainPinVcpu (struct qemud_client *client, remote_message_header *req, remote_domain_pin_vcpu_args *args, void *ret);
|
||||
static int remoteDispatchDomainReboot (struct qemud_client *client, remote_message_header *req, remote_domain_reboot_args *args, void *ret);
|
||||
static int remoteDispatchDomainRestore (struct qemud_client *client, remote_message_header *req, remote_domain_restore_args *args, void *ret);
|
||||
static int remoteDispatchDomainResume (struct qemud_client *client, remote_message_header *req, remote_domain_resume_args *args, void *ret);
|
||||
static int remoteDispatchDomainSave (struct qemud_client *client, remote_message_header *req, remote_domain_save_args *args, void *ret);
|
||||
static int remoteDispatchDomainSetAutostart (struct qemud_client *client, remote_message_header *req, remote_domain_set_autostart_args *args, void *ret);
|
||||
static int remoteDispatchDomainSetMaxMemory (struct qemud_client *client, remote_message_header *req, remote_domain_set_max_memory_args *args, void *ret);
|
||||
static int remoteDispatchDomainSetMemory (struct qemud_client *client, remote_message_header *req, remote_domain_set_memory_args *args, void *ret);
|
||||
static int remoteDispatchDomainSetSchedulerParameters (struct qemud_client *client, remote_message_header *req, remote_domain_set_scheduler_parameters_args *args, void *ret);
|
||||
static int remoteDispatchDomainSetVcpus (struct qemud_client *client, remote_message_header *req, remote_domain_set_vcpus_args *args, void *ret);
|
||||
static int remoteDispatchDomainShutdown (struct qemud_client *client, remote_message_header *req, remote_domain_shutdown_args *args, void *ret);
|
||||
static int remoteDispatchDomainSuspend (struct qemud_client *client, remote_message_header *req, remote_domain_suspend_args *args, void *ret);
|
||||
static int remoteDispatchDomainUndefine (struct qemud_client *client, remote_message_header *req, remote_domain_undefine_args *args, void *ret);
|
||||
static int remoteDispatchGetCapabilities (struct qemud_client *client, remote_message_header *req, void *args, remote_get_capabilities_ret *ret);
|
||||
static int remoteDispatchGetHostname (struct qemud_client *client, remote_message_header *req, void *args, remote_get_hostname_ret *ret);
|
||||
static int remoteDispatchGetMaxVcpus (struct qemud_client *client, remote_message_header *req, remote_get_max_vcpus_args *args, remote_get_max_vcpus_ret *ret);
|
||||
static int remoteDispatchGetType (struct qemud_client *client, remote_message_header *req, void *args, remote_get_type_ret *ret);
|
||||
static int remoteDispatchGetVersion (struct qemud_client *client, remote_message_header *req, void *args, remote_get_version_ret *ret);
|
||||
static int remoteDispatchListDefinedDomains (struct qemud_client *client, remote_message_header *req, remote_list_defined_domains_args *args, remote_list_defined_domains_ret *ret);
|
||||
static int remoteDispatchListDefinedNetworks (struct qemud_client *client, remote_message_header *req, remote_list_defined_networks_args *args, remote_list_defined_networks_ret *ret);
|
||||
static int remoteDispatchListDomains (struct qemud_client *client, remote_message_header *req, remote_list_domains_args *args, remote_list_domains_ret *ret);
|
||||
static int remoteDispatchListNetworks (struct qemud_client *client, remote_message_header *req, remote_list_networks_args *args, remote_list_networks_ret *ret);
|
||||
static int remoteDispatchNetworkCreate (struct qemud_client *client, remote_message_header *req, remote_network_create_args *args, void *ret);
|
||||
static int remoteDispatchNetworkCreateXml (struct qemud_client *client, remote_message_header *req, remote_network_create_xml_args *args, remote_network_create_xml_ret *ret);
|
||||
static int remoteDispatchNetworkDefineXml (struct qemud_client *client, remote_message_header *req, remote_network_define_xml_args *args, remote_network_define_xml_ret *ret);
|
||||
static int remoteDispatchNetworkDestroy (struct qemud_client *client, remote_message_header *req, remote_network_destroy_args *args, void *ret);
|
||||
static int remoteDispatchNetworkDumpXml (struct qemud_client *client, remote_message_header *req, remote_network_dump_xml_args *args, remote_network_dump_xml_ret *ret);
|
||||
static int remoteDispatchNetworkGetAutostart (struct qemud_client *client, remote_message_header *req, remote_network_get_autostart_args *args, remote_network_get_autostart_ret *ret);
|
||||
static int remoteDispatchNetworkGetBridgeName (struct qemud_client *client, remote_message_header *req, remote_network_get_bridge_name_args *args, remote_network_get_bridge_name_ret *ret);
|
||||
static int remoteDispatchNetworkLookupByName (struct qemud_client *client, remote_message_header *req, remote_network_lookup_by_name_args *args, remote_network_lookup_by_name_ret *ret);
|
||||
static int remoteDispatchNetworkLookupByUuid (struct qemud_client *client, remote_message_header *req, remote_network_lookup_by_uuid_args *args, remote_network_lookup_by_uuid_ret *ret);
|
||||
static int remoteDispatchNetworkSetAutostart (struct qemud_client *client, remote_message_header *req, remote_network_set_autostart_args *args, void *ret);
|
||||
static int remoteDispatchNetworkUndefine (struct qemud_client *client, remote_message_header *req, remote_network_undefine_args *args, void *ret);
|
||||
static int remoteDispatchNodeGetInfo (struct qemud_client *client, remote_message_header *req, void *args, remote_node_get_info_ret *ret);
|
||||
static int remoteDispatchNumOfDefinedDomains (struct qemud_client *client, remote_message_header *req, void *args, remote_num_of_defined_domains_ret *ret);
|
||||
static int remoteDispatchNumOfDefinedNetworks (struct qemud_client *client, remote_message_header *req, void *args, remote_num_of_defined_networks_ret *ret);
|
||||
static int remoteDispatchNumOfDomains (struct qemud_client *client, remote_message_header *req, void *args, remote_num_of_domains_ret *ret);
|
||||
static int remoteDispatchNumOfNetworks (struct qemud_client *client, remote_message_header *req, void *args, remote_num_of_networks_ret *ret);
|
||||
static int remoteDispatchOpen (struct qemud_client *client, remote_message_header *req, remote_open_args *args, void *ret);
|
||||
static int remoteDispatchSupportsFeature (struct qemud_client *client, remote_message_header *req, remote_supports_feature_args *args, remote_supports_feature_ret *ret);
|
||||
static int remoteDispatchAuthList (struct qemud_server *server, struct qemud_client *client, remote_message_header *req, void *args, remote_auth_list_ret *ret);
|
||||
static int remoteDispatchAuthSaslInit (struct qemud_server *server, struct qemud_client *client, remote_message_header *req, void *args, remote_auth_sasl_init_ret *ret);
|
||||
static int remoteDispatchAuthSaslStart (struct qemud_server *server, struct qemud_client *client, remote_message_header *req, remote_auth_sasl_start_args *args, remote_auth_sasl_start_ret *ret);
|
||||
static int remoteDispatchAuthSaslStep (struct qemud_server *server, struct qemud_client *client, remote_message_header *req, remote_auth_sasl_step_args *args, remote_auth_sasl_step_ret *ret);
|
||||
static int remoteDispatchClose (struct qemud_server *server, struct qemud_client *client, remote_message_header *req, void *args, void *ret);
|
||||
static int remoteDispatchDomainAttachDevice (struct qemud_server *server, struct qemud_client *client, remote_message_header *req, remote_domain_attach_device_args *args, void *ret);
|
||||
static int remoteDispatchDomainBlockStats (struct qemud_server *server, struct qemud_client *client, remote_message_header *req, remote_domain_block_stats_args *args, remote_domain_block_stats_ret *ret);
|
||||
static int remoteDispatchDomainCoreDump (struct qemud_server *server, struct qemud_client *client, remote_message_header *req, remote_domain_core_dump_args *args, void *ret);
|
||||
static int remoteDispatchDomainCreate (struct qemud_server *server, struct qemud_client *client, remote_message_header *req, remote_domain_create_args *args, void *ret);
|
||||
static int remoteDispatchDomainCreateLinux (struct qemud_server *server, struct qemud_client *client, remote_message_header *req, remote_domain_create_linux_args *args, remote_domain_create_linux_ret *ret);
|
||||
static int remoteDispatchDomainDefineXml (struct qemud_server *server, struct qemud_client *client, remote_message_header *req, remote_domain_define_xml_args *args, remote_domain_define_xml_ret *ret);
|
||||
static int remoteDispatchDomainDestroy (struct qemud_server *server, struct qemud_client *client, remote_message_header *req, remote_domain_destroy_args *args, void *ret);
|
||||
static int remoteDispatchDomainDetachDevice (struct qemud_server *server, struct qemud_client *client, remote_message_header *req, remote_domain_detach_device_args *args, void *ret);
|
||||
static int remoteDispatchDomainDumpXml (struct qemud_server *server, struct qemud_client *client, remote_message_header *req, remote_domain_dump_xml_args *args, remote_domain_dump_xml_ret *ret);
|
||||
static int remoteDispatchDomainGetAutostart (struct qemud_server *server, struct qemud_client *client, remote_message_header *req, remote_domain_get_autostart_args *args, remote_domain_get_autostart_ret *ret);
|
||||
static int remoteDispatchDomainGetInfo (struct qemud_server *server, struct qemud_client *client, remote_message_header *req, remote_domain_get_info_args *args, remote_domain_get_info_ret *ret);
|
||||
static int remoteDispatchDomainGetMaxMemory (struct qemud_server *server, struct qemud_client *client, remote_message_header *req, remote_domain_get_max_memory_args *args, remote_domain_get_max_memory_ret *ret);
|
||||
static int remoteDispatchDomainGetMaxVcpus (struct qemud_server *server, struct qemud_client *client, remote_message_header *req, remote_domain_get_max_vcpus_args *args, remote_domain_get_max_vcpus_ret *ret);
|
||||
static int remoteDispatchDomainGetOsType (struct qemud_server *server, struct qemud_client *client, remote_message_header *req, remote_domain_get_os_type_args *args, remote_domain_get_os_type_ret *ret);
|
||||
static int remoteDispatchDomainGetSchedulerParameters (struct qemud_server *server, struct qemud_client *client, remote_message_header *req, remote_domain_get_scheduler_parameters_args *args, remote_domain_get_scheduler_parameters_ret *ret);
|
||||
static int remoteDispatchDomainGetSchedulerType (struct qemud_server *server, struct qemud_client *client, remote_message_header *req, remote_domain_get_scheduler_type_args *args, remote_domain_get_scheduler_type_ret *ret);
|
||||
static int remoteDispatchDomainGetVcpus (struct qemud_server *server, struct qemud_client *client, remote_message_header *req, remote_domain_get_vcpus_args *args, remote_domain_get_vcpus_ret *ret);
|
||||
static int remoteDispatchDomainInterfaceStats (struct qemud_server *server, struct qemud_client *client, remote_message_header *req, remote_domain_interface_stats_args *args, remote_domain_interface_stats_ret *ret);
|
||||
static int remoteDispatchDomainLookupById (struct qemud_server *server, struct qemud_client *client, remote_message_header *req, remote_domain_lookup_by_id_args *args, remote_domain_lookup_by_id_ret *ret);
|
||||
static int remoteDispatchDomainLookupByName (struct qemud_server *server, struct qemud_client *client, remote_message_header *req, remote_domain_lookup_by_name_args *args, remote_domain_lookup_by_name_ret *ret);
|
||||
static int remoteDispatchDomainLookupByUuid (struct qemud_server *server, struct qemud_client *client, remote_message_header *req, remote_domain_lookup_by_uuid_args *args, remote_domain_lookup_by_uuid_ret *ret);
|
||||
static int remoteDispatchDomainMigrateFinish (struct qemud_server *server, struct qemud_client *client, remote_message_header *req, remote_domain_migrate_finish_args *args, remote_domain_migrate_finish_ret *ret);
|
||||
static int remoteDispatchDomainMigratePerform (struct qemud_server *server, struct qemud_client *client, remote_message_header *req, remote_domain_migrate_perform_args *args, void *ret);
|
||||
static int remoteDispatchDomainMigratePrepare (struct qemud_server *server, struct qemud_client *client, remote_message_header *req, remote_domain_migrate_prepare_args *args, remote_domain_migrate_prepare_ret *ret);
|
||||
static int remoteDispatchDomainPinVcpu (struct qemud_server *server, struct qemud_client *client, remote_message_header *req, remote_domain_pin_vcpu_args *args, void *ret);
|
||||
static int remoteDispatchDomainReboot (struct qemud_server *server, struct qemud_client *client, remote_message_header *req, remote_domain_reboot_args *args, void *ret);
|
||||
static int remoteDispatchDomainRestore (struct qemud_server *server, struct qemud_client *client, remote_message_header *req, remote_domain_restore_args *args, void *ret);
|
||||
static int remoteDispatchDomainResume (struct qemud_server *server, struct qemud_client *client, remote_message_header *req, remote_domain_resume_args *args, void *ret);
|
||||
static int remoteDispatchDomainSave (struct qemud_server *server, struct qemud_client *client, remote_message_header *req, remote_domain_save_args *args, void *ret);
|
||||
static int remoteDispatchDomainSetAutostart (struct qemud_server *server, struct qemud_client *client, remote_message_header *req, remote_domain_set_autostart_args *args, void *ret);
|
||||
static int remoteDispatchDomainSetMaxMemory (struct qemud_server *server, struct qemud_client *client, remote_message_header *req, remote_domain_set_max_memory_args *args, void *ret);
|
||||
static int remoteDispatchDomainSetMemory (struct qemud_server *server, struct qemud_client *client, remote_message_header *req, remote_domain_set_memory_args *args, void *ret);
|
||||
static int remoteDispatchDomainSetSchedulerParameters (struct qemud_server *server, struct qemud_client *client, remote_message_header *req, remote_domain_set_scheduler_parameters_args *args, void *ret);
|
||||
static int remoteDispatchDomainSetVcpus (struct qemud_server *server, struct qemud_client *client, remote_message_header *req, remote_domain_set_vcpus_args *args, void *ret);
|
||||
static int remoteDispatchDomainShutdown (struct qemud_server *server, struct qemud_client *client, remote_message_header *req, remote_domain_shutdown_args *args, void *ret);
|
||||
static int remoteDispatchDomainSuspend (struct qemud_server *server, struct qemud_client *client, remote_message_header *req, remote_domain_suspend_args *args, void *ret);
|
||||
static int remoteDispatchDomainUndefine (struct qemud_server *server, struct qemud_client *client, remote_message_header *req, remote_domain_undefine_args *args, void *ret);
|
||||
static int remoteDispatchGetCapabilities (struct qemud_server *server, struct qemud_client *client, remote_message_header *req, void *args, remote_get_capabilities_ret *ret);
|
||||
static int remoteDispatchGetHostname (struct qemud_server *server, struct qemud_client *client, remote_message_header *req, void *args, remote_get_hostname_ret *ret);
|
||||
static int remoteDispatchGetMaxVcpus (struct qemud_server *server, struct qemud_client *client, remote_message_header *req, remote_get_max_vcpus_args *args, remote_get_max_vcpus_ret *ret);
|
||||
static int remoteDispatchGetType (struct qemud_server *server, struct qemud_client *client, remote_message_header *req, void *args, remote_get_type_ret *ret);
|
||||
static int remoteDispatchGetVersion (struct qemud_server *server, struct qemud_client *client, remote_message_header *req, void *args, remote_get_version_ret *ret);
|
||||
static int remoteDispatchListDefinedDomains (struct qemud_server *server, struct qemud_client *client, remote_message_header *req, remote_list_defined_domains_args *args, remote_list_defined_domains_ret *ret);
|
||||
static int remoteDispatchListDefinedNetworks (struct qemud_server *server, struct qemud_client *client, remote_message_header *req, remote_list_defined_networks_args *args, remote_list_defined_networks_ret *ret);
|
||||
static int remoteDispatchListDomains (struct qemud_server *server, struct qemud_client *client, remote_message_header *req, remote_list_domains_args *args, remote_list_domains_ret *ret);
|
||||
static int remoteDispatchListNetworks (struct qemud_server *server, struct qemud_client *client, remote_message_header *req, remote_list_networks_args *args, remote_list_networks_ret *ret);
|
||||
static int remoteDispatchNetworkCreate (struct qemud_server *server, struct qemud_client *client, remote_message_header *req, remote_network_create_args *args, void *ret);
|
||||
static int remoteDispatchNetworkCreateXml (struct qemud_server *server, struct qemud_client *client, remote_message_header *req, remote_network_create_xml_args *args, remote_network_create_xml_ret *ret);
|
||||
static int remoteDispatchNetworkDefineXml (struct qemud_server *server, struct qemud_client *client, remote_message_header *req, remote_network_define_xml_args *args, remote_network_define_xml_ret *ret);
|
||||
static int remoteDispatchNetworkDestroy (struct qemud_server *server, struct qemud_client *client, remote_message_header *req, remote_network_destroy_args *args, void *ret);
|
||||
static int remoteDispatchNetworkDumpXml (struct qemud_server *server, struct qemud_client *client, remote_message_header *req, remote_network_dump_xml_args *args, remote_network_dump_xml_ret *ret);
|
||||
static int remoteDispatchNetworkGetAutostart (struct qemud_server *server, struct qemud_client *client, remote_message_header *req, remote_network_get_autostart_args *args, remote_network_get_autostart_ret *ret);
|
||||
static int remoteDispatchNetworkGetBridgeName (struct qemud_server *server, struct qemud_client *client, remote_message_header *req, remote_network_get_bridge_name_args *args, remote_network_get_bridge_name_ret *ret);
|
||||
static int remoteDispatchNetworkLookupByName (struct qemud_server *server, struct qemud_client *client, remote_message_header *req, remote_network_lookup_by_name_args *args, remote_network_lookup_by_name_ret *ret);
|
||||
static int remoteDispatchNetworkLookupByUuid (struct qemud_server *server, struct qemud_client *client, remote_message_header *req, remote_network_lookup_by_uuid_args *args, remote_network_lookup_by_uuid_ret *ret);
|
||||
static int remoteDispatchNetworkSetAutostart (struct qemud_server *server, struct qemud_client *client, remote_message_header *req, remote_network_set_autostart_args *args, void *ret);
|
||||
static int remoteDispatchNetworkUndefine (struct qemud_server *server, struct qemud_client *client, remote_message_header *req, remote_network_undefine_args *args, void *ret);
|
||||
static int remoteDispatchNodeGetInfo (struct qemud_server *server, struct qemud_client *client, remote_message_header *req, void *args, remote_node_get_info_ret *ret);
|
||||
static int remoteDispatchNumOfDefinedDomains (struct qemud_server *server, struct qemud_client *client, remote_message_header *req, void *args, remote_num_of_defined_domains_ret *ret);
|
||||
static int remoteDispatchNumOfDefinedNetworks (struct qemud_server *server, struct qemud_client *client, remote_message_header *req, void *args, remote_num_of_defined_networks_ret *ret);
|
||||
static int remoteDispatchNumOfDomains (struct qemud_server *server, struct qemud_client *client, remote_message_header *req, void *args, remote_num_of_domains_ret *ret);
|
||||
static int remoteDispatchNumOfNetworks (struct qemud_server *server, struct qemud_client *client, remote_message_header *req, void *args, remote_num_of_networks_ret *ret);
|
||||
static int remoteDispatchOpen (struct qemud_server *server, struct qemud_client *client, remote_message_header *req, remote_open_args *args, void *ret);
|
||||
static int remoteDispatchSupportsFeature (struct qemud_server *server, struct qemud_client *client, remote_message_header *req, remote_supports_feature_args *args, remote_supports_feature_ret *ret);
|
||||
|
@ -93,7 +93,7 @@ if ($opt_d) {
|
||||
elsif ($opt_i) {
|
||||
my @keys = sort (keys %calls);
|
||||
foreach (@keys) {
|
||||
print "static int remoteDispatch$calls{$_}->{ProcName} (struct qemud_client *client, remote_message_header *req, $calls{$_}->{args} *args, $calls{$_}->{ret} *ret);\n";
|
||||
print "static int remoteDispatch$calls{$_}->{ProcName} (struct qemud_server *server, struct qemud_client *client, remote_message_header *req, $calls{$_}->{args} *args, $calls{$_}->{ret} *ret);\n";
|
||||
}
|
||||
}
|
||||
|
||||
@ -196,7 +196,8 @@ elsif ($opt_s) {
|
||||
my $retvoid = $ret eq "void";
|
||||
|
||||
print "static int\n";
|
||||
print "remoteDispatch$calls{$_}->{ProcName} (struct qemud_client *client,\n";
|
||||
print "remoteDispatch$calls{$_}->{ProcName} (struct qemud_server *server,\n";
|
||||
print " struct qemud_client *client,\n";
|
||||
print " remote_message_header *req,\n";
|
||||
print " remote_get_max_vcpus_args *args,\n";
|
||||
print " remote_get_max_vcpus_ret *ret)\n";
|
||||
|
Loading…
x
Reference in New Issue
Block a user