[libvirt] [PATCH 0/4] Fix PM events

PM related events suffered from quite a lot of issues. The only thing that actually worked was STARTED life cycle event with WAKEUP detail. Jiri Denemark (4): Fix docs for PM event callbacks Fix PMSuspend and PMWakeup events Add PMSUSPENDED life cycle event examples: Fix event detail printing in python test daemon/remote.c | 2 ++ examples/domain-events/events-c/event-test.c | 14 ++++++++++++-- examples/domain-events/events-python/event-test.py | 8 +++++--- include/libvirt/libvirt.h.in | 20 ++++++++++++++++---- python/libvirt-override.c | 4 ++-- src/qemu/qemu_process.c | 12 ++++++++++-- 6 files changed, 47 insertions(+), 13 deletions(-) -- 1.7.12

PM{Suspend,Wakeup} event callbacks were designed with a reason parameter which could be used in the future. However, we do not transfer the reason over RPC and thus we can never use it in the future. Make it explicit in the docs. --- include/libvirt/libvirt.h.in | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/include/libvirt/libvirt.h.in b/include/libvirt/libvirt.h.in index cfe5047..44c1649 100644 --- a/include/libvirt/libvirt.h.in +++ b/include/libvirt/libvirt.h.in @@ -3902,8 +3902,7 @@ typedef void (*virConnectDomainEventTrayChangeCallback)(virConnectPtr conn, * virConnectDomainEventPMWakeupCallback: * @conn: connection object * @dom: domain on which the event occurred - * @reason: reason why the callback was called, unused currently, - * always passes 0 + * @reason: unused, will always be 0 * @opaque: application specified data * * This callback occurs when the guest is waken up. @@ -3920,8 +3919,7 @@ typedef void (*virConnectDomainEventPMWakeupCallback)(virConnectPtr conn, * virConnectDomainEventPMSuspendCallback: * @conn: connection object * @dom: domain on which the event occurred - * @reason: reason why the callback was called, unused currently, - * always passes 0 + * @reason: unused, will always be 0 * @opaque: application specified data * * This callback occurs when the guest is waken up. -- 1.7.12

On Thu, Sep 6, 2012 at 10:09 AM, Jiri Denemark <jdenemar@redhat.com> wrote:
PM{Suspend,Wakeup} event callbacks were designed with a reason parameter which could be used in the future. However, we do not transfer the reason over RPC and thus we can never use it in the future. Make it explicit in the docs. --- include/libvirt/libvirt.h.in | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/include/libvirt/libvirt.h.in b/include/libvirt/libvirt.h.in index cfe5047..44c1649 100644 --- a/include/libvirt/libvirt.h.in +++ b/include/libvirt/libvirt.h.in @@ -3902,8 +3902,7 @@ typedef void (*virConnectDomainEventTrayChangeCallback)(virConnectPtr conn, * virConnectDomainEventPMWakeupCallback: * @conn: connection object * @dom: domain on which the event occurred - * @reason: reason why the callback was called, unused currently, - * always passes 0 + * @reason: unused, will always be 0 * @opaque: application specified data * * This callback occurs when the guest is waken up. @@ -3920,8 +3919,7 @@ typedef void (*virConnectDomainEventPMWakeupCallback)(virConnectPtr conn, * virConnectDomainEventPMSuspendCallback: * @conn: connection object * @dom: domain on which the event occurred - * @reason: reason why the callback was called, unused currently, - * always passes 0 + * @reason: unused, will always be 0 * @opaque: application specified data * * This callback occurs when the guest is waken up. --
ACK. unused is unused after all. -- Doug Goldstein

On 09/06/2012 05:29 PM, Doug Goldstein wrote:
On Thu, Sep 6, 2012 at 10:09 AM, Jiri Denemark <jdenemar@redhat.com> wrote:
PM{Suspend,Wakeup} event callbacks were designed with a reason parameter which could be used in the future. However, we do not transfer the reason over RPC and thus we can never use it in the future. Make it explicit in the docs. --- include/libvirt/libvirt.h.in | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
Why can't we create a new RPC that _does_ pass reason, then when the event fires, we call the appropriate RPC based on the capabilities of the receiving end? That is, I don't think we are locked into never being able to pass a useful reason. -- Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On Thu, Sep 06, 2012 at 17:48:49 -0600, Eric Blake wrote:
On 09/06/2012 05:29 PM, Doug Goldstein wrote:
On Thu, Sep 6, 2012 at 10:09 AM, Jiri Denemark <jdenemar@redhat.com> wrote:
PM{Suspend,Wakeup} event callbacks were designed with a reason parameter which could be used in the future. However, we do not transfer the reason over RPC and thus we can never use it in the future. Make it explicit in the docs. --- include/libvirt/libvirt.h.in | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
Why can't we create a new RPC that _does_ pass reason, then when the event fires, we call the appropriate RPC based on the capabilities of the receiving end? That is, I don't think we are locked into never being able to pass a useful reason.
Good I split this from the other patches, I can just easily drop it while pushing the rest :-) Jirka

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

On Thu, Sep 6, 2012 at 10:09 AM, Jiri Denemark <jdenemar@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

While PMSUSPENDED state was added a long time ago, we didn't have corresponding life cycle event. --- examples/domain-events/events-c/event-test.c | 10 ++++++++++ examples/domain-events/events-python/event-test.py | 4 +++- include/libvirt/libvirt.h.in | 14 ++++++++++++++ src/qemu/qemu_process.c | 12 ++++++++++-- 4 files changed, 37 insertions(+), 3 deletions(-) diff --git a/examples/domain-events/events-c/event-test.c b/examples/domain-events/events-c/event-test.c index fc4d575..cde60fb 100644 --- a/examples/domain-events/events-c/event-test.c +++ b/examples/domain-events/events-c/event-test.c @@ -90,6 +90,9 @@ const char *eventToString(int event) { case VIR_DOMAIN_EVENT_SHUTDOWN: ret = "Shutdown"; break; + case VIR_DOMAIN_EVENT_PMSUSPENDED: + ret = "PMSuspended"; + break; } return ret; } @@ -193,6 +196,13 @@ static const char *eventDetailToString(int event, int detail) { break; } break; + case VIR_DOMAIN_EVENT_PMSUSPENDED: + switch ((virDomainEventPMSuspendedDetailType) detail) { + case VIR_DOMAIN_EVENT_PMSUSPENDED_MEMORY: + ret = "Memory"; + break; + } + break; } return ret; } diff --git a/examples/domain-events/events-python/event-test.py b/examples/domain-events/events-python/event-test.py index e3b6ed2..fd71acd 100644 --- a/examples/domain-events/events-python/event-test.py +++ b/examples/domain-events/events-python/event-test.py @@ -436,7 +436,8 @@ def eventToString(event): "Suspended", "Resumed", "Stopped", - "Shutdown" ); + "Shutdown", + "PMSuspended" ); return eventStrings[event]; def detailToString(event, detail): @@ -448,6 +449,7 @@ def detailToString(event, detail): ( "Unpaused", "Migrated", "Snapshot" ), ( "Shutdown", "Destroyed", "Crashed", "Migrated", "Saved", "Failed", "Snapshot"), ( "Finished" ) + ( "Memory", ) ) return eventStrings[event][detail] diff --git a/include/libvirt/libvirt.h.in b/include/libvirt/libvirt.h.in index 44c1649..19b13a7 100644 --- a/include/libvirt/libvirt.h.in +++ b/include/libvirt/libvirt.h.in @@ -2812,6 +2812,7 @@ typedef enum { VIR_DOMAIN_EVENT_RESUMED = 4, VIR_DOMAIN_EVENT_STOPPED = 5, VIR_DOMAIN_EVENT_SHUTDOWN = 6, + VIR_DOMAIN_EVENT_PMSUSPENDED = 7, #ifdef VIR_ENUM_SENTINELS VIR_DOMAIN_EVENT_LAST @@ -2929,6 +2930,19 @@ typedef enum { } virDomainEventShutdownDetailType; /** + * virDomainEventPMSuspendedDetailType: + * + * Details about the 'pmsuspended' lifecycle event + */ +typedef enum { + VIR_DOMAIN_EVENT_PMSUSPENDED_MEMORY = 0, /* Guest was PM suspended to memory */ + +#ifdef VIR_ENUM_SENTINELS + VIR_DOMAIN_EVENT_PMSUSPENDED_LAST +#endif +} virDomainEventPMSuspendedDetailType; + +/** * virConnectDomainEventCallback: * @conn: virConnect connection * @dom: The domain on which the event occurred diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 93653c6..77d679a 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -1120,6 +1120,7 @@ qemuProcessHandlePMSuspend(qemuMonitorPtr mon ATTRIBUTE_UNUSED, { struct qemud_driver *driver = qemu_driver; virDomainEventPtr event = NULL; + virDomainEventPtr lifecycleEvent = NULL; virDomainObjLock(vm); event = virDomainEventPMSuspendNewFromObj(vm); @@ -1131,6 +1132,10 @@ qemuProcessHandlePMSuspend(qemuMonitorPtr mon ATTRIBUTE_UNUSED, virDomainObjSetState(vm, VIR_DOMAIN_PMSUSPENDED, VIR_DOMAIN_PMSUSPENDED_UNKNOWN); + lifecycleEvent = + virDomainEventNewFromObj(vm, + VIR_DOMAIN_EVENT_PMSUSPENDED, + VIR_DOMAIN_EVENT_PMSUSPENDED_MEMORY); if (virDomainSaveStatus(driver->caps, driver->stateDir, vm) < 0) { VIR_WARN("Unable to save status on vm %s after suspend event", @@ -1143,9 +1148,12 @@ qemuProcessHandlePMSuspend(qemuMonitorPtr mon ATTRIBUTE_UNUSED, virDomainObjUnlock(vm); - if (event) { + if (event || lifecycleEvent) { qemuDriverLock(driver); - qemuDomainEventQueue(driver, event); + if (event) + qemuDomainEventQueue(driver, event); + if (lifecycleEvent) + qemuDomainEventQueue(driver, lifecycleEvent); qemuDriverUnlock(driver); } -- 1.7.12

On Thu, Sep 6, 2012 at 10:09 AM, Jiri Denemark <jdenemar@redhat.com> wrote:
While PMSUSPENDED state was added a long time ago, we didn't have corresponding life cycle event. --- examples/domain-events/events-c/event-test.c | 10 ++++++++++ examples/domain-events/events-python/event-test.py | 4 +++- include/libvirt/libvirt.h.in | 14 ++++++++++++++ src/qemu/qemu_process.c | 12 ++++++++++-- 4 files changed, 37 insertions(+), 3 deletions(-)
diff --git a/examples/domain-events/events-c/event-test.c b/examples/domain-events/events-c/event-test.c index fc4d575..cde60fb 100644 --- a/examples/domain-events/events-c/event-test.c +++ b/examples/domain-events/events-c/event-test.c @@ -90,6 +90,9 @@ const char *eventToString(int event) { case VIR_DOMAIN_EVENT_SHUTDOWN: ret = "Shutdown"; break; + case VIR_DOMAIN_EVENT_PMSUSPENDED: + ret = "PMSuspended"; + break; } return ret; } @@ -193,6 +196,13 @@ static const char *eventDetailToString(int event, int detail) { break; } break; + case VIR_DOMAIN_EVENT_PMSUSPENDED: + switch ((virDomainEventPMSuspendedDetailType) detail) { + case VIR_DOMAIN_EVENT_PMSUSPENDED_MEMORY: + ret = "Memory"; + break; + } + break; } return ret; } diff --git a/examples/domain-events/events-python/event-test.py b/examples/domain-events/events-python/event-test.py index e3b6ed2..fd71acd 100644 --- a/examples/domain-events/events-python/event-test.py +++ b/examples/domain-events/events-python/event-test.py @@ -436,7 +436,8 @@ def eventToString(event): "Suspended", "Resumed", "Stopped", - "Shutdown" ); + "Shutdown", + "PMSuspended" ); return eventStrings[event];
def detailToString(event, detail): @@ -448,6 +449,7 @@ def detailToString(event, detail): ( "Unpaused", "Migrated", "Snapshot" ), ( "Shutdown", "Destroyed", "Crashed", "Migrated", "Saved", "Failed", "Snapshot"), ( "Finished" ) + ( "Memory", ) ) return eventStrings[event][detail]
diff --git a/include/libvirt/libvirt.h.in b/include/libvirt/libvirt.h.in index 44c1649..19b13a7 100644 --- a/include/libvirt/libvirt.h.in +++ b/include/libvirt/libvirt.h.in @@ -2812,6 +2812,7 @@ typedef enum { VIR_DOMAIN_EVENT_RESUMED = 4, VIR_DOMAIN_EVENT_STOPPED = 5, VIR_DOMAIN_EVENT_SHUTDOWN = 6, + VIR_DOMAIN_EVENT_PMSUSPENDED = 7,
#ifdef VIR_ENUM_SENTINELS VIR_DOMAIN_EVENT_LAST @@ -2929,6 +2930,19 @@ typedef enum { } virDomainEventShutdownDetailType;
/** + * virDomainEventPMSuspendedDetailType: + * + * Details about the 'pmsuspended' lifecycle event + */ +typedef enum { + VIR_DOMAIN_EVENT_PMSUSPENDED_MEMORY = 0, /* Guest was PM suspended to memory */ + +#ifdef VIR_ENUM_SENTINELS + VIR_DOMAIN_EVENT_PMSUSPENDED_LAST +#endif +} virDomainEventPMSuspendedDetailType; + +/** * virConnectDomainEventCallback: * @conn: virConnect connection * @dom: The domain on which the event occurred diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 93653c6..77d679a 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -1120,6 +1120,7 @@ qemuProcessHandlePMSuspend(qemuMonitorPtr mon ATTRIBUTE_UNUSED, { struct qemud_driver *driver = qemu_driver; virDomainEventPtr event = NULL; + virDomainEventPtr lifecycleEvent = NULL;
virDomainObjLock(vm); event = virDomainEventPMSuspendNewFromObj(vm); @@ -1131,6 +1132,10 @@ qemuProcessHandlePMSuspend(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
virDomainObjSetState(vm, VIR_DOMAIN_PMSUSPENDED, VIR_DOMAIN_PMSUSPENDED_UNKNOWN); + lifecycleEvent = + virDomainEventNewFromObj(vm, + VIR_DOMAIN_EVENT_PMSUSPENDED, + VIR_DOMAIN_EVENT_PMSUSPENDED_MEMORY);
if (virDomainSaveStatus(driver->caps, driver->stateDir, vm) < 0) { VIR_WARN("Unable to save status on vm %s after suspend event", @@ -1143,9 +1148,12 @@ qemuProcessHandlePMSuspend(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
virDomainObjUnlock(vm);
- if (event) { + if (event || lifecycleEvent) { qemuDriverLock(driver); - qemuDomainEventQueue(driver, event); + if (event) + qemuDomainEventQueue(driver, event); + if (lifecycleEvent) + qemuDomainEventQueue(driver, lifecycleEvent); qemuDriverUnlock(driver); }
-- 1.7.12
ACK. I had noticed these missing from the Python side. Glad to see the issue was tracked down. -- Doug Goldstein

If there is only one detail string for a particular event, we need to pu comma after the string otherwise the string itself will be taken as a list and only its first character will be printed out. For example, myDomainEventCallback1 EVENT: Domain fedora17(12) Shutdown F instead of the desired myDomainEventCallback1 EVENT: Domain fedora17(12) Shutdown Finished --- examples/domain-events/events-python/event-test.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/domain-events/events-python/event-test.py b/examples/domain-events/events-python/event-test.py index fd71acd..3e314bf 100644 --- a/examples/domain-events/events-python/event-test.py +++ b/examples/domain-events/events-python/event-test.py @@ -443,12 +443,12 @@ def eventToString(event): def detailToString(event, detail): eventStrings = ( ( "Added", "Updated" ), - ( "Removed" ), + ( "Removed", ), ( "Booted", "Migrated", "Restored", "Snapshot", "Wakeup" ), ( "Paused", "Migrated", "IOError", "Watchdog", "Restored", "Snapshot" ), ( "Unpaused", "Migrated", "Snapshot" ), ( "Shutdown", "Destroyed", "Crashed", "Migrated", "Saved", "Failed", "Snapshot"), - ( "Finished" ) + ( "Finished", ), ( "Memory", ) ) return eventStrings[event][detail] -- 1.7.12

On Thu, Sep 6, 2012 at 10:09 AM, Jiri Denemark <jdenemar@redhat.com> wrote:
If there is only one detail string for a particular event, we need to pu comma after the string otherwise the string itself will be taken as a list and only its first character will be printed out. For example,
myDomainEventCallback1 EVENT: Domain fedora17(12) Shutdown F
instead of the desired
myDomainEventCallback1 EVENT: Domain fedora17(12) Shutdown Finished --- examples/domain-events/events-python/event-test.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/examples/domain-events/events-python/event-test.py b/examples/domain-events/events-python/event-test.py index fd71acd..3e314bf 100644 --- a/examples/domain-events/events-python/event-test.py +++ b/examples/domain-events/events-python/event-test.py @@ -443,12 +443,12 @@ def eventToString(event): def detailToString(event, detail): eventStrings = ( ( "Added", "Updated" ), - ( "Removed" ), + ( "Removed", ), ( "Booted", "Migrated", "Restored", "Snapshot", "Wakeup" ), ( "Paused", "Migrated", "IOError", "Watchdog", "Restored", "Snapshot" ), ( "Unpaused", "Migrated", "Snapshot" ), ( "Shutdown", "Destroyed", "Crashed", "Migrated", "Saved", "Failed", "Snapshot"), - ( "Finished" ) + ( "Finished", ), ( "Memory", ) ) return eventStrings[event][detail] -- 1.7.12
ACK. -- Doug Goldstein

On 09/06/2012 05:31 PM, Doug Goldstein wrote:
On Thu, Sep 6, 2012 at 10:09 AM, Jiri Denemark <jdenemar@redhat.com> wrote:
If there is only one detail string for a particular event, we need to pu
s/pu/put a/
comma after the string otherwise the string itself will be taken as a list and only its first character will be printed out. For example,
-- Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On Thu, Sep 06, 2012 at 17:50:25 -0600, Eric Blake wrote:
On 09/06/2012 05:31 PM, Doug Goldstein wrote:
On Thu, Sep 6, 2012 at 10:09 AM, Jiri Denemark <jdenemar@redhat.com> wrote:
If there is only one detail string for a particular event, we need to pu
s/pu/put a/
Oh my and I just pushed the series without fixing this typo :-/ At least it's not the first one and certainly not the last one either. Thanks for the reviews. Jirka

On Fri, Sep 7, 2012 at 3:26 AM, Jiri Denemark <jdenemar@redhat.com> wrote:
On Thu, Sep 06, 2012 at 17:50:25 -0600, Eric Blake wrote:
On 09/06/2012 05:31 PM, Doug Goldstein wrote:
On Thu, Sep 6, 2012 at 10:09 AM, Jiri Denemark <jdenemar@redhat.com> wrote:
If there is only one detail string for a particular event, we need to pu
s/pu/put a/
Oh my and I just pushed the series without fixing this typo :-/ At least it's not the first one and certainly not the last one either.
Thanks for the reviews.
Jirka
Ugh, sorry. I guess my brain has auto-correct built in because I didn't see that. Eric has spotted numerous typos that others have missed which is a good thing. -- Doug Goldstein
participants (3)
-
Doug Goldstein
-
Eric Blake
-
Jiri Denemark