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

[Xen-devel] [PATCH v3 00/31] libxl: Enable save/restore/migration of a restricted QEMU + libxl__ev_qmp_*

The real meat in this patch series start with patch
"libxl_qmp_ev: Introduce libxl__ev_qmp_start() to connect to QMP"
which implement libxl__ev_qmp_* functions to turn the QMP client into
asynchronous mode.

This comes with two examples on how to use it:
* "libxl_disk: Have libxl_cdrom_insert use libxl__ev_qmp"
  with patches:
  - "libxl_qmp: Implement libxl__qmp_insert_cdrom_ev"
  - "libxl_disk: Cut libxl_cdrom_insert into step"
* "libxl: QEMU startup sync based on QMP"
  which can use QMP to find out when QEMU as started.
  this requires: "libxl_dm: Pre-open QMP socket for QEMU"
  But that only works with dm_restrict=1 as explain in the patch.

The first few patches do some cleanup and fixes of the current qmp client
implementation, mostly because it bothered me as I think we should remove the
current implementation. There is also two patches to allow to save a restricted
QEMU, but that would need to be converted over to libxl__ev_qmp_*.

There is still one bug that I haven't fix yet. When creating a guest with
dm_restrict=1, the call to libxl__qmp_initializations() is going to fail
because libxl is still connected to the QMP socket. But libxl doesn't care
about failure, and that just mean that `xl console` will not work and vnc will
not have any password. save/restore of the same guest will works fine because
libxl__ev_qmp_* will have an oportunity to disconnect from the socket before
libxl__qmp_initializations() is called.


Anthony PERARD (31):
  libxl_event: Fix DEBUG prints
  libxl_qmp: Documentation of the logic of the QMP client
  libxl_qmp: Fix use of DEBUG_RECEIVED
  libxl_json: fix build with DEBUG_ANSWER
  libxl_qmp: Move the buffer realloc to the same scope level as read
  libxl_qmp: Add a warning to not trust QEMU
  libxl_qmp: Learned to send FD through QMP to QEMU
  libxl_qmp: Have QEMU save its state to a file descriptor
  libxl_qmp: Move struct sockaddr_un variable to qmp_open()
  libxl_qmp: Move buffers to the stack of qmp_next.
  libxl_qmp: Remove unused yajl_ctx form handler
  libxl_json: constify libxl__json_object_to_yajl_gen arguments
  libxl_qmp: Separate QMP message generation from qmp_send_prepare
  libxl_qmp_ev: Introduce libxl__ev_qmp_start() to connect to QMP
  libxl_qmp_ev: Implement fd callback and read data
  libxl_json: Allow partial parsing
  libxl_json: Enable yajl_allow_trailing_garbage
  libxl_json: libxl__json_object_to_json
  libxl_qmp_ev: Parse JSON input from QMP
  libxl_qmp: Introduce libxl__ev_qmp functions
  libxl_qmp_ev: Handle write to socket
  libxl_qmp: Simplify qmp_response_type() prototype
  libxl_qmp_ev: Handle messages from QEMU
  libxl_qmp_ev: Respond to QMP greeting
  libxl_qmp_ev: Disconnect QMP when no more events
  libxl_qmp: Disable beautify for QMP generated cmd
  libxl_qmp: Implement libxl__qmp_insert_cdrom_ev
  libxl_disk: Cut libxl_cdrom_insert into step
  libxl_disk: Have libxl_cdrom_insert use libxl__ev_qmp
  libxl_dm: Pre-open QMP socket for QEMU
  libxl: QEMU startup sync based on QMP

 tools/libxl/libxl.c                  |    4 +
 tools/libxl/libxl_disk.c             |  242 ++++--
 tools/libxl/libxl_dm.c               |   80 +-
 tools/libxl/libxl_event.c            |    8 +-
 tools/libxl/libxl_exec.c             |   44 ++
 tools/libxl/libxl_internal.h         |   67 +-
 tools/libxl/libxl_json.c             |  142 +++-
 tools/libxl/libxl_json.h             |    5 +-
 tools/libxl/libxl_qmp.c              | 1024 ++++++++++++++++++++++++--
 tools/libxl/libxl_types_internal.idl |   14 +
 10 files changed, 1478 insertions(+), 152 deletions(-)

Anthony PERARD

Xen-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.