diff mbox series

[13/35] libxl_dm: Update libxl__spawn_stub_dm to use libxl__domain_unpause

Message ID 20190802153606.32061-14-anthony.perard@citrix.com (mailing list archive)
State Superseded
Headers show
Series libxl refactoring to use ev_qmp (with API changes) | expand

Commit Message

Anthony PERARD Aug. 2, 2019, 3:35 p.m. UTC
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
 tools/libxl/libxl_dm.c       | 22 +++++++++++++++++++++-
 tools/libxl/libxl_internal.h |  1 +
 2 files changed, 22 insertions(+), 1 deletion(-)

Comments

Ian Jackson Sept. 17, 2019, 5:05 p.m. UTC | #1
Anthony PERARD writes ("[PATCH 13/35] libxl_dm: Update libxl__spawn_stub_dm to use libxl__domain_unpause"):
> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>

Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
diff mbox series

Patch

diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
index 246c570121..c00356a2f1 100644
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -2082,6 +2082,9 @@  static void spawn_stub_launch_dm(libxl__egc *egc,
 static void stubdom_pvqemu_cb(libxl__egc *egc,
                               libxl__multidev *aodevs,
                               int rc);
+static void stubdom_pvqemu_unpaused(libxl__egc *egc,
+                                    libxl__dm_resume_state *dmrs,
+                                    int rc);
 
 static void stubdom_xswait_cb(libxl__egc *egc, libxl__xswait_state *xswait,
                               int rc, const char *p);
@@ -2404,7 +2407,24 @@  static void stubdom_pvqemu_cb(libxl__egc *egc,
         goto out;
     }
 
-    rc = libxl__domain_unpause_deprecated(gc, dm_domid);
+    sdss->pvqemu.dmrs.ao = ao;
+    sdss->pvqemu.dmrs.domid = dm_domid;
+    sdss->pvqemu.dmrs.callback = stubdom_pvqemu_unpaused;
+    libxl__domain_unpause(egc, &sdss->pvqemu.dmrs); /* must be last */
+    return;
+out:
+    stubdom_pvqemu_unpaused(egc, &sdss->pvqemu.dmrs, rc);
+}
+
+static void stubdom_pvqemu_unpaused(libxl__egc *egc,
+                                    libxl__dm_resume_state *dmrs,
+                                    int rc)
+{
+    libxl__stub_dm_spawn_state *sdss =
+        CONTAINER_OF(dmrs, *sdss, pvqemu.dmrs);
+    STATE_AO_GC(sdss->dm.spawn.ao);
+    uint32_t dm_domid = sdss->pvqemu.guest_domid;
+
     if (rc) goto out;
 
     sdss->xswait.ao = ao;
diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index 1cfe3cf83f..7cabfd61b7 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -3984,6 +3984,7 @@  struct libxl__dm_spawn_state {
     libxl__spawn_state spawn;
     libxl__ev_qmp qmp;
     libxl__ev_time timeout;
+    libxl__dm_resume_state dmrs;
     /* filled in by user, must remain valid: */
     uint32_t guest_domid; /* domain being served */
     libxl_domain_config *guest_config;