All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anthony PERARD <anthony.perard@citrix.com>
To: <xen-devel@lists.xenproject.org>
Cc: Anthony PERARD <anthony.perard@citrix.com>,
	Ian Jackson <ian.jackson@eu.citrix.com>, Wei Liu <wl@xen.org>
Subject: [Xen-devel] [PATCH 09/35] libxl: Deprecate libxl__domain_{unpause, resume}
Date: Fri, 2 Aug 2019 16:35:40 +0100	[thread overview]
Message-ID: <20190802153606.32061-10-anthony.perard@citrix.com> (raw)
In-Reply-To: <20190802153606.32061-1-anthony.perard@citrix.com>

These two functions are used from many places in libxl and need to
change to be able to accomodate libxl__ev_qmp calls and thus needs to
be asynchronous.

(There is also libxl__domain_resume_device_model in the mix.)

A later patch will introduce a new libxl__domain_resume and
libxl__domain_unpause which will make use of libxl__ev_qmp.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
 tools/libxl/libxl_colo_restore.c |  4 ++--
 tools/libxl/libxl_colo_save.c    |  4 ++--
 tools/libxl/libxl_dm.c           |  2 +-
 tools/libxl/libxl_dom_suspend.c  |  6 +++---
 tools/libxl/libxl_domain.c       |  8 ++++----
 tools/libxl/libxl_internal.h     | 12 ++++++++----
 tools/libxl/libxl_remus.c        |  2 +-
 7 files changed, 21 insertions(+), 17 deletions(-)

diff --git a/tools/libxl/libxl_colo_restore.c b/tools/libxl/libxl_colo_restore.c
index aaa70552b8..aa365670fb 100644
--- a/tools/libxl/libxl_colo_restore.c
+++ b/tools/libxl/libxl_colo_restore.c
@@ -124,7 +124,7 @@ static void colo_resume_vm(libxl__egc *egc,
                 return;
             }
         }
-        rc = libxl__domain_resume(gc, crs->domid, 0);
+        rc = libxl__domain_resume_deprecated(gc, crs->domid, 0);
         if (rc)
             LOGD(ERROR, crs->domid, "cannot resume secondary vm");
 
