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

[Xen-devel] Re: [PATCH]: xl: catch invalid numeric domain ID



On 01/21/2011 08:03 PM, Ian Jackson wrote:
Andre Przywara writes ("[PATCH]: xl: catch invalid numeric domain ID"):
if you run any domain specific xl command with an invalid (aka
non-existing) numeric domain ID, the command does not abort, but
proceeds with some bogus number:

Thanks, but I'm not 100% convinced that it is impossible to ever get
into a situation where a domain exists but has no name.  In that case,
this patch of yours would leave an undestroyable domain.

I think the right answer is to use libxl_domain_info to check whether
the domain exists.  It returns ERROR_INVAL, without logging anything,
if the domain does not exist.  On other failures xl destroy should
probably carry on and attempt to destroy the domain.
OK, I looked around the bit, libxl_domain_info really seems to be the easiest solution. So please consider the attached patch. I am not 100% happy with it, actually I think find_domain should return an error value. In this case we could abort the commands gracefully (like xl list does) and avoid the rather impolite exit(2). On the other hand I am not sure if fixing the 30 or so callers of find_domain() is appropriate in this state of development. Please tell me if you prefer this more elaborated version and I will send a patch.

Regards,
Andre.

--
Andre Przywara
AMD-Operating System Research Center (OSRC), Dresden, Germany

Attachment: xl_fix_bad_numeric_id_v2.path
Description: xl_fix_bad_numeric_id_v2.path

_______________________________________________
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®.