1
0
mirror of https://gitlab.com/libvirt/libvirt-python.git synced 2025-08-03 08:21:58 +03:00

Add support for memory failure event callbacks

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
Daniel P. Berrangé
2020-11-12 14:51:56 +00:00
parent ae219e3480
commit 417b39049e
3 changed files with 75 additions and 0 deletions

View File

@ -261,6 +261,15 @@
cb(self, virDomain(self, _obj=dom), dev, path, threshold, excess, opaque)
return 0
def _dispatchDomainEventMemoryFailureCallback(self, dom: 'virDomain', recipient: int, action: int, flags: int, cbData: Dict[str, Any]) -> int:
"""Dispatches event to python user domain memory failure event callbacks
"""
cb = cbData["cb"]
opaque = cbData["opaque"]
cb(self, virDomain(self, _obj=dom), recipient, action, flags, opaque)
return 0
def domainEventDeregisterAny(self, callbackID: int) -> None:
"""Removes a Domain Event Callback. De-registering for a
domain callback will disable delivery of this event type """