]> xenbits.xensource.com Git - people/larsk/xen.git/commitdiff
libxl_domain: Cleanup libxl__destroy_domid
authorAnthony PERARD <anthony.perard@citrix.com>
Tue, 4 Jun 2019 15:35:22 +0000 (16:35 +0100)
committerIan Jackson <ian.jackson@eu.citrix.com>
Fri, 20 Sep 2019 09:41:01 +0000 (10:41 +0100)
- dom_path isn't used anymore in that function, remove it.
- Use `r' to store return value of external calls.
- Use `CTX', no need for a local `ctx'.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools/libxl/libxl_domain.c

index aee621b0a5a7147814513b2953d159863dd73ecd..11a29b235b1ddc803960b42291b6397744f95d7c 100644 (file)
@@ -1023,14 +1023,13 @@ static void domain_destroy_domid_cb(libxl__egc *egc,
 void libxl__destroy_domid(libxl__egc *egc, libxl__destroy_domid_state *dis)
 {
     STATE_AO_GC(dis->ao);
-    libxl_ctx *ctx = CTX;
     uint32_t domid = dis->domid;
-    char *dom_path;
     int rc, dm_present;
+    int r;
 
     libxl__ev_child_init(&dis->destroyer);
 
-    rc = libxl_domain_info(ctx, NULL, domid);
+    rc = libxl_domain_info(CTX, NULL, domid);
     switch(rc) {
     case 0:
         break;
@@ -1058,17 +1057,12 @@ void libxl__destroy_domid(libxl__egc *egc, libxl__destroy_domid_state *dis)
         abort();
     }
 
-    dom_path = libxl__xs_get_dompath(gc, domid);
-    if (!dom_path) {
-        rc = ERROR_FAIL;
-        goto out;
-    }
-
     if (libxl__device_pci_destroy_all(gc, domid) < 0)
         LOGD(ERROR, domid, "Pci shutdown failed");
-    rc = xc_domain_pause(ctx->xch, domid);
-    if (rc < 0) {
-        LOGEVD(ERROR, rc, domid, "xc_domain_pause failed");
+    r = xc_domain_pause(CTX->xch, domid);
+    if (r < 0) {
+        LOGEVD(ERROR, r, domid, "xc_domain_pause failed");
+        rc = ERROR_FAIL;
     }
 
     if (dm_present) {