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

[Xen-changelog] [xen staging] libxl: Move "qmp_initializations" to libxl_dm



commit 9a5b0ff40f138b2250a356fdad75ab5ca04037c7
Author:     Anthony PERARD <anthony.perard@xxxxxxxxxx>
AuthorDate: Thu May 16 14:23:28 2019 +0100
Commit:     Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
CommitDate: Fri Sep 20 10:42:41 2019 +0100

    libxl: Move "qmp_initializations" to libxl_dm
    
    libxl__qmp_initializations is part of the device domain startup, it
    queries information about the newly spawned QEMU and do some
    post-startup configuration. So the function call doesn't belong to the
    general domain creation, but only to the device model part of the
    process, thus the call belong to libxl_dm and libxl__dm_spawn_state's
    machinery.
    
    We move the call ahead of a follow-up patch which going to "inline"
    libxl__qmp_initializations.
    
    Signed-off-by: Anthony PERARD <anthony.perard@xxxxxxxxxx>
    Acked-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---
 tools/libxl/libxl_create.c | 10 ----------
 tools/libxl/libxl_dm.c     |  8 ++++++++
 2 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index 3f31f2ebcd..93fbe1d740 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -1557,21 +1557,11 @@ static void domcreate_devmodel_started(libxl__egc *egc,
     STATE_AO_GC(dmss->spawn.ao);
     int domid = dcs->guest_domid;
 
-    /* convenience aliases */
-    libxl_domain_config *const d_config = dcs->guest_config;
-
     if (ret) {
         LOGD(ERROR, domid, "device model did not start: %d", ret);
         goto error_out;
     }
 
-    if (dcs->sdss.dm.guest_domid) {
-        if (d_config->b_info.device_model_version
-            == LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN) {
-            libxl__qmp_initializations(gc, domid, d_config);
-        }
-    }
-
     dcs->device_type_idx = -1;
     domcreate_attach_devices(egc, &dcs->multidev, 0);
     return;
diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
index 00da59153d..5a2e349776 100644
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -2744,6 +2744,9 @@ static void device_model_spawn_outcome(libxl__egc *egc,
     STATE_AO_GC(dmss->spawn.ao);
     int ret2;
 
+    /* Convenience aliases */
+    libxl_domain_config *const d_config = dmss->guest_config;
+
     if (rc)
         LOGD(ERROR, dmss->guest_domid,
              "%s: spawn failed (rc=%d)", dmss->spawn.what, rc);
@@ -2760,6 +2763,11 @@ static void device_model_spawn_outcome(libxl__egc *egc,
         }
     }
 
+    if (d_config->b_info.device_model_version
+            == LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN) {
+        libxl__qmp_initializations(gc, dmss->guest_domid, d_config);
+    }
+
  out:
     dmss_dispose(gc, dmss);
     dmss->callback(egc, dmss, rc);
--
generated by git-patchbot for /home/xen/git/xen.git#staging

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

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