WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH 01 of 16] xl: free all data on exit from the domain m

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH 01 of 16] xl: free all data on exit from the domain monitor daemon
From: Ian Campbell <ian.campbell@xxxxxxxxxx>
Date: Wed, 18 Aug 2010 16:44:24 +0100
Cc: Ian Campbell <ian.campbell@xxxxxxxxxx>
Delivery-date: Wed, 18 Aug 2010 08:46:30 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <patchbomb.1282146263@xxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxx>
# Date 1282143676 -3600
# Node ID fabe8b10fdc20dc68738a6921ef1b0f66b761cc6
# Parent  b1f4b4be1f94c0007794f86abd019f5c2629c59b
xl: free all data on exit from the domain monitor daemon.

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>

diff -r b1f4b4be1f94 -r fabe8b10fdc2 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c  Wed Aug 18 16:00:29 2010 +0100
+++ b/tools/libxl/xl_cmdimpl.c  Wed Aug 18 16:01:16 2010 +0100
@@ -1557,9 +1557,11 @@ start:
                 if (ret) {
                     switch (handle_domain_death(&ctx, domid, &event, 
&d_config, &info)) {
                     case 2:
-                        if (!preserve_domain(&ctx, domid, &event, &d_config, 
&info))
+                        if (!preserve_domain(&ctx, domid, &event, &d_config, 
&info)) {
                             /* If we fail then exit leaving the old domain in 
place. */
-                            exit(-1);
+                            ret = -1;
+                            goto out;
+                        }
 
                         /* Otherwise fall through and restart. */
                     case 1:
@@ -1577,7 +1579,8 @@ start:
                         goto start;
                     case 0:
                         LOG("Done. Exiting now");
-                        exit(0);
+                        ret = 0;
+                        goto out;
                     }
                 }
                 break;
@@ -1589,13 +1592,13 @@ start:
         libxl_free_event(&event);
     }
 
-    close(logfile);
-    exit(0);
-
 error_out:
     if (domid)
         libxl_domain_destroy(&ctx, domid, 0);
+
 out:
+    if (logfile != 2)
+        close(logfile);
 
     free_domain_config(&d_config);
 

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel