Re: [PATCH 04/20] test: Implement virConnectSupportsFeature

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Mar 14, 2018 at 06:35:59PM -0400, John Ferlan wrote:
> 
> 
> On 03/08/2018 07:20 AM, Marc Hartmayer wrote:
> > Implement virConnectSupportsFeature for the test driver as this API is
> > used by various API functions (the functions usually use the macro
> > VIR_DRV_SUPPORTS_FEATURE for calling virConnectSupportsFeature).
> > 
> > Signed-off-by: Marc Hartmayer <mhartmay@xxxxxxxxxxxxxxxxxx>
> > Reviewed-by: Bjoern Walk <bwalk@xxxxxxxxxxxxxxxxxx>
> > Reviewed-by: Boris Fiuczynski <fiuczy@xxxxxxxxxxxxxxxxxx>
> > ---
> >  src/test/test_driver.c | 27 +++++++++++++++++++++++++++
> >  1 file changed, 27 insertions(+)
> > 
> > diff --git a/src/test/test_driver.c b/src/test/test_driver.c
> > index 043caa976274..203358c7017f 100644
> > --- a/src/test/test_driver.c
> > +++ b/src/test/test_driver.c
> > @@ -6829,6 +6829,32 @@ testDomainRevertToSnapshot(virDomainSnapshotPtr snapshot,
> >  }
> >  
> >  
> > +static int
> > +testConnectSupportsFeature(virConnectPtr conn ATTRIBUTE_UNUSED,
> > +                           int feature)
> > +{
> > +    switch ((virDrvFeature) feature) {
> > +    case VIR_DRV_FEATURE_REMOTE_EVENT_CALLBACK:
> > +        return 1;
> 
> Not that it makes a difference, but since
> src/remote/remote_daemon_dispatch.c returns 1 for
> VIR_DRV_FEATURE_REMOTE_EVENT_CALLBACK always like
> VIR_DRV_FEATURE_REMOTE_CLOSE_CALLBACK used to before patch 2, then does
> returning 1 here really matter?
> 
> Perhaps why Nikolay added to remoteDispatchConnectSupportsFeature since
> commit id '03722957' was the last to add some new feature bit...
> 
> [yes, I'm still a bit mystified about how all this works - so I'm
> learning a bit as I go... Still not clear why the same API returns 1 for
> VIR_DRV_FEATURE_FD_PASSING always].

The VIR_DRV_FEATURES don't all correspond to driver specific features.
A bunch of the bits correspond to aspects of the remote protocol, so
do not require involvement of driver specific code.  The EVENT_CALLBACK
bit is one such feature - the way we supported events at the RPC level
originally turned out to be flawed, so we introduced a second way to
represent them. The remote driver & libvirtd negotiate which way to
use. The virt drivers have no involvement in this, as the actual libvirt
API implemented is unchanged.


Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux