In XendDomainInfo.py --> check_name() there is a restriction in place that a
domain can not begin with a digit. If I comment out this check:
if name[0] in string.digits:
raise VmError(''invalid vm name'')
... I can start and stop a domain whose name starts with a digit just fine. Is
there a reason this restriction is in place?
And actually, the way the logic goes here:
if name[0] in string.digits:
raise VmError(''invalid vm name'')
for c in name:
if c in string.digits: continue
if c in ''_-.:/+'': continue
if c in string.ascii_letters: continue
raise VmError(''invalid vm name'')
... you could have "+-5ac" as a name but not "5ac". (the
intent is maybe "if
name[0] not in string.ascii_letters"?).
Anyhow, I''m using UUIDs, and currently (to avoid needing to patch Xend)
just
stripping any incoming UUIDs of digits in the beginning, but this is a little
unsavory, so I was curious if it was possible to change it upstream if there is
no reason for the check?
Is there some use of the domain name I am missing that bars digits?
Thanks,
Tim
Another thing:
"+-5ac" works but actually when I tried "+-/5ac" (which
passes the validity
check too), xm create fails with "Error: invalid domain:+-" and xm
list reports
no dom0 but just this:
Name Id Mem(MB) CPU State Time(s) Console
Error: invalid domain:+-
Rebooting xend has no effect, needed to reboot the node.
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
> In XendDomainInfo.py --> check_name() there is a restriction > in place that a domain can not begin with a digit. If I > comment out this check: > > if name[0] in string.digits: > raise VmError(''invalid vm name'') > > ... I can start and stop a domain whose name starts with a > digit just fine. Is there a reason this restriction is in place?You can also manipulate domains by their domid, so I''m guess the test is an attempt to avoid confusion. Preventing all-numeric names would be more sensible -- can you post a fix. Thanks. Ian _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Is it going to break anyone''s setup if this patch does not include ''/'' as a valid character in a name? As I reported in the beginning of the thread, it seems to cause an unrecoverable crash to include ''/'' Thanks, Tim On Sun, 3 Jul 2005 20:40:56 +0100 "Ian Pratt" <m+Ian.Pratt@cl.cam.ac.uk> wrote:> > > In XendDomainInfo.py --> check_name() there is a restriction > > in place that a domain can not begin with a digit. If I > > comment out this check: > > > > if name[0] in string.digits: > > raise VmError(''invalid vm name'') > > > > ... I can start and stop a domain whose name starts with a > > digit just fine. Is there a reason this restriction is in place? > > You can also manipulate domains by their domid, so I''m guess the test is > an attempt to avoid confusion. Preventing all-numeric names would be > more sensible -- can you post a fix. > > Thanks. > Ian > > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
> Is it going to break anyone''s setup if this patch does not > include ''/'' as a valid character in a name? As I reported in > the beginning of the thread, it seems to cause an > unrecoverable crash to include ''/''Disallowing the usual ''problem'' characters is probably a good thing (e.g. quotes) Ian> On Sun, 3 Jul 2005 20:40:56 +0100 > "Ian Pratt" <m+Ian.Pratt@cl.cam.ac.uk> wrote: > > > > > > In XendDomainInfo.py --> check_name() there is a restriction in > > > place that a domain can not begin with a digit. If I comment out > > > this check: > > > > > > if name[0] in string.digits: > > > raise VmError(''invalid vm name'') > > > > > > ... I can start and stop a domain whose name starts with a digit > > > just fine. Is there a reason this restriction is in place? > > > > You can also manipulate domains by their domid, so I''m > guess the test > > is an attempt to avoid confusion. Preventing all-numeric > names would > > be more sensible -- can you post a fix. > > > > Thanks. > > Ian > > > > > > _______________________________________________ > > Xen-devel mailing list > > Xen-devel@lists.xensource.com > > http://lists.xensource.com/xen-devel > > >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On Thu, 7 Jul 2005 16:25:51 +0100 "Ian Pratt" <m+Ian.Pratt@cl.cam.ac.uk> wrote:> > > > Is it going to break anyone''s setup if this patch does not > > include ''/'' as a valid character in a name? As I reported in > > the beginning of the thread, it seems to cause an > > unrecoverable crash to include ''/'' > > Disallowing the usual ''problem'' characters is probably a good thing > (e.g. quotes)Well, I''m asking especially because these five characters are currently explicitly allowed: if c in ''_-.:/+'': continue I was wondering if that was for a reason. They all seem to work from my limited testing, except for ''/'' Thanks, Tim> > Ian > > > On Sun, 3 Jul 2005 20:40:56 +0100 > > "Ian Pratt" <m+Ian.Pratt@cl.cam.ac.uk> wrote: > > > > > > > > > In XendDomainInfo.py --> check_name() there is a restriction in > > > > place that a domain can not begin with a digit. If I comment out > > > > this check: > > > > > > > > if name[0] in string.digits: > > > > raise VmError(''invalid vm name'') > > > > > > > > ... I can start and stop a domain whose name starts with a digit > > > > just fine. Is there a reason this restriction is in place? > > > > > > You can also manipulate domains by their domid, so I''m > > guess the test > > > is an attempt to avoid confusion. Preventing all-numeric > > names would > > > be more sensible -- can you post a fix. > > > > > > Thanks. > > > Ian > > > > > > > > > _______________________________________________ > > > Xen-devel mailing list > > > Xen-devel@lists.xensource.com > > > http://lists.xensource.com/xen-devel > > > > > >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On 7 Jul 2005, at 16:29, Tim Freeman wrote:> Well, I''m asking especially because these five characters are currently > explicitly allowed: > > if c in ''_-.:/+'': continue > > I was wondering if that was for a reason. They all seem to work from > my limited > testing, except for ''/''I think _, -, . and : are all sane (although some people think we should fix on one of _ or -, and exclude the other to make the naming more uniform). I''m not sure about +, but allowing / is madness. -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel