summaryrefslogtreecommitdiff
path: root/daemon
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2015-04-29 10:43:50 +0200
committerGuido Günther <agx@sigxcpu.org>2015-04-29 10:43:50 +0200
commita544fac06f5bc2d90c925e03fcfd7a0e8b0ef75a (patch)
treee1e1e036f9c0b3a0d891917d26a93e44786e80de /daemon
parent0a436beb57b1e19d7c605803254b1cfc8eef92dd (diff)
New upstream version 1.2.15~rc1
Diffstat (limited to 'daemon')
-rw-r--r--daemon/Makefile.am16
-rw-r--r--daemon/Makefile.in16
-rw-r--r--daemon/libvirtd.8.in2
-rw-r--r--daemon/libvirtd.c2
-rw-r--r--daemon/remote.c37
-rw-r--r--daemon/remote_dispatch.h137
6 files changed, 191 insertions, 19 deletions
diff --git a/daemon/Makefile.am b/daemon/Makefile.am
index b95a79da7..300b9a567 100644
--- a/daemon/Makefile.am
+++ b/daemon/Makefile.am
@@ -77,21 +77,21 @@ REMOTE_PROTOCOL = $(top_srcdir)/src/remote/remote_protocol.x
LXC_PROTOCOL = $(top_srcdir)/src/remote/lxc_protocol.x
QEMU_PROTOCOL = $(top_srcdir)/src/remote/qemu_protocol.x
-remote_dispatch.h: $(srcdir)/../src/rpc/gendispatch.pl \
+remote_dispatch.h: $(top_srcdir)/src/rpc/gendispatch.pl \
$(REMOTE_PROTOCOL)
- $(AM_V_GEN)$(PERL) -w $(srcdir)/../src/rpc/gendispatch.pl \
+ $(AM_V_GEN)$(PERL) -w $(top_srcdir)/src/rpc/gendispatch.pl \
--mode=server remote REMOTE $(REMOTE_PROTOCOL) \
> $(srcdir)/remote_dispatch.h
-lxc_dispatch.h: $(srcdir)/../src/rpc/gendispatch.pl \
+lxc_dispatch.h: $(top_srcdir)/src/rpc/gendispatch.pl \
$(LXC_PROTOCOL)
- $(AM_V_GEN)$(PERL) -w $(srcdir)/../src/rpc/gendispatch.pl \
+ $(AM_V_GEN)$(PERL) -w $(top_srcdir)/src/rpc/gendispatch.pl \
--mode=server lxc LXC $(LXC_PROTOCOL) \
> $(srcdir)/lxc_dispatch.h
-qemu_dispatch.h: $(srcdir)/../src/rpc/gendispatch.pl \
+qemu_dispatch.h: $(top_srcdir)/src/rpc/gendispatch.pl \
$(QEMU_PROTOCOL)
- $(AM_V_GEN)$(PERL) -w $(srcdir)/../src/rpc/gendispatch.pl \
+ $(AM_V_GEN)$(PERL) -w $(top_srcdir)/src/rpc/gendispatch.pl \
--mode=server qemu QEMU $(QEMU_PROTOCOL) \
> $(srcdir)/qemu_dispatch.h
@@ -341,10 +341,10 @@ if WITH_SYSCTL
install-sysctl:
$(MKDIR_P) $(DESTDIR)$(prefix)/lib/sysctl.d
$(INSTALL_DATA) $(srcdir)/libvirtd.sysctl \
- $(DESTDIR)$(prefix)/lib/sysctl.d/libvirtd.conf
+ $(DESTDIR)$(prefix)/lib/sysctl.d/60-libvirtd.conf
uninstall-sysctl:
- rm -f $(DESTDIR)$(prefix)/lib/sysctl.d/libvirtd.conf
+ rm -f $(DESTDIR)$(prefix)/lib/sysctl.d/60-libvirtd.conf
rmdir $(DESTDIR)$(prefix)/lib/sysctl.d || :
else ! WITH_SYSCTL
install-sysctl:
diff --git a/daemon/Makefile.in b/daemon/Makefile.in
index d2215331b..9ae85a04f 100644
--- a/daemon/Makefile.in
+++ b/daemon/Makefile.in
@@ -2512,21 +2512,21 @@ uninstall-man: uninstall-man8
uninstall-man8 uninstall-sbinPROGRAMS
-remote_dispatch.h: $(srcdir)/../src/rpc/gendispatch.pl \
+remote_dispatch.h: $(top_srcdir)/src/rpc/gendispatch.pl \
$(REMOTE_PROTOCOL)
- $(AM_V_GEN)$(PERL) -w $(srcdir)/../src/rpc/gendispatch.pl \
+ $(AM_V_GEN)$(PERL) -w $(top_srcdir)/src/rpc/gendispatch.pl \
--mode=server remote REMOTE $(REMOTE_PROTOCOL) \
> $(srcdir)/remote_dispatch.h
-lxc_dispatch.h: $(srcdir)/../src/rpc/gendispatch.pl \
+lxc_dispatch.h: $(top_srcdir)/src/rpc/gendispatch.pl \
$(LXC_PROTOCOL)
- $(AM_V_GEN)$(PERL) -w $(srcdir)/../src/rpc/gendispatch.pl \
+ $(AM_V_GEN)$(PERL) -w $(top_srcdir)/src/rpc/gendispatch.pl \
--mode=server lxc LXC $(LXC_PROTOCOL) \
> $(srcdir)/lxc_dispatch.h
-qemu_dispatch.h: $(srcdir)/../src/rpc/gendispatch.pl \
+qemu_dispatch.h: $(top_srcdir)/src/rpc/gendispatch.pl \
$(QEMU_PROTOCOL)
- $(AM_V_GEN)$(PERL) -w $(srcdir)/../src/rpc/gendispatch.pl \
+ $(AM_V_GEN)$(PERL) -w $(top_srcdir)/src/rpc/gendispatch.pl \
--mode=server qemu QEMU $(QEMU_PROTOCOL) \
> $(srcdir)/qemu_dispatch.h
@@ -2632,10 +2632,10 @@ qemu_dispatch.h: $(srcdir)/../src/rpc/gendispatch.pl \
@WITH_LIBVIRTD_TRUE@@WITH_SYSCTL_TRUE@install-sysctl:
@WITH_LIBVIRTD_TRUE@@WITH_SYSCTL_TRUE@ $(MKDIR_P) $(DESTDIR)$(prefix)/lib/sysctl.d
@WITH_LIBVIRTD_TRUE@@WITH_SYSCTL_TRUE@ $(INSTALL_DATA) $(srcdir)/libvirtd.sysctl \
-@WITH_LIBVIRTD_TRUE@@WITH_SYSCTL_TRUE@ $(DESTDIR)$(prefix)/lib/sysctl.d/libvirtd.conf
+@WITH_LIBVIRTD_TRUE@@WITH_SYSCTL_TRUE@ $(DESTDIR)$(prefix)/lib/sysctl.d/60-libvirtd.conf
@WITH_LIBVIRTD_TRUE@@WITH_SYSCTL_TRUE@uninstall-sysctl:
-@WITH_LIBVIRTD_TRUE@@WITH_SYSCTL_TRUE@ rm -f $(DESTDIR)$(prefix)/lib/sysctl.d/libvirtd.conf
+@WITH_LIBVIRTD_TRUE@@WITH_SYSCTL_TRUE@ rm -f $(DESTDIR)$(prefix)/lib/sysctl.d/60-libvirtd.conf
@WITH_LIBVIRTD_TRUE@@WITH_SYSCTL_TRUE@ rmdir $(DESTDIR)$(prefix)/lib/sysctl.d || :
@WITH_LIBVIRTD_TRUE@@WITH_SYSCTL_FALSE@install-sysctl:
@WITH_LIBVIRTD_TRUE@@WITH_SYSCTL_FALSE@uninstall-sysctl:
diff --git a/daemon/libvirtd.8.in b/daemon/libvirtd.8.in
index 1e753eeea..faeb6c2cc 100644
--- a/daemon/libvirtd.8.in
+++ b/daemon/libvirtd.8.in
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "LIBVIRTD 8"
-.TH LIBVIRTD 8 "2015-01-23" "libvirt-1.2.14" "Virtualization Support"
+.TH LIBVIRTD 8 "2015-01-23" "libvirt-1.2.15" "Virtualization Support"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/daemon/libvirtd.c b/daemon/libvirtd.c
index 2366d63cd..107b88dc0 100644
--- a/daemon/libvirtd.c
+++ b/daemon/libvirtd.c
@@ -105,7 +105,6 @@
#include "configmake.h"
#include "virdbus.h"
-#include "cpu/cpu_map.h"
VIR_LOG_INIT("daemon.libvirtd");
@@ -1097,7 +1096,6 @@ daemonUsage(const char *argv0, bool privileged)
}
}
-#define MAX_LISTEN 5
int main(int argc, char **argv) {
virNetServerPtr srv = NULL;
char *remote_config_file = NULL;
diff --git a/daemon/remote.c b/daemon/remote.c
index 2e1f973b9..3a3f1683e 100644
--- a/daemon/remote.c
+++ b/daemon/remote.c
@@ -1045,6 +1045,42 @@ remoteRelayDomainEventAgentLifecycle(virConnectPtr conn,
}
+static int
+remoteRelayDomainEventDeviceAdded(virConnectPtr conn,
+ virDomainPtr dom,
+ const char *devAlias,
+ void *opaque)
+{
+ daemonClientEventCallbackPtr callback = opaque;
+ remote_domain_event_callback_device_added_msg data;
+
+ if (callback->callbackID < 0 ||
+ !remoteRelayDomainEventCheckACL(callback->client, conn, dom))
+ return -1;
+
+ VIR_DEBUG("Relaying domain device added event %s %d %s, callback %d",
+ dom->name, dom->id, devAlias, callback->callbackID);
+
+ /* build return data */
+ memset(&data, 0, sizeof(data));
+
+ if (VIR_STRDUP(data.devAlias, devAlias) < 0)
+ return -1;
+
+ make_nonnull_domain(&data.dom, dom);
+ data.callbackID = callback->callbackID,
+
+ remoteDispatchObjectEventSend(callback->client, remoteProgram,
+ REMOTE_PROC_DOMAIN_EVENT_CALLBACK_DEVICE_ADDED,
+ (xdrproc_t)xdr_remote_domain_event_callback_device_added_msg,
+ &data);
+
+ return 0;
+}
+
+
+
+
static virConnectDomainEventGenericCallback domainEventCallbacks[] = {
VIR_DOMAIN_EVENT_CALLBACK(remoteRelayDomainEventLifecycle),
VIR_DOMAIN_EVENT_CALLBACK(remoteRelayDomainEventReboot),
@@ -1065,6 +1101,7 @@ static virConnectDomainEventGenericCallback domainEventCallbacks[] = {
VIR_DOMAIN_EVENT_CALLBACK(remoteRelayDomainEventBlockJob2),
VIR_DOMAIN_EVENT_CALLBACK(remoteRelayDomainEventTunable),
VIR_DOMAIN_EVENT_CALLBACK(remoteRelayDomainEventAgentLifecycle),
+ VIR_DOMAIN_EVENT_CALLBACK(remoteRelayDomainEventDeviceAdded),
};
verify(ARRAY_CARDINALITY(domainEventCallbacks) == VIR_DOMAIN_EVENT_ID_LAST);
diff --git a/daemon/remote_dispatch.h b/daemon/remote_dispatch.h
index 15d63fc4c..88b00e147 100644
--- a/daemon/remote_dispatch.h
+++ b/daemon/remote_dispatch.h
@@ -2688,6 +2688,61 @@ cleanup:
+static int remoteDispatchDomainAddIOThread(
+ virNetServerPtr server,
+ virNetServerClientPtr client,
+ virNetMessagePtr msg,
+ virNetMessageErrorPtr rerr,
+ remote_domain_add_iothread_args *args);
+static int remoteDispatchDomainAddIOThreadHelper(
+ virNetServerPtr server,
+ virNetServerClientPtr client,
+ virNetMessagePtr msg,
+ virNetMessageErrorPtr rerr,
+ void *args,
+ void *ret ATTRIBUTE_UNUSED)
+{
+ int rv;
+ virThreadJobSet("remoteDispatchDomainAddIOThread");
+ VIR_DEBUG("server=%p client=%p msg=%p rerr=%p args=%p ret=%p", server, client, msg, rerr, args, ret);
+ rv = remoteDispatchDomainAddIOThread(server, client, msg, rerr, args);
+ virThreadJobClear(rv);
+ return rv;
+}
+static int remoteDispatchDomainAddIOThread(
+ virNetServerPtr server ATTRIBUTE_UNUSED,
+ virNetServerClientPtr client,
+ virNetMessagePtr msg ATTRIBUTE_UNUSED,
+ virNetMessageErrorPtr rerr,
+ remote_domain_add_iothread_args *args)
+{
+ int rv = -1;
+ virDomainPtr dom = NULL;
+ struct daemonClientPrivate *priv =
+ virNetServerClientGetPrivateData(client);
+
+ if (!priv->conn) {
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("connection not open"));
+ goto cleanup;
+ }
+
+ if (!(dom = get_nonnull_domain(priv->conn, args->dom)))
+ goto cleanup;
+
+ if (virDomainAddIOThread(dom, args->iothread_id, args->flags) < 0)
+ goto cleanup;
+
+ rv = 0;
+
+cleanup:
+ if (rv < 0)
+ virNetMessageSaveError(rerr);
+ virObjectUnref(dom);
+ return rv;
+}
+
+
+
static int remoteDispatchDomainAttachDevice(
virNetServerPtr server,
virNetServerClientPtr client,
@@ -3767,6 +3822,61 @@ cleanup:
+static int remoteDispatchDomainDelIOThread(
+ virNetServerPtr server,
+ virNetServerClientPtr client,
+ virNetMessagePtr msg,
+ virNetMessageErrorPtr rerr,
+ remote_domain_del_iothread_args *args);
+static int remoteDispatchDomainDelIOThreadHelper(
+ virNetServerPtr server,
+ virNetServerClientPtr client,
+ virNetMessagePtr msg,
+ virNetMessageErrorPtr rerr,
+ void *args,
+ void *ret ATTRIBUTE_UNUSED)
+{
+ int rv;
+ virThreadJobSet("remoteDispatchDomainDelIOThread");
+ VIR_DEBUG("server=%p client=%p msg=%p rerr=%p args=%p ret=%p", server, client, msg, rerr, args, ret);
+ rv = remoteDispatchDomainDelIOThread(server, client, msg, rerr, args);
+ virThreadJobClear(rv);
+ return rv;
+}
+static int remoteDispatchDomainDelIOThread(
+ virNetServerPtr server ATTRIBUTE_UNUSED,
+ virNetServerClientPtr client,
+ virNetMessagePtr msg ATTRIBUTE_UNUSED,
+ virNetMessageErrorPtr rerr,
+ remote_domain_del_iothread_args *args)
+{
+ int rv = -1;
+ virDomainPtr dom = NULL;
+ struct daemonClientPrivate *priv =
+ virNetServerClientGetPrivateData(client);
+
+ if (!priv->conn) {
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("connection not open"));
+ goto cleanup;
+ }
+
+ if (!(dom = get_nonnull_domain(priv->conn, args->dom)))
+ goto cleanup;
+
+ if (virDomainDelIOThread(dom, args->iothread_id, args->flags) < 0)
+ goto cleanup;
+
+ rv = 0;
+
+cleanup:
+ if (rv < 0)
+ virNetMessageSaveError(rerr);
+ virObjectUnref(dom);
+ return rv;
+}
+
+
+
static int remoteDispatchDomainDestroy(
virNetServerPtr server,
virNetServerClientPtr client,
@@ -18972,5 +19082,32 @@ virNetServerProgramProc remoteProcs[] = {
true,
0
},
+{ /* Async event DomainEventCallbackDeviceAdded => 354 */
+ NULL,
+ 0,
+ (xdrproc_t)xdr_void,
+ 0,
+ (xdrproc_t)xdr_void,
+ true,
+ 0
+},
+{ /* Method DomainAddIOThread => 355 */
+ remoteDispatchDomainAddIOThreadHelper,
+ sizeof(remote_domain_add_iothread_args),
+ (xdrproc_t)xdr_remote_domain_add_iothread_args,
+ 0,
+ (xdrproc_t)xdr_void,
+ true,
+ 0
+},
+{ /* Method DomainDelIOThread => 356 */
+ remoteDispatchDomainDelIOThreadHelper,
+ sizeof(remote_domain_del_iothread_args),
+ (xdrproc_t)xdr_remote_domain_del_iothread_args,
+ 0,
+ (xdrproc_t)xdr_void,
+ true,
+ 0
+},
};
size_t remoteNProcs = ARRAY_CARDINALITY(remoteProcs);