mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
More event callback fixes
In a couple of cases typos meant we were firing the wrong type of event. In the python code my previous commit accidentally missed some chunks of the code. * python/libvirt-override-virConnect.py: Add missing python glue accidentally left out of previous commit * src/conf/domain_event.c, src/qemu/qemu_monitor_json.c: Fix typos in event name / method name to invoke
This commit is contained in:
parent
1670df676a
commit
631c4ce855
@ -43,7 +43,7 @@
|
||||
pass
|
||||
|
||||
def dispatchDomainEventLifecycleCallback(self, dom, event, detail, cbData):
|
||||
"""Dispatches events to python user domain event callbacks
|
||||
"""Dispatches events to python user domain lifecycle event callbacks
|
||||
"""
|
||||
cb = cbData["cb"]
|
||||
opaque = cbData["opaque"]
|
||||
@ -52,7 +52,7 @@
|
||||
return 0
|
||||
|
||||
def dispatchDomainEventGenericCallback(self, dom, cbData):
|
||||
"""Dispatches events to python user domain event callbacks
|
||||
"""Dispatches events to python user domain generic event callbacks
|
||||
"""
|
||||
try:
|
||||
cb = cbData["cb"]
|
||||
@ -63,6 +63,54 @@
|
||||
except AttributeError:
|
||||
pass
|
||||
|
||||
def dispatchDomainEventRTCChangeCallback(self, dom, offset, cbData):
|
||||
"""Dispatches events to python user domain RTC change event callbacks
|
||||
"""
|
||||
try:
|
||||
cb = cbData["cb"]
|
||||
opaque = cbData["opaque"]
|
||||
|
||||
cb(self, virDomain(self, _obj=dom), offset ,opaque)
|
||||
return 0
|
||||
except AttributeError:
|
||||
pass
|
||||
|
||||
def dispatchDomainEventWatchdogCallback(self, dom, action, cbData):
|
||||
"""Dispatches events to python user domain watchdog event callbacks
|
||||
"""
|
||||
try:
|
||||
cb = cbData["cb"]
|
||||
opaque = cbData["opaque"]
|
||||
|
||||
cb(self, virDomain(self, _obj=dom), action, opaque)
|
||||
return 0
|
||||
except AttributeError:
|
||||
pass
|
||||
|
||||
def dispatchDomainEventIOErrorCallback(self, dom, srcPath, devAlias, action, cbData):
|
||||
"""Dispatches events to python user domain IO error event callbacks
|
||||
"""
|
||||
try:
|
||||
cb = cbData["cb"]
|
||||
opaque = cbData["opaque"]
|
||||
|
||||
cb(self, virDomain(self, _obj=dom), opaque)
|
||||
return 0
|
||||
except AttributeError:
|
||||
pass
|
||||
|
||||
def dispatchDomainEventGraphicsCallback(self, dom, phase, localAddr, remoteAddr, authScheme, subject, cbData):
|
||||
"""Dispatches events to python user domain graphics event callbacks
|
||||
"""
|
||||
try:
|
||||
cb = cbData["cb"]
|
||||
opaque = cbData["opaque"]
|
||||
|
||||
cb(self, virDomain(self, _obj=dom), phase, localAddr, remoteAddr, authScheme, subject, opaque)
|
||||
return 0
|
||||
except AttributeError:
|
||||
pass
|
||||
|
||||
def domainEventDeregisterAny(self, callbackID):
|
||||
"""Removes a Domain Event Callback. De-registering for a
|
||||
domain callback will disable delivery of this event type """
|
||||
|
@ -660,7 +660,7 @@ virDomainEventPtr virDomainEventIOErrorNewFromObj(virDomainObjPtr obj,
|
||||
obj->def->id, obj->def->name, obj->def->uuid);
|
||||
|
||||
if (ev) {
|
||||
ev->data.watchdog.action = action;
|
||||
ev->data.ioError.action = action;
|
||||
if (!(ev->data.ioError.srcPath = strdup(srcPath)) ||
|
||||
!(ev->data.ioError.devAlias = strdup(devAlias))) {
|
||||
virDomainEventFree(ev);
|
||||
|
@ -536,7 +536,7 @@ static void qemuMonitorJSONHandleWatchdog(qemuMonitorPtr mon, virJSONValuePtr da
|
||||
} else {
|
||||
actionID = VIR_DOMAIN_EVENT_WATCHDOG_NONE;
|
||||
}
|
||||
qemuMonitorEmitRTCChange(mon, actionID);
|
||||
qemuMonitorEmitWatchdog(mon, actionID);
|
||||
}
|
||||
|
||||
VIR_ENUM_DECL(qemuMonitorIOErrorAction)
|
||||
|
Loading…
x
Reference in New Issue
Block a user