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

Re: [Xen-devel] [PATCH 20 of 26] xl: free all data on exit from the doma

To: Ian Campbell <ian.campbell@xxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH 20 of 26] xl: free all data on exit from the domain monitor daemon
From: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
Date: Tue, 17 Aug 2010 13:27:53 +0100
Cc: Ian, Campbell <Ian.Campbell@xxxxxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Tue, 17 Aug 2010 05:28:17 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <dd25ac29c0f74a2d909d.1281969224@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>
References: <dd25ac29c0f74a2d909d.1281969224@xxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Alpine 2.00 (DEB 1167 2008-08-23)
On Mon, 16 Aug 2010, Ian Campbell wrote:
> # HG changeset patch
> # User Ian Campbell <ian.campbell@xxxxxxxxxx>
> # Date 1281969065 -3600
> # Node ID dd25ac29c0f74a2d909df3e3d072ed5d59320312
> # Parent  a33d1901115bfeceab9cad25954472acdd475744
> xl: free all data on exit from the domain monitor daemon.
> 
> Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
> 
> diff -r a33d1901115b -r dd25ac29c0f7 tools/libxl/xl_cmdimpl.c
> --- a/tools/libxl/xl_cmdimpl.c        Mon Aug 16 15:31:05 2010 +0100
> +++ b/tools/libxl/xl_cmdimpl.c        Mon Aug 16 15:31:05 2010 +0100
> @@ -1581,9 +1581,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:
> @@ -1601,6 +1603,8 @@ start:
>                          goto start;
>                      case 0:
>                          LOG("Done. Exiting now");
> +                        ret = 0;
> +                        goto out;
>                          exit(0);
>                      }
>                  }

you can remove the exit(0) from there


> @@ -1612,9 +1616,6 @@ start:
>          }
>          libxl_free_event(&event);
>      }
> -
> -    close(logfile);
> -    exit(0);
>  
 
shouldn't the close(logfile) be moved to the out path?

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

<Prev in Thread] Current Thread [Next in Thread>