]> xenbits.xensource.com Git - people/hx242/xen.git/commitdiff
libxl: Move "qmp_initializations" to libxl_dm
authorAnthony PERARD <anthony.perard@citrix.com>
Thu, 16 May 2019 13:23:28 +0000 (14:23 +0100)
committerIan Jackson <ian.jackson@eu.citrix.com>
Fri, 20 Sep 2019 09:42:41 +0000 (10:42 +0100)
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@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools/libxl/libxl_create.c
tools/libxl/libxl_dm.c

index 3f31f2ebcd1f23991d9e4390cd02befadb2176cd..93fbe1d74067973fbd81c3bf9254303b6f368e66 100644 (file)
@@ -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;
index 00da59153d67bb0d07a2a903f12888f985b39230..5a2e3497769da9e2b6b624eb80b3f2a2b8841a55 100644 (file)
@@ -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);