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 3 of 9] libxl: signal caller if domain already de

To: Stefano Stabellini <Stefano.Stabellini@xxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH 3 of 9] libxl: signal caller if domain already destroyed on domain death event
From: Ian Campbell <Ian.Campbell@xxxxxxxxxxxxx>
Date: Mon, 26 Jul 2010 16:02:54 +0100
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Mon, 26 Jul 2010 08:07:10 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <alpine.DEB.2.00.1007261553570.22235@kaball-desktop>
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>
Organization: Citrix Systems, Inc.
References: <1e0b63948031587b958e.1280141807@xxxxxxxxxxxxxxxxxxxxx> <alpine.DEB.2.00.1007261515130.22235@kaball-desktop> <1280155286.5872.7079.camel@xxxxxxxxxxxxxxxxxxxxxx> <alpine.DEB.2.00.1007261553570.22235@kaball-desktop>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
On Mon, 2010-07-26 at 15:58 +0100, Stefano Stabellini wrote:
> On Mon, 26 Jul 2010, Ian Campbell wrote:
> > On Mon, 2010-07-26 at 15:32 +0100, Stefano Stabellini wrote:
> > > > +                ret = libxl_event_get_domain_death_info(&ctx, domid, 
> > > > &event, &info);
> > > > +
> > > > +                if (ret < 0) continue;
> > > [....]
> > > > +                    if (info.shutdown_reason != SHUTDOWN_suspend) {
> > > >                          LOG("Domain %d needs to be clean: destroying 
> > > > the domain", domid);
> > > >                          libxl_domain_destroy(&ctx, domid, 0);
> > > > -                        if (info.shutdown && info.shutdown_reason == 
> > > > SHUTDOWN_reboot) {
> > > > +                        if (info.shutdown_reason == SHUTDOWN_reboot) {
> > > 
> > > Isn't still possible to get here and have info.shutdown == 0 (and even
> > > info.dying == 0, after reading the fourth patch)?
> > > If so, the previous test is probably clearer.
> > 
> > Umm...
> > 
> > I think libxl_event_get_domain_death_info should have returned
> > ERROR_INVAL in that case and we'd have take the earlier if (ret < 0)
> > continue.
>  
> I think we should at least write in a comment in libxl.h that
> shutdown_reason is valid when (shutdown || dying) and that when
> libxl_event_get_domain_death_info returns 1 shutdown_reason is always
> set. 

Will do.

> Also I still like the old test more, just for clarity.

It would need to be "(info.shutdown||info.crashed||info.dying) ||
info.shutdown_reason ....." which duplicates the logic in libxl, which I
wanted to get rid of (I think that was fully realised the next patch or
so)

Ian.



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

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