[libvirt] [PATCH v4 00/13] Implement keepalive protocol for libvirt RPC

Jiri Denemark jdenemar at redhat.com
Thu Oct 27 16:05:36 UTC 2011


This patchset can also be found at

    https://gitorious.org/~jirka/libvirt/jirka-staging/commits/keepalive

This allows us to detect broken connections between server and client without
waiting for TCP timeout and dead deamon/client. By default a connection is
considered broken after about 30 seconds of no messages received from remote
party. After that period, the connection is automatically closed.

The main reason for implementing this is that peer-to-peer migration can now be
canceled when a connection between source and target breaks. Although this will
really work only after qemu fixes migrate_cancel command so that it doesn't
block when outgoing TCP buffers are full.

Version 4 addresses comments from Daniel and Matthias. Although most of the
patches were already (conditionally) acked, I'm sending all of them to provide
a complete picture of the change. Patches that were already acked are
explicitly marked so in the Notes section so anyone can just skip them if they
like.

Jiri Denemark (13):
  Define keepalive protocol
  Implement common keepalive handling
  Introduce virConnectSetKeepAlive
  virsh: Always run event loop
  Implement keepalive protocol in libvirt daemon
  Add support for non-blocking calls in client RPC
  Add support for async close of client RPC socket
  Implement keepalive protocol in remote driver
  Introduce virConnectIsAlive API
  Implement virConnectIsAlive in all drivers
  Add keepalive support into domain-events examples
  qemu: Add support for keepalive messages during p2p migration
  qemu: Cancel p2p migration when connection breaks

 .gitignore                                         |    1 +
 daemon/libvirtd.aug                                |    5 +
 daemon/libvirtd.c                                  |   15 +
 daemon/libvirtd.conf                               |   25 ++
 daemon/libvirtd.h                                  |    1 +
 daemon/remote.c                                    |   48 ++-
 examples/domain-events/events-c/event-test.c       |    9 +-
 examples/domain-events/events-python/event-test.py |    4 +-
 include/libvirt/libvirt.h.in                       |    5 +
 po/POTFILES.in                                     |    1 +
 src/Makefile.am                                    |   20 +-
 src/driver.h                                       |    8 +
 src/esx/esx_driver.c                               |   18 +
 src/hyperv/hyperv_driver.c                         |   18 +
 src/libvirt.c                                      |   93 ++++
 src/libvirt_internal.h                             |   10 +-
 src/libvirt_private.syms                           |    2 +
 src/libvirt_public.syms                            |    2 +
 src/libxl/libxl_driver.c                           |    8 +
 src/lxc/lxc_driver.c                               |    7 +
 src/openvz/openvz_driver.c                         |    7 +
 src/phyp/phyp_driver.c                             |   18 +
 src/probes.d                                       |   12 +
 src/qemu/libvirtd_qemu.aug                         |    2 +
 src/qemu/qemu.conf                                 |   22 +
 src/qemu/qemu_conf.c                               |   11 +
 src/qemu/qemu_conf.h                               |    3 +
 src/qemu/qemu_driver.c                             |    6 +
 src/qemu/qemu_migration.c                          |   43 ++-
 src/qemu/test_libvirtd_qemu.aug                    |    6 +
 src/remote/remote_driver.c                         |   70 +++
 src/remote/remote_protocol.x                       |    2 +-
 src/rpc/virkeepalive.c                             |  448 ++++++++++++++++++++
 src/rpc/virkeepalive.h                             |   56 +++
 src/rpc/virkeepaliveprotocol.x                     |    7 +
 src/rpc/virnetclient.c                             |  428 ++++++++++++++++---
 src/rpc/virnetclient.h                             |    6 +
 src/rpc/virnetserver.c                             |   22 +
 src/rpc/virnetserver.h                             |    5 +
 src/rpc/virnetserverclient.c                       |  143 ++++++-
 src/rpc/virnetserverclient.h                       |    7 +
 src/test/test_driver.c                             |    6 +
 src/uml/uml_driver.c                               |    7 +
 src/util/event.c                                   |    6 +-
 src/vbox/vbox_tmpl.c                               |    6 +
 src/vmware/vmware_driver.c                         |    7 +
 src/xen/xen_driver.c                               |    8 +
 src/xenapi/xenapi_driver.c                         |   12 +
 tools/console.c                                    |   17 +-
 tools/virsh.c                                      |   31 ++
 50 files changed, 1621 insertions(+), 103 deletions(-)
 create mode 100644 src/rpc/virkeepalive.c
 create mode 100644 src/rpc/virkeepalive.h
 create mode 100644 src/rpc/virkeepaliveprotocol.x

-- 
1.7.7.1




More information about the libvir-list mailing list