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

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

In order for libxl to be able to manage QEMU while it is restricted, a few
changes are needed. We need a new way to get a startup notification from QEMU
as xenstore may not be accessible when QEMU is ready. We also need to a
different way to have QEMU save it's state and to insert cdrom as a restricted
QEMU doesn't have access to the file system.

For both, we can use QMP, we can use it to query QEMU's status, and we can use
it to send a file descriptor through which QEMU can save its state, or it can
be a cdrom.

We take this opportunity to rewrite the QMP client, and this time been
asynchronous, the result is libxl__ev_qmp_*.

The plat de résistance in this patch series start with patch
"libxl: Design of an async API to issue QMP commands to QEMU"
which implement libxl__ev_qmp_* functions to turn the QMP client into
asynchronous mode.

This comes with changes that uses the new interface.
* "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.
* "libxl: Re-implement domain_suspend_device_model using libxl__ev_qmp"
  Which rewrite libxl__qmp_save(), and adds the ability to have QEMU save
  its state to a file descriptor which libxl will have openned.
* "libxl_disk: Have libxl_cdrom_insert use libxl__ev_qmp"
  Which rewrites libxl__qmp_insert_cdrom() and adds the ability for libxl
  to open the cdrom on behalf of QEMU.

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. They could be commited ahead of libxl__ev_qmp.

Changes in v4:
    Better API which meant a lot of other changes.

Patches series available in a git tag:
git fetch https://xenbits.xen.org/git-http/people/aperard/xen-unstable.git 
git checkout -b libxl-migration-fdset-v4 FETCH_HEAD


Anthony PERARD (32):
  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: Move struct sockaddr_un variable to qmp_open()
  libxl: Add libxl__prepare_sockaddr_un() helper
  libxl_qmp: Remove unused yajl_ctx from handler
  libxl_json: constify libxl__json_object_to_yajl_gen arguments
  libxl_dm: Add libxl__qemu_qmp_path()
  libxl: Design of an async API to issue QMP commands to QEMU
  libxl_qmp: Connect to QMP socket
  libxl_qmp: Implement fd callback and read data
  libxl_json: Enable yajl_allow_trailing_garbage
  libxl_json: libxl__json_object_to_json
  libxl_qmp: Parse JSON input from QMP
  libxl_qmp: Separate QMP message generation from qmp_send_prepare
  libxl_qmp: Prepare the command to be sent
  libxl_qmp: Handle write to QMP socket
  libxl_qmp: Simplify qmp_response_type() prototype
  libxl_qmp: Handle messages from QEMU
  libxl_qmp: Respond to QMP greeting
  libxl_qmp: Disable beautify for QMP generated cmd
  libxl_exec: Add libxl__spawn_initiate_failure
  libxl_dm: Pre-open QMP socket for QEMU
  libxl: QEMU startup sync based on QMP
  libxl_qmp: Store advertised QEMU version in libxl__ev_qmp
  libxl: Change libxl__domain_suspend_device_model() to be async.
  libxl: Re-implement domain_suspend_device_model using libxl__ev_qmp
  libxl_disk: Cut libxl_cdrom_insert into step
  libxl_disk: Have libxl_cdrom_insert use libxl__ev_qmp

 tools/libxl/libxl_create.c           |  30 +-
 tools/libxl/libxl_disk.c             | 214 +++++--
 tools/libxl/libxl_dm.c               | 143 ++++-
 tools/libxl/libxl_dom_suspend.c      |  22 +-
 tools/libxl/libxl_event.c            |   8 +-
 tools/libxl/libxl_exec.c             |   7 +
 tools/libxl/libxl_internal.h         | 166 ++++-
 tools/libxl/libxl_json.c             |  42 +-
 tools/libxl/libxl_json.h             |   5 +-
 tools/libxl/libxl_qmp.c              | 922 ++++++++++++++++++++++++---
 tools/libxl/libxl_types.idl          |   4 +
 tools/libxl/libxl_types_internal.idl |   8 +
 tools/libxl/libxl_utils.c            |  14 +
 13 files changed, 1385 insertions(+), 200 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®.