All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 00/32] libxl: Enable save/restore/migration of a restricted QEMU + libxl__ev_qmp_*
@ 2018-07-27 14:05 Anthony PERARD
  2018-07-27 14:05 ` [PATCH v4 01/32] libxl_event: Fix DEBUG prints Anthony PERARD
                   ` (31 more replies)
  0 siblings, 32 replies; 96+ messages in thread
From: Anthony PERARD @ 2018-07-27 14:05 UTC (permalink / raw)
  To: xen-devel; +Cc: Anthony PERARD, Ian Jackson, Wei Liu

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 libxl-migration-fdset-v4
git checkout -b libxl-migration-fdset-v4 FETCH_HEAD

Cheers,

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
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 96+ messages in thread

end of thread, other threads:[~2018-08-21 14:57 UTC | newest]

Thread overview: 96+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-27 14:05 [PATCH v4 00/32] libxl: Enable save/restore/migration of a restricted QEMU + libxl__ev_qmp_* Anthony PERARD
2018-07-27 14:05 ` [PATCH v4 01/32] libxl_event: Fix DEBUG prints Anthony PERARD
2018-07-27 14:05 ` [PATCH v4 02/32] libxl_qmp: Documentation of the logic of the QMP client Anthony PERARD
2018-07-27 14:05 ` [PATCH v4 03/32] libxl_qmp: Fix use of DEBUG_RECEIVED Anthony PERARD
2018-07-27 14:05 ` [PATCH v4 04/32] libxl_json: fix build with DEBUG_ANSWER Anthony PERARD
2018-07-27 14:05 ` [PATCH v4 05/32] libxl_qmp: Move the buffer realloc to the same scope level as read Anthony PERARD
2018-07-27 14:05 ` [PATCH v4 06/32] libxl_qmp: Add a warning to not trust QEMU Anthony PERARD
2018-07-27 14:05 ` [PATCH v4 07/32] libxl_qmp: Move struct sockaddr_un variable to qmp_open() Anthony PERARD
2018-08-02  8:26   ` Roger Pau Monné
2018-08-20 14:52   ` Wei Liu
2018-07-27 14:05 ` [PATCH v4 08/32] libxl: Add libxl__prepare_sockaddr_un() helper Anthony PERARD
2018-08-02  8:36   ` Roger Pau Monné
2018-08-20 14:56   ` Wei Liu
2018-07-27 14:05 ` [PATCH v4 09/32] libxl_qmp: Remove unused yajl_ctx from handler Anthony PERARD
2018-08-20 14:56   ` Wei Liu
2018-07-27 14:05 ` [PATCH v4 10/32] libxl_json: constify libxl__json_object_to_yajl_gen arguments Anthony PERARD
2018-07-27 14:05 ` [PATCH v4 11/32] libxl_dm: Add libxl__qemu_qmp_path() Anthony PERARD
2018-08-02  8:41   ` Roger Pau Monné
2018-08-20 14:57   ` Wei Liu
2018-07-27 14:05 ` [PATCH v4 12/32] libxl: Design of an async API to issue QMP commands to QEMU Anthony PERARD
2018-08-02  9:01   ` [PATCH v4 12/32] libxl: Design of an async API to issue QMP commands to QEMUç Roger Pau Monné
2018-08-03 11:18     ` Anthony PERARD
2018-08-03 13:55       ` Roger Pau Monné
2018-08-03 14:45         ` Anthony PERARD
2018-08-03 15:30           ` Roger Pau Monné
2018-07-27 14:05 ` [PATCH v4 13/32] libxl_qmp: Connect to QMP socket Anthony PERARD
2018-08-02  9:35   ` Roger Pau Monné
2018-08-03 13:54     ` Anthony PERARD
2018-08-03 14:03       ` Roger Pau Monné
2018-08-21  8:22         ` Wei Liu
2018-07-27 14:05 ` [PATCH v4 14/32] libxl_qmp: Implement fd callback and read data Anthony PERARD
2018-08-02  9:56   ` Roger Pau Monné
2018-08-03 14:32     ` Anthony PERARD
2018-08-03 15:24       ` Roger Pau Monné
2018-08-06 15:01         ` Anthony PERARD
2018-07-27 14:05 ` [PATCH v4 15/32] libxl_json: Enable yajl_allow_trailing_garbage Anthony PERARD
2018-08-02 10:01   ` Roger Pau Monné
2018-08-21  8:26     ` Wei Liu
2018-07-27 14:05 ` [PATCH v4 16/32] libxl_json: libxl__json_object_to_json Anthony PERARD
2018-08-02 10:10   ` Roger Pau Monné
2018-08-21  8:26   ` Wei Liu
2018-07-27 14:05 ` [PATCH v4 17/32] libxl_qmp: Parse JSON input from QMP Anthony PERARD
2018-08-02 10:25   ` Roger Pau Monné
2018-08-03 15:33     ` Anthony PERARD
2018-08-06 11:17       ` Roger Pau Monné
2018-07-27 14:06 ` [PATCH v4 18/32] libxl_qmp: Separate QMP message generation from qmp_send_prepare Anthony PERARD
2018-08-02 10:34   ` Roger Pau Monné
2018-08-03 15:43     ` Anthony PERARD
2018-07-27 14:06 ` [PATCH v4 19/32] libxl_qmp: Prepare the command to be sent Anthony PERARD
2018-08-02 10:41   ` Roger Pau Monné
2018-08-03 16:35     ` Anthony PERARD
2018-07-27 14:06 ` [PATCH v4 20/32] libxl_qmp: Handle write to QMP socket Anthony PERARD
2018-08-02 11:02   ` Roger Pau Monné
2018-08-03 16:50     ` Anthony PERARD
2018-07-27 14:06 ` [PATCH v4 21/32] libxl_qmp: Simplify qmp_response_type() prototype Anthony PERARD
2018-08-02 11:03   ` Roger Pau Monné
2018-08-21  8:53   ` Wei Liu
2018-07-27 14:06 ` [PATCH v4 22/32] libxl_qmp: Handle messages from QEMU Anthony PERARD
2018-08-02 11:17   ` Roger Pau Monné
2018-08-03 17:25     ` Anthony PERARD
2018-08-06 11:25       ` Roger Pau Monné
2018-08-06 13:14         ` Anthony PERARD
2018-08-06 15:03           ` Roger Pau Monné
2018-08-21  8:58       ` Wei Liu
2018-08-21 12:50         ` Anthony PERARD
2018-08-21 14:56           ` Ian Jackson
2018-07-27 14:06 ` [PATCH v4 23/32] libxl_qmp: Respond to QMP greeting Anthony PERARD
2018-08-02 11:26   ` Roger Pau Monné
2018-08-06 17:41     ` Anthony PERARD
2018-08-21  9:00   ` Wei Liu
2018-08-21 10:51     ` Anthony PERARD
2018-07-27 14:06 ` [PATCH v4 24/32] libxl_qmp: Disable beautify for QMP generated cmd Anthony PERARD
2018-08-21  9:00   ` Wei Liu
2018-07-27 14:06 ` [PATCH v4 25/32] libxl_exec: Add libxl__spawn_initiate_failure Anthony PERARD
2018-08-02 11:34   ` Roger Pau Monné
2018-08-06 15:58     ` Anthony PERARD
2018-07-27 14:06 ` [PATCH v4 26/32] libxl_dm: Pre-open QMP socket for QEMU Anthony PERARD
2018-08-02 15:00   ` Roger Pau Monné
2018-07-27 14:06 ` [PATCH v4 27/32] libxl: QEMU startup sync based on QMP Anthony PERARD
2018-08-02 15:06   ` Roger Pau Monné
2018-07-27 14:06 ` [PATCH v4 28/32] libxl_qmp: Store advertised QEMU version in libxl__ev_qmp Anthony PERARD
2018-08-02 15:08   ` Roger Pau Monné
2018-08-06 16:52     ` Anthony PERARD
2018-07-27 14:06 ` [PATCH v4 29/32] libxl: Change libxl__domain_suspend_device_model() to be async Anthony PERARD
2018-08-02 15:15   ` Roger Pau Monné
2018-07-27 14:06 ` [PATCH v4 30/32] libxl: Re-implement domain_suspend_device_model using libxl__ev_qmp Anthony PERARD
2018-08-02 15:38   ` Roger Pau Monné
2018-08-06 17:07     ` Anthony PERARD
2018-07-27 14:06 ` [PATCH v4 31/32] libxl_disk: Cut libxl_cdrom_insert into step Anthony PERARD
2018-08-02 15:50   ` Roger Pau Monné
2018-08-06 17:20     ` Anthony PERARD
2018-08-07 14:18       ` Roger Pau Monné
2018-08-07 14:40         ` Anthony PERARD
2018-08-21  9:08           ` Wei Liu
2018-08-21 12:58             ` Anthony PERARD
2018-07-27 14:06 ` [PATCH v4 32/32] libxl_disk: Have libxl_cdrom_insert use libxl__ev_qmp Anthony PERARD

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.