[libvirt] [PATCH 05/20] test: Implement virConnect(Un)RegisterCloseCallback

Daniel P. Berrangé berrange at redhat.com
Mon Mar 19 15:02:22 UTC 2018


On Thu, Mar 08, 2018 at 01:20:28PM +0100, Marc Hartmayer wrote:
> Implement the hypervisor APIs virConnectRegisterCloseCallback and
> virConnectUnregisterCloseCallbacks and mark this feature as supported
> in testConnectSupportsFeature. This increases test test coverage of
> the test suite as then the testConnectRegisterCloseCallback and
> testConnectUnregisterCloseCallback (which are almost identical to the
> implementations of the remote and vz driver) will be called by the
> virsh tests.

I'm not really understanding why this is needed at all.

For most drivers, the close callback stuff does not need any interaction
with the driver code. It is handled entirely at the RPC protocol level
by the remote driver & libvirtd.

We only needed to wire it up in the VZ driver, because VZ had a further
internal connection that could be lost, and we want to propagate that
back out from the driver as a close event, despite the main reomte
driver <-> libvirtd connection being intact.

So I don't see any test for the test driver to require special handling
for close callbacks - if you run the test driver inside libvirtd, it
would work normally. If the test driver is run outside libvirtd, there
is no network connection  that could fail and thus no close callbacks
ever need to be run.

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 :|




More information about the libvir-list mailing list