[libvirt] [PATCH 1/3] remote: move connection close callback to driver level

Martin Kletzander mkletzan at redhat.com
Thu Jun 25 09:22:38 UTC 2015


On Wed, Jun 24, 2015 at 05:33:51PM +0300, Nikolay Shirokovskiy wrote:
>1. Introduce connect(Un)RegisterCloseCallback driver functions.
>
>2. virConnect(Un)RegisterCloseCallback now works through driver.
>
>3. virConnectCloseCallback is factored from virConnect but mostly stay the
>same. Notice however that virConnect object is not referenced in
>virConnectCloseCallback anymore. It is safe.  Explanation.
>
>Previous version of callback object keeps reference to connection.  This leads
>to undocumented rule that all clients must exlicitly unregister close callback
>before closing connection or connection will never be disposed. As callback
>unregistering and close event delivering are serialized thru callback object
>lock and unregistering zeros connection object we will never get dangling
>pointer on delivering.
>
>4. callback object doesn't check callback on unregistering. The reason is that
>it will helps us write registering/unregistering with atomic behaviour for
>remote driver as it can be seen in next patch. Moreover it is not really
>meaningful to check callback on unregistering.
>
>5. virNetClientSetCloseCallback call is removed from doRemoteClose as it is
>excessive for the same reasons as in point 3.  Unregistering MUST be called
>and this prevents from firing event on close initiated by client.
>
>I'm not sure where callback object should be so it stays in datatype.c
>
>Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy at virtuozzo.com>
>---
> src/datatypes.c            |  112 +++++++++++++++++++++++++++++++++-----------
> src/datatypes.h            |   21 ++++++--
> src/driver-hypervisor.h    |   12 +++++
> src/libvirt-host.c         |   79 ++++++++++---------------------
> src/remote/remote_driver.c |   67 ++++++++++++++++----------
> 5 files changed, 179 insertions(+), 112 deletions(-)
>

Lots of spurious whitespace changes, some of them make the commit very
messy and make syntax-check fails again after this.

Martin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20150625/87c68af4/attachment-0001.sig>


More information about the libvir-list mailing list