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] xl: avoid creating domains with duplicate names

To: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] xl: avoid creating domains with duplicate names
From: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
Date: Wed, 26 Jan 2011 10:31:36 +0000
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>, Stefano Stabellini <Stefano.Stabellini@xxxxxxxxxxxxx>
Delivery-date: Wed, 26 Jan 2011 02:34:03 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <19775.5294.633111.397575@xxxxxxxxxxxxxxxxxxxxxxxx>
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: <alpine.DEB.2.00.1101251513450.7277@kaball-desktop> <19775.5294.633111.397575@xxxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Alpine 2.00 (DEB 1167 2008-08-23)
On Tue, 25 Jan 2011, Ian Jackson wrote:
> Stefano Stabellini writes ("[Xen-devel] [PATCH] xl: avoid creating domains 
> with duplicate names"):
> > Do not create the domain if another domain with the same name is already
> > running.
> 
> Thanks.  I approve of the principle of this patch, but:
> 
> > +    e = libxl_name_to_domid(&ctx, c_info->name, &domid_e);
> > +    if (!e) {
> 
> You should explicitly check the actual error return value of
> libxl_name_to_domid and check that it is the expected error code, and
> not some other error code meaning "general failure" or something.
> 
> I went to look at the code for libxl_name_to_domid and it returns,
> entirely ad-hoc, -1 (which is now ERROR_VERSION), for "no such
> domain".
> 
> IMO it should return ERROR_INVAL.
> 
> I grepped the libxl source for "-1" and found that this practice is
> widespread.  At this stage of the release I don't want to risk
> breaking everything by changing them all (since something may compare
> with -1, or something).
> 
> So I suggest the attached fixup patch, and then a revised version of
> your patch.  What do you think?

I think is a good idea.


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