[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH] xl: avoid creating domains with duplicate names



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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.