[libvirt] [PATCH python 1/2] Add support for secret event APIs

Daniel P. Berrange berrange at redhat.com
Tue Jan 10 10:29:04 UTC 2017


On Tue, Jan 10, 2017 at 11:25:27AM +0100, Michal Privoznik wrote:
> On 01/09/2017 07:10 PM, Daniel P. Berrange wrote:
> > Signed-off-by: Daniel P. Berrange <berrange at redhat.com>
> > ---
> >  generator.py                   |   2 +
> >  libvirt-override-virConnect.py |  43 +++++++++
> >  libvirt-override.c             | 203 +++++++++++++++++++++++++++++++++++++++++
> >  sanitytest.py                  |   3 +
> >  4 files changed, 251 insertions(+)
> > 
> > diff --git a/generator.py b/generator.py
> > index afb1d34..e9be8b1 100755
> > --- a/generator.py
> > +++ b/generator.py
> > @@ -528,6 +528,8 @@ skip_function = (
> >      'virConnectStoragePoolEventDeregisterAny', # overridden in virConnect.py
> >      'virConnectNodeDeviceEventRegisterAny',   # overridden in virConnect.py
> >      'virConnectNodeDeviceEventDeregisterAny', # overridden in virConnect.py
> > +    'virConnectSecretEventRegisterAny',   # overridden in virConnect.py
> > +    'virConnectSecretEventDeregisterAny', # overridden in virConnect.py
> >      'virSaveLastError', # We have our own python error wrapper
> >      'virFreeError', # Only needed if we use virSaveLastError
> >      'virConnectListAllDomains', # overridden in virConnect.py
> > diff --git a/libvirt-override-virConnect.py b/libvirt-override-virConnect.py
> > index fb3d476..d26b480 100644
> > --- a/libvirt-override-virConnect.py
> > +++ b/libvirt-override-virConnect.py
> > @@ -392,6 +392,49 @@
> >          self.nodeDeviceEventCallbackID[ret] = opaque
> >          return ret
> >  
> > +    def _dispatchSecretEventLifecycleCallback(self, net, event, detail, cbData):
> > +        """Dispatches events to python user secret lifecycle event callbacks
> > +        """
> > +        cb = cbData["cb"]
> > +        opaque = cbData["opaque"]
> > +
> > +        cb(self, virSecret(self, _obj=net), event, detail, opaque)
> > +        return 0
> > +
> > +    def _dispatchSecretEventGEnericCallback(self, net, cbData):
> 
> s/GE/Ge/
> 
> And also probably just a leftover from copy-paste from network code, but
> s/net/secret/g

I'd already pushed, so added these fixes in a followup patch

> 
> > +        """Dispatches events to python user secret generic event callbacks
> > +        """
> > +        cb = cbData["cb"]
> > +        opaque = cbData["opaque"]
> > +
> > +        cb(self, virSecret(self, _obj=net), opaque)
> > +        return 0
> > +
> 
> Michal

Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://entangle-photo.org       -o-    http://search.cpan.org/~danberr/ :|




More information about the libvir-list mailing list