On Thu, Sep 6, 2012 at 10:09 AM, Jiri Denemark <jdenemar(a)redhat.com> wrote:
The unused reason parameter of PM{Suspend,Wakeup} event callbacks
was
completely ignored in lot of places and those events were not actually
working at all.
---
daemon/remote.c | 2 ++
examples/domain-events/events-c/event-test.c | 4 ++--
python/libvirt-override.c | 4 ++--
3 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/daemon/remote.c b/daemon/remote.c
index 24928f4..8942c72 100644
--- a/daemon/remote.c
+++ b/daemon/remote.c
@@ -536,6 +536,7 @@ static int remoteRelayDomainEventTrayChange(virConnectPtr conn
ATTRIBUTE_UNUSED,
static int remoteRelayDomainEventPMWakeup(virConnectPtr conn ATTRIBUTE_UNUSED,
virDomainPtr dom,
+ int reason ATTRIBUTE_UNUSED,
void *opaque) {
virNetServerClientPtr client = opaque;
remote_domain_event_pmwakeup_msg data;
@@ -558,6 +559,7 @@ static int remoteRelayDomainEventPMWakeup(virConnectPtr conn
ATTRIBUTE_UNUSED,
static int remoteRelayDomainEventPMSuspend(virConnectPtr conn ATTRIBUTE_UNUSED,
virDomainPtr dom,
+ int reason ATTRIBUTE_UNUSED,
void *opaque) {
virNetServerClientPtr client = opaque;
remote_domain_event_pmsuspend_msg data;
diff --git a/examples/domain-events/events-c/event-test.c
b/examples/domain-events/events-c/event-test.c
index 347ee5a..fc4d575 100644
--- a/examples/domain-events/events-c/event-test.c
+++ b/examples/domain-events/events-c/event-test.c
@@ -377,7 +377,7 @@ static int myDomainEventPMWakeupCallback(virConnectPtr conn
ATTRIBUTE_UNUSED,
int reason ATTRIBUTE_UNUSED,
void *opaque ATTRIBUTE_UNUSED)
{
- printf("%s EVENT: Domain %s(%d) system pmwakeup",
+ printf("%s EVENT: Domain %s(%d) system pmwakeup\n",
__func__, virDomainGetName(dom), virDomainGetID(dom));
return 0;
}
@@ -387,7 +387,7 @@ static int myDomainEventPMSuspendCallback(virConnectPtr conn
ATTRIBUTE_UNUSED,
int reason ATTRIBUTE_UNUSED,
void *opaque ATTRIBUTE_UNUSED)
{
- printf("%s EVENT: Domain %s(%d) system pmsuspend",
+ printf("%s EVENT: Domain %s(%d) system pmsuspend\n",
__func__, virDomainGetName(dom), virDomainGetID(dom));
return 0;
}
diff --git a/python/libvirt-override.c b/python/libvirt-override.c
index 65e8c69..3e9ee89 100644
--- a/python/libvirt-override.c
+++ b/python/libvirt-override.c
@@ -5285,7 +5285,7 @@ libvirt_virConnectDomainEventPMWakeupCallback(virConnectPtr conn
ATTRIBUTE_UNUSE
/* Call the Callback Dispatcher */
pyobj_ret = PyObject_CallMethod(pyobj_conn,
(char*)"_dispatchDomainEventPMWakeupCallback",
- (char*)"OO",
+ (char*)"OiO",
pyobj_dom,
reason,
pyobj_cbData);
@@ -5332,7 +5332,7 @@ libvirt_virConnectDomainEventPMSuspendCallback(virConnectPtr conn
ATTRIBUTE_UNUS
/* Call the Callback Dispatcher */
pyobj_ret = PyObject_CallMethod(pyobj_conn,
(char*)"_dispatchDomainEventPMSuspendCallback",
- (char*)"OO",
+ (char*)"OiO",
pyobj_dom,
reason,
pyobj_cbData);
--
1.7.12
ACK. Good fix for the Python bindings.
--
Doug Goldstein