|
|
c401cc |
From 4b1ceac033d7f1127d663aa5eca7c1bd6ce1fcc2 Mon Sep 17 00:00:00 2001
|
|
|
c401cc |
Message-Id: <4b1ceac033d7f1127d663aa5eca7c1bd6ce1fcc2@dist-git>
|
|
|
c401cc |
From: Eric Blake <eblake@redhat.com>
|
|
|
c401cc |
Date: Wed, 5 Feb 2014 12:52:21 -0700
|
|
|
c401cc |
Subject: [PATCH] event: move event filtering to daemon (regression fix)
|
|
|
c401cc |
|
|
|
c401cc |
RHEL 7: https://bugzilla.redhat.com/show_bug.cgi?id=1047964
|
|
|
c401cc |
Fedora: https://bugzilla.redhat.com/show_bug.cgi?id=1058839
|
|
|
c401cc |
|
|
|
c401cc |
Commit f9f56340 for CVE-2014-0028 almost had the right idea - we
|
|
|
c401cc |
need to check the ACL rules to filter which events to send. But
|
|
|
c401cc |
it overlooked one thing: the event dispatch queue is running in
|
|
|
c401cc |
the main loop thread, and therefore does not normally have a
|
|
|
c401cc |
current virIdentityPtr. But filter checks can be based on current
|
|
|
c401cc |
identity, so when libvirtd.conf contains access_drivers=["polkit"],
|
|
|
c401cc |
we ended up rejecting access for EVERY event due to failure to
|
|
|
c401cc |
look up the current identity, even if it should have been allowed.
|
|
|
c401cc |
|
|
|
c401cc |
Furthermore, even for events that are triggered by API calls, it
|
|
|
c401cc |
is important to remember that the point of events is that they can
|
|
|
c401cc |
be copied across multiple connections, which may have separate
|
|
|
c401cc |
identities and permissions. So even if events were dispatched
|
|
|
c401cc |
from a context where we have an identity, we must change to the
|
|
|
c401cc |
correct identity of the connection that will be receiving the
|
|
|
c401cc |
event, rather than basing a decision on the context that triggered
|
|
|
c401cc |
the event, when deciding whether to filter an event to a
|
|
|
c401cc |
particular connection.
|
|
|
c401cc |
|
|
|
c401cc |
If there were an easy way to get from virConnectPtr to the
|
|
|
c401cc |
appropriate virIdentityPtr, then object_event.c could adjust the
|
|
|
c401cc |
identity prior to checking whether to dispatch an event. But
|
|
|
c401cc |
setting up that back-reference is a bit invasive. Instead, it
|
|
|
c401cc |
is easier to delay the filtering check until lower down the
|
|
|
c401cc |
stack, at the point where we have direct access to the RPC
|
|
|
c401cc |
client object that owns an identity. As such, this patch ends
|
|
|
c401cc |
up reverting a large portion of the framework of commit f9f56340.
|
|
|
c401cc |
We also have to teach 'make check' to special-case the fact that
|
|
|
c401cc |
the event registration filtering is done at the point of dispatch,
|
|
|
c401cc |
rather than the point of registration. Note that even though we
|
|
|
c401cc |
don't actually use virConnectDomainEventRegisterCheckACL (because
|
|
|
c401cc |
the RegisterAny variant is sufficient), we still generate the
|
|
|
c401cc |
function for the purposes of documenting that the filtering
|
|
|
c401cc |
takes place.
|
|
|
c401cc |
|
|
|
c401cc |
Also note that I did not entirely delete the notion of a filter
|
|
|
c401cc |
from object_event.c; I still plan on using that for my upcoming
|
|
|
c401cc |
patch series for qemu monitor events in libvirt-qemu.so. In
|
|
|
c401cc |
other words, while this patch changes ACL filtering to live in
|
|
|
c401cc |
remote.c and therefore we have no current client of the filtering
|
|
|
c401cc |
in object_event.c, the notion of filtering in object_event.c is
|
|
|
c401cc |
still useful down the road.
|
|
|
c401cc |
|
|
|
c401cc |
* src/check-aclrules.pl: Exempt event registration from having to
|
|
|
c401cc |
pass checkACL filter down call stack.
|
|
|
c401cc |
* daemon/remote.c (remoteRelayDomainEventCheckACL)
|
|
|
c401cc |
(remoteRelayNetworkEventCheckACL): New functions.
|
|
|
c401cc |
(remoteRelay*Event*): Use new functions.
|
|
|
c401cc |
* src/conf/domain_event.h (virDomainEventStateRegister)
|
|
|
c401cc |
(virDomainEventStateRegisterID): Drop unused parameter.
|
|
|
c401cc |
* src/conf/network_event.h (virNetworkEventStateRegisterID):
|
|
|
c401cc |
Likewise.
|
|
|
c401cc |
* src/conf/domain_event.c (virDomainEventFilter): Delete unused
|
|
|
c401cc |
function.
|
|
|
c401cc |
* src/conf/network_event.c (virNetworkEventFilter): Likewise.
|
|
|
c401cc |
* src/libxl/libxl_driver.c: Adjust caller.
|
|
|
c401cc |
* src/lxc/lxc_driver.c: Likewise.
|
|
|
c401cc |
* src/network/bridge_driver.c: Likewise.
|
|
|
c401cc |
* src/qemu/qemu_driver.c: Likewise.
|
|
|
c401cc |
* src/remote/remote_driver.c: Likewise.
|
|
|
c401cc |
* src/test/test_driver.c: Likewise.
|
|
|
c401cc |
* src/uml/uml_driver.c: Likewise.
|
|
|
c401cc |
* src/vbox/vbox_tmpl.c: Likewise.
|
|
|
c401cc |
* src/xen/xen_driver.c: Likewise.
|
|
|
c401cc |
|
|
|
c401cc |
Signed-off-by: Eric Blake <eblake@redhat.com>
|
|
|
c401cc |
(cherry picked from commit 11f20e43f1388d5f8f8c0bfac8c9cda6160a106b)
|
|
|
c401cc |
|
|
|
c401cc |
Conflicts:
|
|
|
c401cc |
daemon/remote.c - not backporting network events
|
|
|
c401cc |
src/conf/network_event.c - likewise
|
|
|
c401cc |
src/conf/network_event.h - likewise
|
|
|
c401cc |
src/network/bridge_driver.c - likewise
|
|
|
c401cc |
src/conf/domain_event.c - revert back to pre-CVE state
|
|
|
c401cc |
src/conf/domain_event.h - likewise
|
|
|
c401cc |
src/libxl/libxl_driver.c - likewise
|
|
|
c401cc |
src/lxc/lxc_driver.c - likewise
|
|
|
c401cc |
src/remote/remote_driver.c - likewise
|
|
|
c401cc |
src/test/test_driver.c - likewise
|
|
|
c401cc |
src/uml/uml_driver.c - likewise
|
|
|
c401cc |
src/xen/xen_driver.c - likewise
|
|
|
c401cc |
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
|
|
|
c401cc |
---
|
|
|
c401cc |
daemon/remote.c | 224 +++++++++++++++++++++++++++------------------
|
|
|
c401cc |
src/check-aclrules.pl | 7 +-
|
|
|
c401cc |
src/conf/domain_event.c | 69 +-------------
|
|
|
c401cc |
src/conf/domain_event.h | 8 +-
|
|
|
c401cc |
src/libxl/libxl_driver.c | 2 -
|
|
|
c401cc |
src/lxc/lxc_driver.c | 2 -
|
|
|
c401cc |
src/qemu/qemu_driver.c | 2 -
|
|
|
c401cc |
src/remote/remote_driver.c | 4 +-
|
|
|
c401cc |
src/test/test_driver.c | 4 +-
|
|
|
c401cc |
src/uml/uml_driver.c | 2 -
|
|
|
c401cc |
src/vbox/vbox_tmpl.c | 4 +-
|
|
|
c401cc |
src/xen/xen_driver.c | 2 -
|
|
|
c401cc |
12 files changed, 153 insertions(+), 177 deletions(-)
|
|
|
c401cc |
|
|
|
c401cc |
diff --git a/daemon/remote.c b/daemon/remote.c
|
|
|
c401cc |
index 1ba8ac2..3276b34 100644
|
|
|
c401cc |
--- a/daemon/remote.c
|
|
|
c401cc |
+++ b/daemon/remote.c
|
|
|
c401cc |
@@ -49,6 +49,8 @@
|
|
|
c401cc |
#include "qemu_protocol.h"
|
|
|
c401cc |
#include "lxc_protocol.h"
|
|
|
c401cc |
#include "virstring.h"
|
|
|
c401cc |
+#include "domain_conf.h"
|
|
|
c401cc |
+#include "viraccessapicheck.h"
|
|
|
c401cc |
|
|
|
c401cc |
#define VIR_FROM_THIS VIR_FROM_RPC
|
|
|
c401cc |
|
|
|
c401cc |
@@ -114,16 +116,45 @@ remoteDispatchDomainEventSend(virNetServerClientPtr client,
|
|
|
c401cc |
xdrproc_t proc,
|
|
|
c401cc |
void *data);
|
|
|
c401cc |
|
|
|
c401cc |
-static int remoteRelayDomainEventLifecycle(virConnectPtr conn ATTRIBUTE_UNUSED,
|
|
|
c401cc |
- virDomainPtr dom,
|
|
|
c401cc |
- int event,
|
|
|
c401cc |
- int detail,
|
|
|
c401cc |
- void *opaque)
|
|
|
c401cc |
+
|
|
|
c401cc |
+static bool
|
|
|
c401cc |
+remoteRelayDomainEventCheckACL(virNetServerClientPtr client,
|
|
|
c401cc |
+ virConnectPtr conn, virDomainPtr dom)
|
|
|
c401cc |
+{
|
|
|
c401cc |
+ virDomainDef def;
|
|
|
c401cc |
+ virIdentityPtr identity = NULL;
|
|
|
c401cc |
+ bool ret = false;
|
|
|
c401cc |
+
|
|
|
c401cc |
+ /* For now, we just create a virDomainDef with enough contents to
|
|
|
c401cc |
+ * satisfy what viraccessdriverpolkit.c references. This is a bit
|
|
|
c401cc |
+ * fragile, but I don't know of anything better. */
|
|
|
c401cc |
+ def.name = dom->name;
|
|
|
c401cc |
+ memcpy(def.uuid, dom->uuid, VIR_UUID_BUFLEN);
|
|
|
c401cc |
+
|
|
|
c401cc |
+ if (!(identity = virNetServerClientGetIdentity(client)))
|
|
|
c401cc |
+ goto cleanup;
|
|
|
c401cc |
+ if (virIdentitySetCurrent(identity) < 0)
|
|
|
c401cc |
+ goto cleanup;
|
|
|
c401cc |
+ ret = virConnectDomainEventRegisterAnyCheckACL(conn, &def;;
|
|
|
c401cc |
+
|
|
|
c401cc |
+cleanup:
|
|
|
c401cc |
+ ignore_value(virIdentitySetCurrent(NULL));
|
|
|
c401cc |
+ virObjectUnref(identity);
|
|
|
c401cc |
+ return ret;
|
|
|
c401cc |
+}
|
|
|
c401cc |
+
|
|
|
c401cc |
+
|
|
|
c401cc |
+static int
|
|
|
c401cc |
+remoteRelayDomainEventLifecycle(virConnectPtr conn,
|
|
|
c401cc |
+ virDomainPtr dom,
|
|
|
c401cc |
+ int event,
|
|
|
c401cc |
+ int detail,
|
|
|
c401cc |
+ void *opaque)
|
|
|
c401cc |
{
|
|
|
c401cc |
virNetServerClientPtr client = opaque;
|
|
|
c401cc |
remote_domain_event_lifecycle_msg data;
|
|
|
c401cc |
|
|
|
c401cc |
- if (!client)
|
|
|
c401cc |
+ if (!client || !remoteRelayDomainEventCheckACL(client, conn, dom))
|
|
|
c401cc |
return -1;
|
|
|
c401cc |
|
|
|
c401cc |
VIR_DEBUG("Relaying domain lifecycle event %d %d", event, detail);
|
|
|
c401cc |
@@ -141,14 +172,15 @@ static int remoteRelayDomainEventLifecycle(virConnectPtr conn ATTRIBUTE_UNUSED,
|
|
|
c401cc |
return 0;
|
|
|
c401cc |
}
|
|
|
c401cc |
|
|
|
c401cc |
-static int remoteRelayDomainEventReboot(virConnectPtr conn ATTRIBUTE_UNUSED,
|
|
|
c401cc |
- virDomainPtr dom,
|
|
|
c401cc |
- void *opaque)
|
|
|
c401cc |
+static int
|
|
|
c401cc |
+remoteRelayDomainEventReboot(virConnectPtr conn,
|
|
|
c401cc |
+ virDomainPtr dom,
|
|
|
c401cc |
+ void *opaque)
|
|
|
c401cc |
{
|
|
|
c401cc |
virNetServerClientPtr client = opaque;
|
|
|
c401cc |
remote_domain_event_reboot_msg data;
|
|
|
c401cc |
|
|
|
c401cc |
- if (!client)
|
|
|
c401cc |
+ if (!client || !remoteRelayDomainEventCheckACL(client, conn, dom))
|
|
|
c401cc |
return -1;
|
|
|
c401cc |
|
|
|
c401cc |
VIR_DEBUG("Relaying domain reboot event %s %d", dom->name, dom->id);
|
|
|
c401cc |
@@ -165,15 +197,16 @@ static int remoteRelayDomainEventReboot(virConnectPtr conn ATTRIBUTE_UNUSED,
|
|
|
c401cc |
}
|
|
|
c401cc |
|
|
|
c401cc |
|
|
|
c401cc |
-static int remoteRelayDomainEventRTCChange(virConnectPtr conn ATTRIBUTE_UNUSED,
|
|
|
c401cc |
- virDomainPtr dom,
|
|
|
c401cc |
- long long offset,
|
|
|
c401cc |
- void *opaque)
|
|
|
c401cc |
+static int
|
|
|
c401cc |
+remoteRelayDomainEventRTCChange(virConnectPtr conn,
|
|
|
c401cc |
+ virDomainPtr dom,
|
|
|
c401cc |
+ long long offset,
|
|
|
c401cc |
+ void *opaque)
|
|
|
c401cc |
{
|
|
|
c401cc |
virNetServerClientPtr client = opaque;
|
|
|
c401cc |
remote_domain_event_rtc_change_msg data;
|
|
|
c401cc |
|
|
|
c401cc |
- if (!client)
|
|
|
c401cc |
+ if (!client || !remoteRelayDomainEventCheckACL(client, conn, dom))
|
|
|
c401cc |
return -1;
|
|
|
c401cc |
|
|
|
c401cc |
VIR_DEBUG("Relaying domain rtc change event %s %d %lld", dom->name, dom->id, offset);
|
|
|
c401cc |
@@ -191,15 +224,16 @@ static int remoteRelayDomainEventRTCChange(virConnectPtr conn ATTRIBUTE_UNUSED,
|
|
|
c401cc |
}
|
|
|
c401cc |
|
|
|
c401cc |
|
|
|
c401cc |
-static int remoteRelayDomainEventWatchdog(virConnectPtr conn ATTRIBUTE_UNUSED,
|
|
|
c401cc |
- virDomainPtr dom,
|
|
|
c401cc |
- int action,
|
|
|
c401cc |
- void *opaque)
|
|
|
c401cc |
+static int
|
|
|
c401cc |
+remoteRelayDomainEventWatchdog(virConnectPtr conn,
|
|
|
c401cc |
+ virDomainPtr dom,
|
|
|
c401cc |
+ int action,
|
|
|
c401cc |
+ void *opaque)
|
|
|
c401cc |
{
|
|
|
c401cc |
virNetServerClientPtr client = opaque;
|
|
|
c401cc |
remote_domain_event_watchdog_msg data;
|
|
|
c401cc |
|
|
|
c401cc |
- if (!client)
|
|
|
c401cc |
+ if (!client || !remoteRelayDomainEventCheckACL(client, conn, dom))
|
|
|
c401cc |
return -1;
|
|
|
c401cc |
|
|
|
c401cc |
VIR_DEBUG("Relaying domain watchdog event %s %d %d", dom->name, dom->id, action);
|
|
|
c401cc |
@@ -217,17 +251,18 @@ static int remoteRelayDomainEventWatchdog(virConnectPtr conn ATTRIBUTE_UNUSED,
|
|
|
c401cc |
}
|
|
|
c401cc |
|
|
|
c401cc |
|
|
|
c401cc |
-static int remoteRelayDomainEventIOError(virConnectPtr conn ATTRIBUTE_UNUSED,
|
|
|
c401cc |
- virDomainPtr dom,
|
|
|
c401cc |
- const char *srcPath,
|
|
|
c401cc |
- const char *devAlias,
|
|
|
c401cc |
- int action,
|
|
|
c401cc |
- void *opaque)
|
|
|
c401cc |
+static int
|
|
|
c401cc |
+remoteRelayDomainEventIOError(virConnectPtr conn,
|
|
|
c401cc |
+ virDomainPtr dom,
|
|
|
c401cc |
+ const char *srcPath,
|
|
|
c401cc |
+ const char *devAlias,
|
|
|
c401cc |
+ int action,
|
|
|
c401cc |
+ void *opaque)
|
|
|
c401cc |
{
|
|
|
c401cc |
virNetServerClientPtr client = opaque;
|
|
|
c401cc |
remote_domain_event_io_error_msg data;
|
|
|
c401cc |
|
|
|
c401cc |
- if (!client)
|
|
|
c401cc |
+ if (!client || !remoteRelayDomainEventCheckACL(client, conn, dom))
|
|
|
c401cc |
return -1;
|
|
|
c401cc |
|
|
|
c401cc |
VIR_DEBUG("Relaying domain io error %s %d %s %s %d", dom->name, dom->id, srcPath, devAlias, action);
|
|
|
c401cc |
@@ -252,18 +287,19 @@ error:
|
|
|
c401cc |
}
|
|
|
c401cc |
|
|
|
c401cc |
|
|
|
c401cc |
-static int remoteRelayDomainEventIOErrorReason(virConnectPtr conn ATTRIBUTE_UNUSED,
|
|
|
c401cc |
- virDomainPtr dom,
|
|
|
c401cc |
- const char *srcPath,
|
|
|
c401cc |
- const char *devAlias,
|
|
|
c401cc |
- int action,
|
|
|
c401cc |
- const char *reason,
|
|
|
c401cc |
- void *opaque)
|
|
|
c401cc |
+static int
|
|
|
c401cc |
+remoteRelayDomainEventIOErrorReason(virConnectPtr conn,
|
|
|
c401cc |
+ virDomainPtr dom,
|
|
|
c401cc |
+ const char *srcPath,
|
|
|
c401cc |
+ const char *devAlias,
|
|
|
c401cc |
+ int action,
|
|
|
c401cc |
+ const char *reason,
|
|
|
c401cc |
+ void *opaque)
|
|
|
c401cc |
{
|
|
|
c401cc |
virNetServerClientPtr client = opaque;
|
|
|
c401cc |
remote_domain_event_io_error_reason_msg data;
|
|
|
c401cc |
|
|
|
c401cc |
- if (!client)
|
|
|
c401cc |
+ if (!client || !remoteRelayDomainEventCheckACL(client, conn, dom))
|
|
|
c401cc |
return -1;
|
|
|
c401cc |
|
|
|
c401cc |
VIR_DEBUG("Relaying domain io error %s %d %s %s %d %s",
|
|
|
c401cc |
@@ -293,20 +329,21 @@ error:
|
|
|
c401cc |
}
|
|
|
c401cc |
|
|
|
c401cc |
|
|
|
c401cc |
-static int remoteRelayDomainEventGraphics(virConnectPtr conn ATTRIBUTE_UNUSED,
|
|
|
c401cc |
- virDomainPtr dom,
|
|
|
c401cc |
- int phase,
|
|
|
c401cc |
- virDomainEventGraphicsAddressPtr local,
|
|
|
c401cc |
- virDomainEventGraphicsAddressPtr remote,
|
|
|
c401cc |
- const char *authScheme,
|
|
|
c401cc |
- virDomainEventGraphicsSubjectPtr subject,
|
|
|
c401cc |
- void *opaque)
|
|
|
c401cc |
+static int
|
|
|
c401cc |
+remoteRelayDomainEventGraphics(virConnectPtr conn,
|
|
|
c401cc |
+ virDomainPtr dom,
|
|
|
c401cc |
+ int phase,
|
|
|
c401cc |
+ virDomainEventGraphicsAddressPtr local,
|
|
|
c401cc |
+ virDomainEventGraphicsAddressPtr remote,
|
|
|
c401cc |
+ const char *authScheme,
|
|
|
c401cc |
+ virDomainEventGraphicsSubjectPtr subject,
|
|
|
c401cc |
+ void *opaque)
|
|
|
c401cc |
{
|
|
|
c401cc |
virNetServerClientPtr client = opaque;
|
|
|
c401cc |
remote_domain_event_graphics_msg data;
|
|
|
c401cc |
size_t i;
|
|
|
c401cc |
|
|
|
c401cc |
- if (!client)
|
|
|
c401cc |
+ if (!client || !remoteRelayDomainEventCheckACL(client, conn, dom))
|
|
|
c401cc |
return -1;
|
|
|
c401cc |
|
|
|
c401cc |
VIR_DEBUG("Relaying domain graphics event %s %d %d - %d %s %s - %d %s %s - %s", dom->name, dom->id, phase,
|
|
|
c401cc |
@@ -364,17 +401,18 @@ error:
|
|
|
c401cc |
return -1;
|
|
|
c401cc |
}
|
|
|
c401cc |
|
|
|
c401cc |
-static int remoteRelayDomainEventBlockJob(virConnectPtr conn ATTRIBUTE_UNUSED,
|
|
|
c401cc |
- virDomainPtr dom,
|
|
|
c401cc |
- const char *path,
|
|
|
c401cc |
- int type,
|
|
|
c401cc |
- int status,
|
|
|
c401cc |
- void *opaque)
|
|
|
c401cc |
+static int
|
|
|
c401cc |
+remoteRelayDomainEventBlockJob(virConnectPtr conn,
|
|
|
c401cc |
+ virDomainPtr dom,
|
|
|
c401cc |
+ const char *path,
|
|
|
c401cc |
+ int type,
|
|
|
c401cc |
+ int status,
|
|
|
c401cc |
+ void *opaque)
|
|
|
c401cc |
{
|
|
|
c401cc |
virNetServerClientPtr client = opaque;
|
|
|
c401cc |
remote_domain_event_block_job_msg data;
|
|
|
c401cc |
|
|
|
c401cc |
- if (!client)
|
|
|
c401cc |
+ if (!client || !remoteRelayDomainEventCheckACL(client, conn, dom))
|
|
|
c401cc |
return -1;
|
|
|
c401cc |
|
|
|
c401cc |
VIR_DEBUG("Relaying domain block job event %s %d %s %i, %i",
|
|
|
c401cc |
@@ -399,14 +437,15 @@ error:
|
|
|
c401cc |
}
|
|
|
c401cc |
|
|
|
c401cc |
|
|
|
c401cc |
-static int remoteRelayDomainEventControlError(virConnectPtr conn ATTRIBUTE_UNUSED,
|
|
|
c401cc |
- virDomainPtr dom,
|
|
|
c401cc |
- void *opaque)
|
|
|
c401cc |
+static int
|
|
|
c401cc |
+remoteRelayDomainEventControlError(virConnectPtr conn,
|
|
|
c401cc |
+ virDomainPtr dom,
|
|
|
c401cc |
+ void *opaque)
|
|
|
c401cc |
{
|
|
|
c401cc |
virNetServerClientPtr client = opaque;
|
|
|
c401cc |
remote_domain_event_control_error_msg data;
|
|
|
c401cc |
|
|
|
c401cc |
- if (!client)
|
|
|
c401cc |
+ if (!client || !remoteRelayDomainEventCheckACL(client, conn, dom))
|
|
|
c401cc |
return -1;
|
|
|
c401cc |
|
|
|
c401cc |
VIR_DEBUG("Relaying domain control error %s %d", dom->name, dom->id);
|
|
|
c401cc |
@@ -423,19 +462,20 @@ static int remoteRelayDomainEventControlError(virConnectPtr conn ATTRIBUTE_UNUSE
|
|
|
c401cc |
}
|
|
|
c401cc |
|
|
|
c401cc |
|
|
|
c401cc |
-static int remoteRelayDomainEventDiskChange(virConnectPtr conn ATTRIBUTE_UNUSED,
|
|
|
c401cc |
- virDomainPtr dom,
|
|
|
c401cc |
- const char *oldSrcPath,
|
|
|
c401cc |
- const char *newSrcPath,
|
|
|
c401cc |
- const char *devAlias,
|
|
|
c401cc |
- int reason,
|
|
|
c401cc |
- void *opaque)
|
|
|
c401cc |
+static int
|
|
|
c401cc |
+remoteRelayDomainEventDiskChange(virConnectPtr conn,
|
|
|
c401cc |
+ virDomainPtr dom,
|
|
|
c401cc |
+ const char *oldSrcPath,
|
|
|
c401cc |
+ const char *newSrcPath,
|
|
|
c401cc |
+ const char *devAlias,
|
|
|
c401cc |
+ int reason,
|
|
|
c401cc |
+ void *opaque)
|
|
|
c401cc |
{
|
|
|
c401cc |
virNetServerClientPtr client = opaque;
|
|
|
c401cc |
remote_domain_event_disk_change_msg data;
|
|
|
c401cc |
char **oldSrcPath_p = NULL, **newSrcPath_p = NULL;
|
|
|
c401cc |
|
|
|
c401cc |
- if (!client)
|
|
|
c401cc |
+ if (!client || !remoteRelayDomainEventCheckACL(client, conn, dom))
|
|
|
c401cc |
return -1;
|
|
|
c401cc |
|
|
|
c401cc |
VIR_DEBUG("Relaying domain %s %d disk change %s %s %s %d",
|
|
|
c401cc |
@@ -474,15 +514,17 @@ error:
|
|
|
c401cc |
}
|
|
|
c401cc |
|
|
|
c401cc |
|
|
|
c401cc |
-static int remoteRelayDomainEventTrayChange(virConnectPtr conn ATTRIBUTE_UNUSED,
|
|
|
c401cc |
- virDomainPtr dom,
|
|
|
c401cc |
- const char *devAlias,
|
|
|
c401cc |
- int reason,
|
|
|
c401cc |
- void *opaque) {
|
|
|
c401cc |
+static int
|
|
|
c401cc |
+remoteRelayDomainEventTrayChange(virConnectPtr conn,
|
|
|
c401cc |
+ virDomainPtr dom,
|
|
|
c401cc |
+ const char *devAlias,
|
|
|
c401cc |
+ int reason,
|
|
|
c401cc |
+ void *opaque)
|
|
|
c401cc |
+{
|
|
|
c401cc |
virNetServerClientPtr client = opaque;
|
|
|
c401cc |
remote_domain_event_tray_change_msg data;
|
|
|
c401cc |
|
|
|
c401cc |
- if (!client)
|
|
|
c401cc |
+ if (!client || !remoteRelayDomainEventCheckACL(client, conn, dom))
|
|
|
c401cc |
return -1;
|
|
|
c401cc |
|
|
|
c401cc |
VIR_DEBUG("Relaying domain %s %d tray change devAlias: %s reason: %d",
|
|
|
c401cc |
@@ -504,14 +546,16 @@ static int remoteRelayDomainEventTrayChange(virConnectPtr conn ATTRIBUTE_UNUSED,
|
|
|
c401cc |
return 0;
|
|
|
c401cc |
}
|
|
|
c401cc |
|
|
|
c401cc |
-static int remoteRelayDomainEventPMWakeup(virConnectPtr conn ATTRIBUTE_UNUSED,
|
|
|
c401cc |
- virDomainPtr dom,
|
|
|
c401cc |
- int reason ATTRIBUTE_UNUSED,
|
|
|
c401cc |
- void *opaque) {
|
|
|
c401cc |
+static int
|
|
|
c401cc |
+remoteRelayDomainEventPMWakeup(virConnectPtr conn,
|
|
|
c401cc |
+ virDomainPtr dom,
|
|
|
c401cc |
+ int reason ATTRIBUTE_UNUSED,
|
|
|
c401cc |
+ void *opaque)
|
|
|
c401cc |
+{
|
|
|
c401cc |
virNetServerClientPtr client = opaque;
|
|
|
c401cc |
remote_domain_event_pmwakeup_msg data;
|
|
|
c401cc |
|
|
|
c401cc |
- if (!client)
|
|
|
c401cc |
+ if (!client || !remoteRelayDomainEventCheckACL(client, conn, dom))
|
|
|
c401cc |
return -1;
|
|
|
c401cc |
|
|
|
c401cc |
VIR_DEBUG("Relaying domain %s %d system pmwakeup", dom->name, dom->id);
|
|
|
c401cc |
@@ -527,14 +571,16 @@ static int remoteRelayDomainEventPMWakeup(virConnectPtr conn ATTRIBUTE_UNUSED,
|
|
|
c401cc |
return 0;
|
|
|
c401cc |
}
|
|
|
c401cc |
|
|
|
c401cc |
-static int remoteRelayDomainEventPMSuspend(virConnectPtr conn ATTRIBUTE_UNUSED,
|
|
|
c401cc |
- virDomainPtr dom,
|
|
|
c401cc |
- int reason ATTRIBUTE_UNUSED,
|
|
|
c401cc |
- void *opaque) {
|
|
|
c401cc |
+static int
|
|
|
c401cc |
+remoteRelayDomainEventPMSuspend(virConnectPtr conn,
|
|
|
c401cc |
+ virDomainPtr dom,
|
|
|
c401cc |
+ int reason ATTRIBUTE_UNUSED,
|
|
|
c401cc |
+ void *opaque)
|
|
|
c401cc |
+{
|
|
|
c401cc |
virNetServerClientPtr client = opaque;
|
|
|
c401cc |
remote_domain_event_pmsuspend_msg data;
|
|
|
c401cc |
|
|
|
c401cc |
- if (!client)
|
|
|
c401cc |
+ if (!client || !remoteRelayDomainEventCheckACL(client, conn, dom))
|
|
|
c401cc |
return -1;
|
|
|
c401cc |
|
|
|
c401cc |
VIR_DEBUG("Relaying domain %s %d system pmsuspend", dom->name, dom->id);
|
|
|
c401cc |
@@ -551,7 +597,7 @@ static int remoteRelayDomainEventPMSuspend(virConnectPtr conn ATTRIBUTE_UNUSED,
|
|
|
c401cc |
}
|
|
|
c401cc |
|
|
|
c401cc |
static int
|
|
|
c401cc |
-remoteRelayDomainEventBalloonChange(virConnectPtr conn ATTRIBUTE_UNUSED,
|
|
|
c401cc |
+remoteRelayDomainEventBalloonChange(virConnectPtr conn,
|
|
|
c401cc |
virDomainPtr dom,
|
|
|
c401cc |
unsigned long long actual,
|
|
|
c401cc |
void *opaque)
|
|
|
c401cc |
@@ -559,7 +605,7 @@ remoteRelayDomainEventBalloonChange(virConnectPtr conn ATTRIBUTE_UNUSED,
|
|
|
c401cc |
virNetServerClientPtr client = opaque;
|
|
|
c401cc |
remote_domain_event_balloon_change_msg data;
|
|
|
c401cc |
|
|
|
c401cc |
- if (!client)
|
|
|
c401cc |
+ if (!client || !remoteRelayDomainEventCheckACL(client, conn, dom))
|
|
|
c401cc |
return -1;
|
|
|
c401cc |
|
|
|
c401cc |
VIR_DEBUG("Relaying domain balloon change event %s %d %lld", dom->name, dom->id, actual);
|
|
|
c401cc |
@@ -577,14 +623,16 @@ remoteRelayDomainEventBalloonChange(virConnectPtr conn ATTRIBUTE_UNUSED,
|
|
|
c401cc |
}
|
|
|
c401cc |
|
|
|
c401cc |
|
|
|
c401cc |
-static int remoteRelayDomainEventPMSuspendDisk(virConnectPtr conn ATTRIBUTE_UNUSED,
|
|
|
c401cc |
- virDomainPtr dom,
|
|
|
c401cc |
- int reason ATTRIBUTE_UNUSED,
|
|
|
c401cc |
- void *opaque) {
|
|
|
c401cc |
+static int
|
|
|
c401cc |
+remoteRelayDomainEventPMSuspendDisk(virConnectPtr conn,
|
|
|
c401cc |
+ virDomainPtr dom,
|
|
|
c401cc |
+ int reason ATTRIBUTE_UNUSED,
|
|
|
c401cc |
+ void *opaque)
|
|
|
c401cc |
+{
|
|
|
c401cc |
virNetServerClientPtr client = opaque;
|
|
|
c401cc |
remote_domain_event_pmsuspend_disk_msg data;
|
|
|
c401cc |
|
|
|
c401cc |
- if (!client)
|
|
|
c401cc |
+ if (!client || !remoteRelayDomainEventCheckACL(client, conn, dom))
|
|
|
c401cc |
return -1;
|
|
|
c401cc |
|
|
|
c401cc |
VIR_DEBUG("Relaying domain %s %d system pmsuspend-disk", dom->name, dom->id);
|
|
|
c401cc |
@@ -601,7 +649,7 @@ static int remoteRelayDomainEventPMSuspendDisk(virConnectPtr conn ATTRIBUTE_UNUS
|
|
|
c401cc |
}
|
|
|
c401cc |
|
|
|
c401cc |
static int
|
|
|
c401cc |
-remoteRelayDomainEventDeviceRemoved(virConnectPtr conn ATTRIBUTE_UNUSED,
|
|
|
c401cc |
+remoteRelayDomainEventDeviceRemoved(virConnectPtr conn,
|
|
|
c401cc |
virDomainPtr dom,
|
|
|
c401cc |
const char *devAlias,
|
|
|
c401cc |
void *opaque)
|
|
|
c401cc |
@@ -609,7 +657,7 @@ remoteRelayDomainEventDeviceRemoved(virConnectPtr conn ATTRIBUTE_UNUSED,
|
|
|
c401cc |
virNetServerClientPtr client = opaque;
|
|
|
c401cc |
remote_domain_event_device_removed_msg data;
|
|
|
c401cc |
|
|
|
c401cc |
- if (!client)
|
|
|
c401cc |
+ if (!client || !remoteRelayDomainEventCheckACL(client, conn, dom))
|
|
|
c401cc |
return -1;
|
|
|
c401cc |
|
|
|
c401cc |
VIR_DEBUG("Relaying domain device removed event %s %d %s",
|
|
|
c401cc |
diff --git a/src/check-aclrules.pl b/src/check-aclrules.pl
|
|
|
c401cc |
index 057517e..f54b934 100644
|
|
|
c401cc |
--- a/src/check-aclrules.pl
|
|
|
c401cc |
+++ b/src/check-aclrules.pl
|
|
|
c401cc |
@@ -1,6 +1,6 @@
|
|
|
c401cc |
#!/usr/bin/perl
|
|
|
c401cc |
#
|
|
|
c401cc |
-# Copyright (C) 2013 Red Hat, Inc.
|
|
|
c401cc |
+# Copyright (C) 2013-2014 Red Hat, Inc.
|
|
|
c401cc |
#
|
|
|
c401cc |
# This library is free software; you can redistribute it and/or
|
|
|
c401cc |
# modify it under the terms of the GNU Lesser General Public
|
|
|
c401cc |
@@ -140,7 +140,10 @@ while (<PROTO>) {
|
|
|
c401cc |
} elsif ($filtered &&
|
|
|
c401cc |
m,REMOTE_PROC_(.*)\s+=\s*\d+,) {
|
|
|
c401cc |
my $api = name_to_ProcName($1);
|
|
|
c401cc |
- $filtered{$api} = 1;
|
|
|
c401cc |
+ # Event filtering is handled in daemon/remote.c instead of drivers
|
|
|
c401cc |
+ if (! m,_EVENT_REGISTER,) {
|
|
|
c401cc |
+ $filtered{$api} = 1;
|
|
|
c401cc |
+ }
|
|
|
c401cc |
$incomment = 0;
|
|
|
c401cc |
}
|
|
|
c401cc |
}
|
|
|
c401cc |
diff --git a/src/conf/domain_event.c b/src/conf/domain_event.c
|
|
|
c401cc |
index 1736aa0..de55d08 100644
|
|
|
c401cc |
--- a/src/conf/domain_event.c
|
|
|
c401cc |
+++ b/src/conf/domain_event.c
|
|
|
c401cc |
@@ -32,20 +32,6 @@
|
|
|
c401cc |
|
|
|
c401cc |
#define VIR_FROM_THIS VIR_FROM_NONE
|
|
|
c401cc |
|
|
|
c401cc |
-/**
|
|
|
c401cc |
- * virObjectEventCallbackFilter:
|
|
|
c401cc |
- * @conn: the connection pointer
|
|
|
c401cc |
- * @event: the event about to be dispatched
|
|
|
c401cc |
- * @opaque: opaque data registered with the filter
|
|
|
c401cc |
- *
|
|
|
c401cc |
- * Callback to do final filtering for a reason not tracked directly by
|
|
|
c401cc |
- * virObjectEventStateRegisterID(). Return false if @event must not
|
|
|
c401cc |
- * be sent to @conn.
|
|
|
c401cc |
- */
|
|
|
c401cc |
-typedef bool (*virObjectEventCallbackFilter)(virConnectPtr conn,
|
|
|
c401cc |
- virDomainEventPtr event,
|
|
|
c401cc |
- void *opaque);
|
|
|
c401cc |
-
|
|
|
c401cc |
struct _virDomainMeta {
|
|
|
c401cc |
int id;
|
|
|
c401cc |
char *name;
|
|
|
c401cc |
@@ -82,8 +68,6 @@ struct _virDomainEventCallback {
|
|
|
c401cc |
int eventID;
|
|
|
c401cc |
virConnectPtr conn;
|
|
|
c401cc |
virDomainMetaPtr dom;
|
|
|
c401cc |
- virObjectEventCallbackFilter filter;
|
|
|
c401cc |
- void *filter_opaque;
|
|
|
c401cc |
virConnectDomainEventGenericCallback cb;
|
|
|
c401cc |
void *opaque;
|
|
|
c401cc |
virFreeCallback freecb;
|
|
|
c401cc |
@@ -360,9 +344,6 @@ virDomainEventCallbackListPurgeMarked(virDomainEventCallbackListPtr cbList)
|
|
|
c401cc |
* virDomainEventCallbackListAddID:
|
|
|
c401cc |
* @conn: pointer to the connection
|
|
|
c401cc |
* @cbList: the list
|
|
|
c401cc |
- * @dom: optional domain to filter on
|
|
|
c401cc |
- * @filter optional last-ditch filter callback
|
|
|
c401cc |
- * @filter_opaque: opaque data to pass to @filter
|
|
|
c401cc |
* @eventID: the event ID
|
|
|
c401cc |
* @callback: the callback to add
|
|
|
c401cc |
* @opaque: opaque data tio pass to callback
|
|
|
c401cc |
@@ -374,8 +355,6 @@ static int
|
|
|
c401cc |
virDomainEventCallbackListAddID(virConnectPtr conn,
|
|
|
c401cc |
virDomainEventCallbackListPtr cbList,
|
|
|
c401cc |
virDomainPtr dom,
|
|
|
c401cc |
- virObjectEventCallbackFilter filter,
|
|
|
c401cc |
- void *filter_opaque,
|
|
|
c401cc |
int eventID,
|
|
|
c401cc |
virConnectDomainEventGenericCallback callback,
|
|
|
c401cc |
void *opaque,
|
|
|
c401cc |
@@ -422,8 +401,6 @@ virDomainEventCallbackListAddID(virConnectPtr conn,
|
|
|
c401cc |
memcpy(event->dom->uuid, dom->uuid, VIR_UUID_BUFLEN);
|
|
|
c401cc |
event->dom->id = dom->id;
|
|
|
c401cc |
}
|
|
|
c401cc |
- event->filter = filter;
|
|
|
c401cc |
- event->filter_opaque = filter_opaque;
|
|
|
c401cc |
|
|
|
c401cc |
/* Make space on list */
|
|
|
c401cc |
if (VIR_REALLOC_N(cbList->callbacks, cbList->count + 1) < 0)
|
|
|
c401cc |
@@ -463,8 +440,6 @@ error:
|
|
|
c401cc |
* virDomainEventCallbackListAdd:
|
|
|
c401cc |
* @conn: pointer to the connection
|
|
|
c401cc |
* @cbList: the list
|
|
|
c401cc |
- * @filter optional last-ditch filter callback
|
|
|
c401cc |
- * @filter_opaque: opaque data to pass to @filter
|
|
|
c401cc |
* @callback: the callback to add
|
|
|
c401cc |
* @opaque: opaque data tio pass to callback
|
|
|
c401cc |
*
|
|
|
c401cc |
@@ -473,14 +448,11 @@ error:
|
|
|
c401cc |
static int
|
|
|
c401cc |
virDomainEventCallbackListAdd(virConnectPtr conn,
|
|
|
c401cc |
virDomainEventCallbackListPtr cbList,
|
|
|
c401cc |
- virObjectEventCallbackFilter filter,
|
|
|
c401cc |
- void *filter_opaque,
|
|
|
c401cc |
virConnectDomainEventCallback callback,
|
|
|
c401cc |
void *opaque,
|
|
|
c401cc |
virFreeCallback freecb)
|
|
|
c401cc |
{
|
|
|
c401cc |
return virDomainEventCallbackListAddID(conn, cbList, NULL,
|
|
|
c401cc |
- filter, filter_opaque,
|
|
|
c401cc |
VIR_DOMAIN_EVENT_ID_LIFECYCLE,
|
|
|
c401cc |
VIR_DOMAIN_EVENT_CALLBACK(callback),
|
|
|
c401cc |
opaque, freecb, NULL);
|
|
|
c401cc |
@@ -708,32 +680,6 @@ static virDomainEventPtr virDomainEventNewInternal(int eventID,
|
|
|
c401cc |
return event;
|
|
|
c401cc |
}
|
|
|
c401cc |
|
|
|
c401cc |
-
|
|
|
c401cc |
-/**
|
|
|
c401cc |
- * virDomainEventFilter:
|
|
|
c401cc |
- * @conn: pointer to the connection
|
|
|
c401cc |
- * @event: the event to check
|
|
|
c401cc |
- * @opaque: opaque data holding ACL filter to use
|
|
|
c401cc |
- *
|
|
|
c401cc |
- * Internal function to run ACL filtering before dispatching an event
|
|
|
c401cc |
- */
|
|
|
c401cc |
-static bool
|
|
|
c401cc |
-virDomainEventFilter(virConnectPtr conn, virDomainEventPtr event,
|
|
|
c401cc |
- void *opaque)
|
|
|
c401cc |
-{
|
|
|
c401cc |
- virDomainDef dom;
|
|
|
c401cc |
- virDomainObjListFilter filter = opaque;
|
|
|
c401cc |
-
|
|
|
c401cc |
- /* For now, we just create a virDomainDef with enough contents to
|
|
|
c401cc |
- * satisfy what viraccessdriverpolkit.c references. This is a bit
|
|
|
c401cc |
- * fragile, but I don't know of anything better. */
|
|
|
c401cc |
- dom.name = event->dom.name;
|
|
|
c401cc |
- memcpy(dom.uuid, event->dom.uuid, VIR_UUID_BUFLEN);
|
|
|
c401cc |
-
|
|
|
c401cc |
- return (filter)(conn, &dom;;
|
|
|
c401cc |
-}
|
|
|
c401cc |
-
|
|
|
c401cc |
-
|
|
|
c401cc |
virDomainEventPtr virDomainEventNew(int id, const char *name,
|
|
|
c401cc |
const unsigned char *uuid,
|
|
|
c401cc |
int type, int detail)
|
|
|
c401cc |
@@ -1435,9 +1381,6 @@ static int virDomainEventDispatchMatchCallback(virDomainEventPtr event,
|
|
|
c401cc |
if (cb->eventID != event->eventID)
|
|
|
c401cc |
return 0;
|
|
|
c401cc |
|
|
|
c401cc |
- if (cb->filter && !(cb->filter)(cb->conn, event, cb->filter_opaque))
|
|
|
c401cc |
- return 0;
|
|
|
c401cc |
-
|
|
|
c401cc |
if (cb->dom) {
|
|
|
c401cc |
/* Deliberately ignoring 'id' for matching, since that
|
|
|
c401cc |
* will cause problems when a domain switches between
|
|
|
c401cc |
@@ -1567,7 +1510,6 @@ virDomainEventStateFlush(virDomainEventStatePtr state)
|
|
|
c401cc |
* virDomainEventStateRegister:
|
|
|
c401cc |
* @conn: connection to associate with callback
|
|
|
c401cc |
* @state: domain event state
|
|
|
c401cc |
- * @filter: optional ACL filter to limit which events can be sent
|
|
|
c401cc |
* @callback: function to remove from event
|
|
|
c401cc |
* @opaque: data blob to pass to callback
|
|
|
c401cc |
* @freecb: callback to free @opaque
|
|
|
c401cc |
@@ -1580,7 +1522,6 @@ virDomainEventStateFlush(virDomainEventStatePtr state)
|
|
|
c401cc |
int
|
|
|
c401cc |
virDomainEventStateRegister(virConnectPtr conn,
|
|
|
c401cc |
virDomainEventStatePtr state,
|
|
|
c401cc |
- virDomainObjListFilter filter,
|
|
|
c401cc |
virConnectDomainEventCallback callback,
|
|
|
c401cc |
void *opaque,
|
|
|
c401cc |
virFreeCallback freecb)
|
|
|
c401cc |
@@ -1601,8 +1542,7 @@ virDomainEventStateRegister(virConnectPtr conn,
|
|
|
c401cc |
}
|
|
|
c401cc |
|
|
|
c401cc |
ret = virDomainEventCallbackListAdd(conn, state->callbacks,
|
|
|
c401cc |
- filter ? virDomainEventFilter : NULL,
|
|
|
c401cc |
- filter, callback, opaque, freecb);
|
|
|
c401cc |
+ callback, opaque, freecb);
|
|
|
c401cc |
|
|
|
c401cc |
if (ret == -1 &&
|
|
|
c401cc |
state->callbacks->count == 0 &&
|
|
|
c401cc |
@@ -1621,7 +1561,6 @@ cleanup:
|
|
|
c401cc |
* virDomainEventStateRegisterID:
|
|
|
c401cc |
* @conn: connection to associate with callback
|
|
|
c401cc |
* @state: domain event state
|
|
|
c401cc |
- * @filter: optional ACL filter to limit which events can be sent
|
|
|
c401cc |
* @eventID: ID of the event type to register for
|
|
|
c401cc |
* @cb: function to remove from event
|
|
|
c401cc |
* @opaque: data blob to pass to callback
|
|
|
c401cc |
@@ -1636,7 +1575,6 @@ cleanup:
|
|
|
c401cc |
int
|
|
|
c401cc |
virDomainEventStateRegisterID(virConnectPtr conn,
|
|
|
c401cc |
virDomainEventStatePtr state,
|
|
|
c401cc |
- virDomainObjListFilter filter,
|
|
|
c401cc |
virDomainPtr dom,
|
|
|
c401cc |
int eventID,
|
|
|
c401cc |
virConnectDomainEventGenericCallback cb,
|
|
|
c401cc |
@@ -1659,9 +1597,8 @@ virDomainEventStateRegisterID(virConnectPtr conn,
|
|
|
c401cc |
goto cleanup;
|
|
|
c401cc |
}
|
|
|
c401cc |
|
|
|
c401cc |
- ret = virDomainEventCallbackListAddID(conn, state->callbacks, dom,
|
|
|
c401cc |
- filter ? virDomainEventFilter : NULL,
|
|
|
c401cc |
- filter, eventID, cb, opaque, freecb,
|
|
|
c401cc |
+ ret = virDomainEventCallbackListAddID(conn, state->callbacks,
|
|
|
c401cc |
+ dom, eventID, cb, opaque, freecb,
|
|
|
c401cc |
callbackID);
|
|
|
c401cc |
|
|
|
c401cc |
if (ret == -1 &&
|
|
|
c401cc |
diff --git a/src/conf/domain_event.h b/src/conf/domain_event.h
|
|
|
c401cc |
index 9dc65e2..f6b957d 100644
|
|
|
c401cc |
--- a/src/conf/domain_event.h
|
|
|
c401cc |
+++ b/src/conf/domain_event.h
|
|
|
c401cc |
@@ -1,7 +1,7 @@
|
|
|
c401cc |
/*
|
|
|
c401cc |
* domain_event.h: domain event queue processing helpers
|
|
|
c401cc |
*
|
|
|
c401cc |
- * Copyright (C) 2012-2014 Red Hat, Inc.
|
|
|
c401cc |
+ * Copyright (C) 2012 Red Hat, Inc.
|
|
|
c401cc |
* Copyright (C) 2008 VirtualIron
|
|
|
c401cc |
*
|
|
|
c401cc |
* This library is free software; you can redistribute it and/or
|
|
|
c401cc |
@@ -149,21 +149,19 @@ virDomainEventStateQueue(virDomainEventStatePtr state,
|
|
|
c401cc |
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
|
|
|
c401cc |
int virDomainEventStateRegister(virConnectPtr conn,
|
|
|
c401cc |
virDomainEventStatePtr state,
|
|
|
c401cc |
- virDomainObjListFilter filter,
|
|
|
c401cc |
virConnectDomainEventCallback callback,
|
|
|
c401cc |
void *opaque,
|
|
|
c401cc |
virFreeCallback freecb)
|
|
|
c401cc |
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(4);
|
|
|
c401cc |
+ ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);
|
|
|
c401cc |
int virDomainEventStateRegisterID(virConnectPtr conn,
|
|
|
c401cc |
virDomainEventStatePtr state,
|
|
|
c401cc |
- virDomainObjListFilter filter,
|
|
|
c401cc |
virDomainPtr dom,
|
|
|
c401cc |
int eventID,
|
|
|
c401cc |
virConnectDomainEventGenericCallback cb,
|
|
|
c401cc |
void *opaque,
|
|
|
c401cc |
virFreeCallback freecb,
|
|
|
c401cc |
int *callbackID)
|
|
|
c401cc |
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(6);
|
|
|
c401cc |
+ ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(5);
|
|
|
c401cc |
int
|
|
|
c401cc |
virDomainEventStateDeregister(virConnectPtr conn,
|
|
|
c401cc |
virDomainEventStatePtr state,
|
|
|
c401cc |
diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
|
|
|
c401cc |
index 5036a42..eb252d0 100644
|
|
|
c401cc |
--- a/src/libxl/libxl_driver.c
|
|
|
c401cc |
+++ b/src/libxl/libxl_driver.c
|
|
|
c401cc |
@@ -4148,7 +4148,6 @@ libxlConnectDomainEventRegister(virConnectPtr conn,
|
|
|
c401cc |
libxlDriverLock(driver);
|
|
|
c401cc |
ret = virDomainEventStateRegister(conn,
|
|
|
c401cc |
driver->domainEventState,
|
|
|
c401cc |
- virConnectDomainEventRegisterCheckACL,
|
|
|
c401cc |
callback, opaque, freecb);
|
|
|
c401cc |
libxlDriverUnlock(driver);
|
|
|
c401cc |
|
|
|
c401cc |
@@ -4739,7 +4738,6 @@ libxlConnectDomainEventRegisterAny(virConnectPtr conn, virDomainPtr dom, int eve
|
|
|
c401cc |
libxlDriverLock(driver);
|
|
|
c401cc |
if (virDomainEventStateRegisterID(conn,
|
|
|
c401cc |
driver->domainEventState,
|
|
|
c401cc |
- virConnectDomainEventRegisterAnyCheckACL,
|
|
|
c401cc |
dom, eventID, callback, opaque,
|
|
|
c401cc |
freecb, &ret) < 0)
|
|
|
c401cc |
ret = -1;
|
|
|
c401cc |
diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c
|
|
|
c401cc |
index 27f39a9..cbac135 100644
|
|
|
c401cc |
--- a/src/lxc/lxc_driver.c
|
|
|
c401cc |
+++ b/src/lxc/lxc_driver.c
|
|
|
c401cc |
@@ -1300,7 +1300,6 @@ lxcConnectDomainEventRegister(virConnectPtr conn,
|
|
|
c401cc |
|
|
|
c401cc |
ret = virDomainEventStateRegister(conn,
|
|
|
c401cc |
driver->domainEventState,
|
|
|
c401cc |
- virConnectDomainEventRegisterCheckACL,
|
|
|
c401cc |
callback, opaque, freecb);
|
|
|
c401cc |
|
|
|
c401cc |
return ret;
|
|
|
c401cc |
@@ -1341,7 +1340,6 @@ lxcConnectDomainEventRegisterAny(virConnectPtr conn,
|
|
|
c401cc |
|
|
|
c401cc |
if (virDomainEventStateRegisterID(conn,
|
|
|
c401cc |
driver->domainEventState,
|
|
|
c401cc |
- virConnectDomainEventRegisterAnyCheckACL,
|
|
|
c401cc |
dom, eventID,
|
|
|
c401cc |
callback, opaque, freecb, &ret) < 0)
|
|
|
c401cc |
ret = -1;
|
|
|
c401cc |
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
|
|
|
c401cc |
index 3e041c5..ee622a2 100644
|
|
|
c401cc |
--- a/src/qemu/qemu_driver.c
|
|
|
c401cc |
+++ b/src/qemu/qemu_driver.c
|
|
|
c401cc |
@@ -10239,7 +10239,6 @@ qemuConnectDomainEventRegister(virConnectPtr conn,
|
|
|
c401cc |
|
|
|
c401cc |
if (virDomainEventStateRegister(conn,
|
|
|
c401cc |
driver->domainEventState,
|
|
|
c401cc |
- virConnectDomainEventRegisterCheckACL,
|
|
|
c401cc |
callback, opaque, freecb) < 0)
|
|
|
c401cc |
goto cleanup;
|
|
|
c401cc |
|
|
|
c401cc |
@@ -10288,7 +10287,6 @@ qemuConnectDomainEventRegisterAny(virConnectPtr conn,
|
|
|
c401cc |
|
|
|
c401cc |
if (virDomainEventStateRegisterID(conn,
|
|
|
c401cc |
driver->domainEventState,
|
|
|
c401cc |
- virConnectDomainEventRegisterAnyCheckACL,
|
|
|
c401cc |
dom, eventID,
|
|
|
c401cc |
callback, opaque, freecb, &ret) < 0)
|
|
|
c401cc |
ret = -1;
|
|
|
c401cc |
diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c
|
|
|
c401cc |
index b32aa73..557b408 100644
|
|
|
c401cc |
--- a/src/remote/remote_driver.c
|
|
|
c401cc |
+++ b/src/remote/remote_driver.c
|
|
|
c401cc |
@@ -4311,7 +4311,7 @@ static int remoteConnectDomainEventRegister(virConnectPtr conn,
|
|
|
c401cc |
|
|
|
c401cc |
remoteDriverLock(priv);
|
|
|
c401cc |
|
|
|
c401cc |
- if ((count = virDomainEventStateRegister(conn, priv->domainEventState, NULL,
|
|
|
c401cc |
+ if ((count = virDomainEventStateRegister(conn, priv->domainEventState,
|
|
|
c401cc |
callback, opaque, freecb)) < 0) {
|
|
|
c401cc |
virReportError(VIR_ERR_RPC, "%s", _("adding cb to list"));
|
|
|
c401cc |
goto done;
|
|
|
c401cc |
@@ -5097,7 +5097,7 @@ static int remoteConnectDomainEventRegisterAny(virConnectPtr conn,
|
|
|
c401cc |
remoteDriverLock(priv);
|
|
|
c401cc |
|
|
|
c401cc |
if ((count = virDomainEventStateRegisterID(conn,
|
|
|
c401cc |
- priv->domainEventState, NULL,
|
|
|
c401cc |
+ priv->domainEventState,
|
|
|
c401cc |
dom, eventID,
|
|
|
c401cc |
callback, opaque, freecb,
|
|
|
c401cc |
&callbackID)) < 0) {
|
|
|
c401cc |
diff --git a/src/test/test_driver.c b/src/test/test_driver.c
|
|
|
c401cc |
index cfc9401..f7eaf06 100644
|
|
|
c401cc |
--- a/src/test/test_driver.c
|
|
|
c401cc |
+++ b/src/test/test_driver.c
|
|
|
c401cc |
@@ -5571,7 +5571,7 @@ testConnectDomainEventRegister(virConnectPtr conn,
|
|
|
c401cc |
|
|
|
c401cc |
testDriverLock(driver);
|
|
|
c401cc |
ret = virDomainEventStateRegister(conn,
|
|
|
c401cc |
- driver->domainEventState, NULL,
|
|
|
c401cc |
+ driver->domainEventState,
|
|
|
c401cc |
callback, opaque, freecb);
|
|
|
c401cc |
testDriverUnlock(driver);
|
|
|
c401cc |
|
|
|
c401cc |
@@ -5609,7 +5609,7 @@ testConnectDomainEventRegisterAny(virConnectPtr conn,
|
|
|
c401cc |
|
|
|
c401cc |
testDriverLock(driver);
|
|
|
c401cc |
if (virDomainEventStateRegisterID(conn,
|
|
|
c401cc |
- driver->domainEventState, NULL,
|
|
|
c401cc |
+ driver->domainEventState,
|
|
|
c401cc |
dom, eventID,
|
|
|
c401cc |
callback, opaque, freecb, &ret) < 0)
|
|
|
c401cc |
ret = -1;
|
|
|
c401cc |
diff --git a/src/uml/uml_driver.c b/src/uml/uml_driver.c
|
|
|
c401cc |
index 7860614..b580b32 100644
|
|
|
c401cc |
--- a/src/uml/uml_driver.c
|
|
|
c401cc |
+++ b/src/uml/uml_driver.c
|
|
|
c401cc |
@@ -2621,7 +2621,6 @@ umlConnectDomainEventRegister(virConnectPtr conn,
|
|
|
c401cc |
umlDriverLock(driver);
|
|
|
c401cc |
ret = virDomainEventStateRegister(conn,
|
|
|
c401cc |
driver->domainEventState,
|
|
|
c401cc |
- virConnectDomainEventRegisterCheckACL,
|
|
|
c401cc |
callback, opaque, freecb);
|
|
|
c401cc |
umlDriverUnlock(driver);
|
|
|
c401cc |
|
|
|
c401cc |
@@ -2664,7 +2663,6 @@ umlConnectDomainEventRegisterAny(virConnectPtr conn,
|
|
|
c401cc |
umlDriverLock(driver);
|
|
|
c401cc |
if (virDomainEventStateRegisterID(conn,
|
|
|
c401cc |
driver->domainEventState,
|
|
|
c401cc |
- virConnectDomainEventRegisterAnyCheckACL,
|
|
|
c401cc |
dom, eventID,
|
|
|
c401cc |
callback, opaque, freecb, &ret) < 0)
|
|
|
c401cc |
ret = -1;
|
|
|
c401cc |
diff --git a/src/vbox/vbox_tmpl.c b/src/vbox/vbox_tmpl.c
|
|
|
c401cc |
index c62db87..3e9f0d9 100644
|
|
|
c401cc |
--- a/src/vbox/vbox_tmpl.c
|
|
|
c401cc |
+++ b/src/vbox/vbox_tmpl.c
|
|
|
c401cc |
@@ -7264,7 +7264,7 @@ static int vboxConnectDomainEventRegister(virConnectPtr conn,
|
|
|
c401cc |
* later you can iterate over them
|
|
|
c401cc |
*/
|
|
|
c401cc |
|
|
|
c401cc |
- ret = virDomainEventStateRegister(conn, data->domainEvents, NULL,
|
|
|
c401cc |
+ ret = virDomainEventStateRegister(conn, data->domainEvents,
|
|
|
c401cc |
callback, opaque, freecb);
|
|
|
c401cc |
VIR_DEBUG("virDomainEventStateRegister (ret = %d) (conn: %p, "
|
|
|
c401cc |
"callback: %p, opaque: %p, "
|
|
|
c401cc |
@@ -7356,7 +7356,7 @@ static int vboxConnectDomainEventRegisterAny(virConnectPtr conn,
|
|
|
c401cc |
* later you can iterate over them
|
|
|
c401cc |
*/
|
|
|
c401cc |
|
|
|
c401cc |
- if (virDomainEventStateRegisterID(conn, data->domainEvents, NULL,
|
|
|
c401cc |
+ if (virDomainEventStateRegisterID(conn, data->domainEvents,
|
|
|
c401cc |
dom, eventID,
|
|
|
c401cc |
callback, opaque, freecb, &ret) < 0)
|
|
|
c401cc |
ret = -1;
|
|
|
c401cc |
diff --git a/src/xen/xen_driver.c b/src/xen/xen_driver.c
|
|
|
c401cc |
index 878dc65..4ae38d3 100644
|
|
|
c401cc |
--- a/src/xen/xen_driver.c
|
|
|
c401cc |
+++ b/src/xen/xen_driver.c
|
|
|
c401cc |
@@ -2267,7 +2267,6 @@ xenUnifiedConnectDomainEventRegister(virConnectPtr conn,
|
|
|
c401cc |
}
|
|
|
c401cc |
|
|
|
c401cc |
ret = virDomainEventStateRegister(conn, priv->domainEvents,
|
|
|
c401cc |
- virConnectDomainEventRegisterCheckACL,
|
|
|
c401cc |
callback, opaque, freefunc);
|
|
|
c401cc |
|
|
|
c401cc |
xenUnifiedUnlock(priv);
|
|
|
c401cc |
@@ -2325,7 +2324,6 @@ xenUnifiedConnectDomainEventRegisterAny(virConnectPtr conn,
|
|
|
c401cc |
}
|
|
|
c401cc |
|
|
|
c401cc |
if (virDomainEventStateRegisterID(conn, priv->domainEvents,
|
|
|
c401cc |
- virConnectDomainEventRegisterAnyCheckACL,
|
|
|
c401cc |
dom, eventID,
|
|
|
c401cc |
callback, opaque, freefunc, &ret) < 0)
|
|
|
c401cc |
ret = -1;
|
|
|
c401cc |
--
|
|
|
c401cc |
1.8.5.4
|
|
|
c401cc |
|