[libvirt] [test-API][PATCH] Add domain event type "Shutdown"

Wayne Sun gsun at redhat.com
Mon Jan 9 08:33:12 UTC 2012


  * domain have 7 event types, add the missing shutdown type
  * shutdown only have 1 detail type 'Finished'
---
 repos/domain/eventhandler.py |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/repos/domain/eventhandler.py b/repos/domain/eventhandler.py
index cdbba90..7d8b635 100644
--- a/repos/domain/eventhandler.py
+++ b/repos/domain/eventhandler.py
@@ -48,16 +48,18 @@ def eventToString(event):
                      "Suspended",
                      "Resumed",
                      "Stopped" );
+                     "Shutdown" );
     return eventStrings[event];
 
 def detailToString(event, detail):
     eventStrings = (
         ( "Added", "Updated" ),
-        ( "Removed" ),
+        ( "Removed", ),
         ( "Booted", "Migrated", "Restored", "Snapshot" ),
         ( "Paused", "Migrated", "IOError", "Watchdog" ),
         ( "Unpaused", "Migrated"),
         ( "Shutdown", "Destroyed", "Crashed", "Migrated", "Saved", "Failed", "Snapshot")
+        ( "Finished", )
         )
     return eventStrings[event][detail]
 
-- 
1.7.1




More information about the libvir-list mailing list