@@ -853,7 +853,7 @@ static void colo_unpause_svm(libxl__egc *egc,
     EGC_GC;
 
     /* We have enabled secondary vm's logdirty, so we can unpause it now */
-    rc = libxl__domain_unpause(gc, domid);
+    rc = libxl__domain_unpause_deprecated(gc, domid);
     if (rc) {
         LOGD(ERROR, domid, "cannot unpause secondary vm");
         goto out;
diff --git a/tools/libxl/libxl_colo_save.c b/tools/libxl/libxl_colo_save.c
index 1d261a1639..b47f038f6e 100644
--- a/tools/libxl/libxl_colo_save.c
+++ b/tools/libxl/libxl_colo_save.c
@@ -470,7 +470,7 @@ static void colo_preresume_cb(libxl__egc *egc,
     }
 
     /* Resumes the domain and the device model */
-    if (libxl__domain_resume(gc, dss->domid, /* Fast Suspend */1)) {
+    if (libxl__domain_resume_deprecated(gc, dss->domid, /* Fast Suspend */1)) {
         LOGD(ERROR, dss->domid, "cannot resume primary vm");
         goto out;
     }
@@ -480,7 +480,7 @@ static void colo_preresume_cb(libxl__egc *egc,
      * no disk migration.
      */
     if (css->paused) {
-        rc = libxl__domain_unpause(gc, dss->domid);
+        rc = libxl__domain_unpause_deprecated(gc, dss->domid);
         if (rc) {
             LOGD(ERROR, dss->domid, "cannot unpause primary vm");
             goto out;
diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
index bb5339784e..246c570121 100644
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -2404,7 +2404,7 @@ static void stubdom_pvqemu_cb(libxl__egc *egc,
         goto out;
     }
 
-    rc = libxl__domain_unpause(gc, dm_domid);
+    rc = libxl__domain_unpause_deprecated(gc, dm_domid);
     if (rc) goto out;
 
     sdss->xswait.ao = ao;
diff --git a/tools/libxl/libxl_dom_suspend.c b/tools/libxl/libxl_dom_suspend.c
index d1af3a6573..2460021e5a 100644
--- a/tools/libxl/libxl_dom_suspend.c
+++ b/tools/libxl/libxl_dom_suspend.c
@@ -421,7 +421,7 @@ static void domain_suspend_callback_common_done(libxl__egc *egc,
 
 /*======================= Domain resume ========================*/
 
-int libxl__domain_resume_device_model(libxl__gc *gc, uint32_t domid)
+int libxl__domain_resume_device_model_deprecated(libxl__gc *gc, uint32_t domid)
 {
     const char *path, *state;
 
@@ -449,7 +449,7 @@ int libxl__domain_resume_device_model(libxl__gc *gc, uint32_t domid)
     return 0;
 }
 
-int libxl__domain_resume(libxl__gc *gc, uint32_t domid, int suspend_cancel)
+int libxl__domain_resume_deprecated(libxl__gc *gc, uint32_t domid, int suspend_cancel)
 {
     int rc = 0;
 
@@ -460,7 +460,7 @@ int libxl__domain_resume(libxl__gc *gc, uint32_t domid, int suspend_cancel)
     }
 
     if (type == LIBXL_DOMAIN_TYPE_HVM) {
-        rc = libxl__domain_resume_device_model(gc, domid);
+        rc = libxl__domain_resume_device_model_deprecated(gc, domid);
         if (rc) {
             LOGD(ERROR, domid, "failed to resume device model:%d", rc);
             goto out;
diff --git a/tools/libxl/libxl_domain.c b/tools/libxl/libxl_domain.c
index f2d5c86427..80797c5ed2 100644
--- a/tools/libxl/libxl_domain.c
+++ b/tools/libxl/libxl_domain.c
@@ -178,7 +178,7 @@ int libxl_domain_resume(libxl_ctx *ctx, uint32_t domid, int suspend_cancel,
                         const libxl_asyncop_how *ao_how)
 {
     AO_CREATE(ctx, domid, ao_how);
-    int rc = libxl__domain_resume(gc, domid, suspend_cancel);
+    int rc = libxl__domain_resume_deprecated(gc, domid, suspend_cancel);
     libxl__ao_complete(egc, ao, rc);
     return AO_INPROGRESS;
 }
@@ -593,7 +593,7 @@ int libxl_domain_core_dump(libxl_ctx *ctx, uint32_t domid,
     return AO_INPROGRESS;
 }
 
-int libxl__domain_unpause(libxl__gc *gc, libxl_domid domid)
+int libxl__domain_unpause_deprecated(libxl__gc *gc, libxl_domid domid)
 {
     int r, rc;
 
@@ -604,7 +604,7 @@ int libxl__domain_unpause(libxl__gc *gc, libxl_domid domid)
     }
 
     if (type == LIBXL_DOMAIN_TYPE_HVM) {
-        rc = libxl__domain_resume_device_model(gc, domid);
+        rc = libxl__domain_resume_device_model_deprecated(gc, domid);
         if (rc < 0) {
             LOGD(ERROR, domid,
                  "Failed to unpause device model for domain: %d", rc);
@@ -628,7 +628,7 @@ int libxl_domain_unpause(libxl_ctx *ctx, uint32_t domid,
     AO_CREATE(ctx, domid, ao_how);
     int rc = 0;
 
-    rc = libxl__domain_unpause(gc, domid);
+    rc = libxl__domain_unpause_deprecated(gc, domid);
     if (rc) goto out;
 
     libxl__ao_complete(egc, ao, rc);
diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index 5e09e602ed..da3631d853 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -1314,7 +1314,8 @@ _hidden int libxl__domain_rename(libxl__gc *gc, uint32_t domid,
                                  const char *old_name, const char *new_name,
                                  xs_transaction_t trans);
 
-_hidden int libxl__domain_resume_device_model(libxl__gc *gc, uint32_t domid);
+/* Deprecated, use libxl__dm_resume instead. */
+_hidden int libxl__domain_resume_device_model_deprecated(libxl__gc *gc, uint32_t domid);
 
 _hidden const char *libxl__userdata_path(libxl__gc *gc, uint32_t domid,
                                          const char *userdata_userid,
@@ -1331,8 +1332,12 @@ _hidden int libxl__userdata_store(libxl__gc *gc, uint32_t domid,
                                   const char *userdata_userid,
                                   const uint8_t *data, int datalen);
 
-_hidden int libxl__domain_resume(libxl__gc *gc, uint32_t domid,
-                                 int suspend_cancel);
+/* Deprecated, use libxl__domain_resume instead */
+_hidden int libxl__domain_resume_deprecated(libxl__gc *gc, uint32_t domid,
+                                            int suspend_cancel);
+/* Deprecated, use libxl__domain_unpause instead */
+_hidden int libxl__domain_unpause_deprecated(libxl__gc *,
+                                             libxl_domid domid);
 
 /* returns 0 or 1, or a libxl error code */
 _hidden int libxl__domain_pvcontrol_available(libxl__gc *gc, uint32_t domid);
@@ -4103,7 +4108,6 @@ _hidden void libxl__remus_teardown(libxl__egc *egc,
                                    int rc);
 _hidden void libxl__remus_restore_setup(libxl__egc *egc,
                                         libxl__domain_create_state *dcs);
-_hidden int libxl__domain_unpause(libxl__gc *, libxl_domid domid);
 
 
 /*
diff --git a/tools/libxl/libxl_remus.c b/tools/libxl/libxl_remus.c
index 29a47838c8..6338a1bae5 100644
--- a/tools/libxl/libxl_remus.c
+++ b/tools/libxl/libxl_remus.c
@@ -267,7 +267,7 @@ static void remus_devices_preresume_cb(libxl__egc *egc,
         goto out;
 
     /* Resumes the domain and the device model */
-    rc = libxl__domain_resume(gc, dss->domid, /* Fast Suspend */1);
+    rc = libxl__domain_resume_deprecated(gc, dss->domid, /* Fast Suspend */1);
     if (rc)
         goto out;
 
-- 
Anthony PERARD


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  parent reply	other threads:[~2019-08-02 15:36 UTC|newest]

Thread overview: 90+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-02 15:35 [Xen-devel] [PATCH 00/35] libxl refactoring to use ev_qmp (with API changes) Anthony PERARD
2019-08-02 15:35 ` [Xen-devel] [PATCH 01/35] libxl: Make libxl_domain_unpause async Anthony PERARD
2019-09-17 16:50   ` Ian Jackson
2019-09-18 14:05     ` Anthony PERARD
2019-09-18 15:44       ` Ian Jackson
2019-08-02 15:35 ` [Xen-devel] [PATCH 02/35] libxl: Make libxl_send_trigger async Anthony PERARD
2019-09-17 16:50   ` Ian Jackson
2019-08-02 15:35 ` [Xen-devel] [PATCH 03/35] libxl: Make libxl_set_vcpuonline async Anthony PERARD
2019-09-17 16:50   ` Ian Jackson
2019-08-02 15:35 ` [Xen-devel] [PATCH 04/35] libxl: Make libxl_retrieve_domain_configuration async Anthony PERARD
2019-09-17 16:50   ` Ian Jackson
2019-08-02 15:35 ` [Xen-devel] [PATCH 05/35] libxl: Make libxl_qemu_monitor_command async Anthony PERARD
2019-09-17 16:50   ` Ian Jackson
2019-08-02 15:35 ` [Xen-devel] [PATCH 06/35] libxl: Use ev_qmp for switch_qemu_xen_logdirty Anthony PERARD
2019-09-17 16:52   ` Ian Jackson
2019-09-17 16:53     ` Ian Jackson
2019-09-17 17:10     ` Ian Jackson
2019-09-19 12:58     ` Anthony PERARD
2019-09-19 13:03       ` Ian Jackson
2019-09-19 13:21         ` Anthony PERARD
2019-08-02 15:35 ` [Xen-devel] [PATCH 07/35] libxl: Move "qmp_initializations" to libxl_dm Anthony PERARD
2019-09-17 16:54   ` Ian Jackson
2019-08-02 15:35 ` [Xen-devel] [PATCH 08/35] libxl: Replace libxl__qmp_initializations by ev_qmp calls Anthony PERARD
2019-09-17 17:02   ` Ian Jackson
2019-09-18 14:20     ` Anthony PERARD
2019-09-18 16:49     ` Anthony PERARD
2019-09-18 16:56       ` Ian Jackson
2019-09-18 17:08   ` Ian Jackson
2019-08-02 15:35 ` Anthony PERARD [this message]
2019-09-17 17:02   ` [Xen-devel] [PATCH 09/35] libxl: Deprecate libxl__domain_{unpause, resume} Ian Jackson
2019-08-02 15:35 ` [Xen-devel] [PATCH 10/35] libxl: Re-introduce libxl__domain_resume Anthony PERARD
2019-09-17 17:04   ` Ian Jackson
2019-08-02 15:35 ` [Xen-devel] [PATCH 11/35] libxl_domain: Convert libxl_domain_resume to use libxl__domain_resume Anthony PERARD
2019-09-17 17:04   ` Ian Jackson
2019-08-02 15:35 ` [Xen-devel] [PATCH 12/35] libxl: Re-introduce libxl__domain_unpause Anthony PERARD
2019-09-17 17:05   ` Ian Jackson
2019-08-02 15:35 ` [Xen-devel] [PATCH 13/35] libxl_dm: Update libxl__spawn_stub_dm to use libxl__domain_unpause Anthony PERARD
2019-09-17 17:05   ` Ian Jackson
2019-08-02 15:35 ` [Xen-devel] [PATCH 14/35] libxl_domain: Convert libxl_domain_unpause " Anthony PERARD
2019-09-17 17:05   ` Ian Jackson
2019-08-02 15:35 ` [Xen-devel] [PATCH 15/35] libxl: Inline do_usbdev_add into libxl__device_usbdev_add Anthony PERARD
2019-09-17 17:05   ` Ian Jackson
2019-08-02 15:35 ` [Xen-devel] [PATCH 16/35] libxl: Inline do_usbdev_remove into libxl__device_usbdev_remove Anthony PERARD
2019-09-17 17:06   ` Ian Jackson
2019-08-02 15:35 ` [Xen-devel] [PATCH 17/35] libxl: Add libxl__ev_qmp to libxl__ao_device Anthony PERARD
2019-09-17 17:07   ` Ian Jackson
2019-09-19 15:43     ` Anthony PERARD
2019-09-19 16:17       ` Ian Jackson
2019-08-02 15:35 ` [Xen-devel] [PATCH 18/35] libxl: Add device_{config, type} " Anthony PERARD
2019-09-17 17:07   ` Ian Jackson
2019-08-02 15:35 ` [Xen-devel] [PATCH 19/35] libxl_usb: Make libxl__device_usbctrl_add uses ev_qmp Anthony PERARD
2019-09-17 17:08   ` Ian Jackson
2019-08-02 15:35 ` [Xen-devel] [PATCH 20/35] libxl_usb: Make libxl__initiate_device_usbctrl_remove " Anthony PERARD
2019-09-17 17:10   ` Ian Jackson
2019-08-02 15:35 ` [Xen-devel] [PATCH 21/35] libxl_usb: Make libxl__device_usbdev_add " Anthony PERARD
2019-09-17 17:10   ` Ian Jackson
2019-08-02 15:35 ` [Xen-devel] [PATCH 22/35] libxl: Use aodev for libxl__device_usbdev_remove Anthony PERARD
2019-09-17 17:12   ` Ian Jackson
2019-08-02 15:35 ` [Xen-devel] [PATCH 23/35] libxl: libxl__initiate_device_usbdev_remove now use ev_qmp Anthony PERARD
2019-09-17 17:14   ` Ian Jackson
2019-08-02 15:35 ` [Xen-devel] [PATCH 24/35] libxl: Remove libxl__qmp_run_command_flexarray Anthony PERARD
2019-09-17 17:14   ` Ian Jackson
2019-08-02 15:35 ` [Xen-devel] [PATCH 25/35] libxl_pci: Coding style of do_pci_add Anthony PERARD
2019-09-17 17:15   ` Ian Jackson
2019-08-02 15:35 ` [Xen-devel] [PATCH 26/35] libxl_pci: Only check if qemu-dm is running in qemu-trad case Anthony PERARD
2019-09-17 17:16   ` Ian Jackson
2019-08-02 15:35 ` [Xen-devel] [PATCH 27/35] libxl_pci: Use libxl__ao_device with libxl__device_pci_add Anthony PERARD
2019-09-17 17:16   ` Ian Jackson
2019-08-02 15:35 ` [Xen-devel] [PATCH 28/35] libxl_pci: Use ev_qmp in do_pci_add Anthony PERARD
2019-09-17 17:19   ` Ian Jackson
2019-09-18 14:23     ` Anthony PERARD
2019-09-18 17:22       ` Anthony PERARD
2019-09-19 11:18   ` Ian Jackson
2019-08-02 15:36 ` [Xen-devel] [PATCH 29/35] libxl_pci: Use libxl__ao_device with pci_remove Anthony PERARD
2019-09-17 17:20   ` Ian Jackson
2019-08-02 15:36 ` [Xen-devel] [PATCH 30/35] libxl_pci: Use ev_qmp for pci_remove Anthony PERARD
2019-09-17 17:27   ` Ian Jackson
2019-08-02 15:36 ` [Xen-devel] [PATCH 31/35] libxl: Use ev_qmp for libxl_send_trigger Anthony PERARD
2019-09-17 17:27   ` Ian Jackson
2019-08-02 15:36 ` [Xen-devel] [PATCH 32/35] libxl: Use ev_qmp in libxl_set_vcpuonline Anthony PERARD
2019-09-17 17:41   ` Ian Jackson
2019-08-02 15:36 ` [Xen-devel] [PATCH 33/35] libxl: Extract qmp_parse_query_cpus Anthony PERARD
2019-09-17 17:42   ` Ian Jackson
2019-09-19 14:46     ` Anthony PERARD
2019-09-19 16:17       ` Ian Jackson
2019-08-02 15:36 ` [Xen-devel] [PATCH 34/35] libxl: libxl_retrieve_domain_configuration now uses ev_qmp Anthony PERARD
2019-09-17 17:43   ` Ian Jackson
2019-08-02 15:36 ` [Xen-devel] [PATCH 35/35] libxl: libxl_qemu_monitor_command " Anthony PERARD
2019-09-17 17:43   ` Ian Jackson
2019-09-17 17:44 ` [Xen-devel] [PATCH 00/35] libxl refactoring to use ev_qmp (with API changes) Ian Jackson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190802153606.32061-10-anthony.perard@citrix.com \
    --to=anthony.perard@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.