[libvirt] [PATCH v5 0/10] add close callback for drivers with persistent connection

Nikolay Shirokovskiy nshirokovskiy at virtuozzo.com
Wed Feb 17 12:14:53 UTC 2016

Currently close callback API can only inform us of closing the connection
between remote driver and daemon. But what if a driver running in the
daemon itself can have another persistent connection? In this case
we want to be informed of that connection changes state too.

This patch series extends meaning of current close callback API so
that now it notifies of closing of any internal persistent connection.
The overall approach is to move close callback support to drivers.

Changes from v4:
1. New patch "remote: factor out feature checks on connection open" to get
rid of code dups.
2. "daemon: add connection close rpc" now checks if peer supports
rpc for close callbacks. If it is not then we handle only disconnections
to peer as before.

Changes from v3:

Add patch [3] "close callback: make unregister clean after connect close event."

Make register/unregister methods of connection close callback object
return void. This solves the problem of patch [8] "daemon: add connection close rpc"
([7] in previous version) of consistent unregistering. All checks are
moved outside of the methods. I hesitate whether to add or not means
that track connection close callback object consinstency and finally
decided to add (checks and warnings inside methods). The reason is that
without these checks we get memory leaks which are rather difficult
to find out. Unfortunately this change touch a number of patches as
the first change is done in the first patch of the series. 

Changes from v2:
Split patches further to make it more comprehensible.

Nikolay Shirokovskiy (10):
  factor out virConnectCloseCallbackDataPtr methods
  virConnectCloseCallbackData: fix connection object refcount
  close callback: make unregister clean after connect close event
  virConnectCloseCallbackData: factor out callback disarming
  close callback API: remove unnecessary locks
  virConnectCloseCallbackDataDispose: remove unnecessary locks
  close callback: move it to driver
  remote: factor out feature checks on connection open
  daemon: add connection close rpc
  vz: implement connection close notification

 daemon/libvirtd.h            |   1 +
 daemon/remote.c              |  85 ++++++++++++++++++++++
 src/datatypes.c              | 118 +++++++++++++++++++++++-------
 src/datatypes.h              |  16 ++++-
 src/driver-hypervisor.h      |  12 ++++
 src/libvirt-host.c           |  46 ++----------
 src/libvirt_internal.h       |   5 ++
 src/remote/remote_driver.c   | 167 ++++++++++++++++++++++++++++++++-----------
 src/remote/remote_protocol.x |  24 ++++++-
 src/remote_protocol-structs  |   6 ++
 src/vz/vz_driver.c           |  59 +++++++++++++++
 src/vz/vz_sdk.c              |   4 ++
 src/vz/vz_utils.h            |   3 +
 13 files changed, 433 insertions(+), 113 deletions(-)


More information about the libvir-list mailing list