1
0
mirror of https://gitlab.com/libvirt/libvirt-python.git synced 2025-07-22 20:59:34 +03:00

event-test.py: Convert GRAPHICS events

to use new Description class

Signed-off-by: Philipp Hahn <hahn@univention.de>
This commit is contained in:
Philipp Hahn
2018-09-21 15:35:09 +02:00
committed by Michal Privoznik
parent dfa00dddd5
commit f58fcd69d2

View File

@ -498,6 +498,7 @@ WATCHDOG_ACTIONS = Description("none", "Pause", "Reset", "Poweroff", "Shutdown",
ERROR_EVENTS = Description("None", "Pause", "Report")
AGENT_STATES = Description("unknown", "connected", "disconnected")
AGENT_REASONS = Description("unknown", "domain started", "channel event")
GRAPHICS_PHASES = Description("Connect", "Initialize", "Disconnect")
def myDomainEventCallback(conn, dom, event, detail, opaque):
@ -527,7 +528,10 @@ def myDomainEventIOErrorReasonCallback(conn, dom, srcpath, devalias, action, rea
def myDomainEventGraphicsCallback(conn, dom, phase, localAddr, remoteAddr, authScheme, subject, opaque):
print("myDomainEventGraphicsCallback: Domain %s(%s) %d %s" % (dom.name(), dom.ID(), phase, authScheme))
print("myDomainEventGraphicsCallback: Domain %s(%s) %s %s" % (
dom.name(), dom.ID(), GRAPHICS_PHASES[phase], authScheme))
def myDomainEventControlErrorCallback(conn, dom, opaque):
print("myDomainEventControlErrorCallback: Domain %s(%s)" % (dom.name(), dom.ID()))