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

[Xen-changelog] [xen master] libxl: remove code in stubdom creation failure path and callback



commit e8ebc71c68dabc8e4db3a702d56deda657405653
Author:     Wei Liu <wei.liu2@xxxxxxxxxx>
AuthorDate: Mon Jun 1 18:24:35 2015 +0100
Commit:     Ian Campbell <ian.campbell@xxxxxxxxxx>
CommitDate: Wed Jun 3 11:12:03 2015 +0100

    libxl: remove code in stubdom creation failure path and callback
    
    The snippet to destroy stubdom and the callback were added in 1fc3aeb3
    ("libxl: use new QEMU xenstore protocol"). The intention was to destroy
    stubdom when it is not responsive. That approach is problematic because
    rc is not propagate back to sdss->callback, hence the guest is leaked.
    
    The solution is simple. The destruction of stubdom can be done later in
    sdss->callback. That code path already does the right thing to destroy
    both the guest and the stubdom that serves the guest.
    
    Signed-off-by: Wei Liu <wei.liu2@xxxxxxxxxx>
    Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
---
 tools/libxl/libxl_dm.c |   27 ---------------------------
 1 files changed, 0 insertions(+), 27 deletions(-)

diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
index 3dd7c04..33f9ce6 100644
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -1036,9 +1036,6 @@ static void stubdom_pvqemu_cb(libxl__egc *egc,
                               libxl__multidev *aodevs,
                               int rc);
 
-static void spawn_stubdom_pvqemu_destroy_cb(libxl__egc *egc,
-                                            libxl__destroy_domid_state *dis,
-                                            int rc);
 static void stubdom_xswait_cb(libxl__egc *egc, libxl__xswait_state *xswait,
                               int rc, const char *p);
 
@@ -1353,7 +1350,6 @@ static void stubdom_xswait_cb(libxl__egc *egc, 
libxl__xswait_state *xswait,
 {
     EGC_GC;
     libxl__stub_dm_spawn_state *sdss = CONTAINER_OF(xswait, *sdss, xswait);
-    uint32_t dm_domid = sdss->pvqemu.guest_domid;
 
     if (rc) {
         if (rc == ERROR_TIMEDOUT)
@@ -1367,29 +1363,6 @@ static void stubdom_xswait_cb(libxl__egc *egc, 
libxl__xswait_state *xswait,
         return;
  out:
     libxl__xswait_stop(gc, xswait);
-    if (rc) {
-        if (dm_domid) {
-            sdss->dis.ao = sdss->dm.spawn.ao;
-            sdss->dis.domid = dm_domid;
-            sdss->dis.callback = spawn_stubdom_pvqemu_destroy_cb;
-            libxl__destroy_domid(egc, &sdss->dis);
-            return;
-        }
-    }
-    sdss->callback(egc, &sdss->dm, rc);
-}
-
-static void spawn_stubdom_pvqemu_destroy_cb(libxl__egc *egc,
-                                            libxl__destroy_domid_state *dis,
-                                            int rc)
-{
-    libxl__stub_dm_spawn_state *sdss = CONTAINER_OF(dis, *sdss, dis);
-    STATE_AO_GC(sdss->dis.ao);
-
-    if (rc)
-        LOG(ERROR, "destruction of domain %u after failed creation failed",
-                   sdss->pvqemu.guest_domid);
-
     sdss->callback(egc, &sdss->dm, rc);
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

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