diff options
author | Michal Privoznik <mprivozn@redhat.com> | 2011-10-18 16:15:42 +0200 |
---|---|---|
committer | Michal Privoznik <mprivozn@redhat.com> | 2011-10-25 09:27:10 +0200 |
commit | 7ad073e29d8fa4d4758c78e3437492b855f034c6 (patch) | |
tree | adb3cc768098b5beb13a5dfec5783acbcec58194 /libvirt-override-virConnect.py | |
parent | a53760ff2fdc096292c5998b37e0bba3bb816a56 (diff) | |
download | libvirt-python-v6-7ad073e29d8fa4d4758c78e3437492b855f034c6.tar.gz libvirt-python-v6-7ad073e29d8fa4d4758c78e3437492b855f034c6.tar.xz libvirt-python-v6-7ad073e29d8fa4d4758c78e3437492b855f034c6.zip |
startupPolicy: Emit event on disk source droppingv0.9.7-rc1
If a disk source gets dropped because it is not accessible,
mgmt application might want to be informed about this. Therefore
we need to emit an event. The event presented in this patch
is however a bit superset of what written above. The reason is simple:
an intention to be easily expanded, e.g. on 'user ejected disk
in guest' events. Therefore, callback gets source string and disk alias
(which should be unique among a domain) and reason (an integer);
Diffstat (limited to 'libvirt-override-virConnect.py')
-rw-r--r-- | libvirt-override-virConnect.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/libvirt-override-virConnect.py b/libvirt-override-virConnect.py index 65b5342..b908b32 100644 --- a/libvirt-override-virConnect.py +++ b/libvirt-override-virConnect.py @@ -125,6 +125,15 @@ except AttributeError: pass + def _dispatchDomainEventDiskChangeCallback(self, dom, oldSrcPath, newSrcPath, devAlias, reason, cbData): + """Dispatches event to python user domain diskChange event callbacks + """ + cb = cbData["cb"] + opaque = cbData["opaque"] + + cb(self, virDomain(self, _obj=dom), oldSrcPath, newSrcPath, devAlias, reason, opaque) + return 0; + def domainEventDeregisterAny(self, callbackID): """Removes a Domain Event Callback. De-registering for a domain callback will disable delivery of this event type """ |