]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/xen.git/commitdiff
libxl: clean up qemu-save and qemu-resume files
authorWei Liu <wei.liu2@citrix.com>
Wed, 3 Jun 2015 10:44:50 +0000 (11:44 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Wed, 17 Jun 2015 10:28:15 +0000 (11:28 +0100)
These files are leaked when using qemu-trad stubdom.  They are
intermediate files created by libxc. Unfortunately they don't fit well
in our userdata scheme. Clean them up after we destroy all userdata,
we're sure they are not useful anymore at that point.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
tools/libxl/libxl.c

index 9117b018385edd1de5d6f1770bc57f29e7733747..d86ea62d5011cd934b19a8c920ae97a73e959490 100644 (file)
@@ -1678,6 +1678,16 @@ static void devices_destroy_cb(libxl__egc *egc,
 
     libxl__unlock_domain_userdata(lock);
 
+    /* Clean up qemu-save and qemu-resume files. They are
+     * intermediate files created by libxc. Unfortunately they
+     * don't fit in existing userdata scheme very well.
+     */
+    rc = libxl__remove_file(gc, libxl__device_model_savefile(gc, domid));
+    if (rc < 0) goto out;
+    rc = libxl__remove_file(gc,
+             GCSPRINTF(XC_DEVICE_MODEL_RESTORE_FILE".%u", domid));
+    if (rc < 0) goto out;
+
     rc = libxl__ev_child_fork(gc, &dis->destroyer, domain_destroy_domid_cb);
     if (rc < 0) goto out;
     if (!rc) { /* child */