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 guest, we're
sure they are not useful anymore at that point.

Signed-off-by: Wei Liu <wei.l...@citrix.com>
---
 tools/libxl/libxl.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 9117b01..ad2290d 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -1686,6 +1686,15 @@ static void devices_destroy_cb(libxl__egc *egc,
 
         rc = xc_domain_destroy(ctx->xch, domid);
         if (rc < 0) goto badchild;
+        /* 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 badchild;
+        rc = libxl__remove_file(gc,
+                 GCSPRINTF(XC_DEVICE_MODEL_RESTORE_FILE".%u", domid));
+        if (rc < 0) goto badchild;
         _exit(0);
 
     badchild:
-- 
1.9.1


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

Reply via email to