All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] [RFC] Domain name issue
@ 2006-06-18  9:24 Masaki Kanno
  2006-06-18  9:29 ` Muli Ben-Yehuda
  0 siblings, 1 reply; 3+ messages in thread
From: Masaki Kanno @ 2006-06-18  9:24 UTC (permalink / raw)
  To: xen-devel

[-- Attachment #1: Mail message body --]
[-- Type: text/plain, Size: 1520 bytes --]

Hi,

When we tested xm commands, we found a issue about a domain name.
The domain name can use character '-'. However, when character '-' 
was used for the top of the domain name character string, the 
following issue was found. 

# xm list
Name                              ID Mem(MiB) VCPUs State  Time(s)
-domUtemp                          1      512     1 r-----    43.2
Domain-0                           0      492     1 r-----   199.2
# xm list -domUtemp
Error: option -d not recognized

Some xm commands mistook such the domain name for a option. 
We suggest the following patch. The patch changes XendDomainInfo.py 
not to be able to use character '-' for the top of the domain name 
character string. 
Because we are not well informed about python, if there is a good 
idea to solve the issue, please give us idea. 


Signed-off-by: Hiroyuki Yamamoto <yamamoto.hiroyu@jp.fujitsu.com>
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>

Best regards,
 Kan

diff -r 0d1dab1d9b67 tools/python/xen/xend/XendDomainInfo.py
--- a/tools/python/xen/xend/XendDomainInfo.py   Fri Jun 16 10:18:54 2006 -0600
+++ b/tools/python/xen/xend/XendDomainInfo.py   Sun Jun 18 17:09:56 2006 +0900
@@ -1189,6 +1189,8 @@ class XendDomainInfo:
         """
         if name is None or name == '':
             raise VmError('missing vm name')
+        if name[0] == '-':
+            raise VmError('invalid vm name')
         for c in name:
             if c in string.digits: continue
             if c in '_-.:/+': continue



[-- Attachment #2: domainname.patch --]
[-- Type: application/octet-stream, Size: 541 bytes --]

diff -r 0d1dab1d9b67 tools/python/xen/xend/XendDomainInfo.py
--- a/tools/python/xen/xend/XendDomainInfo.py	Fri Jun 16 10:18:54 2006 -0600
+++ b/tools/python/xen/xend/XendDomainInfo.py	Sun Jun 18 17:19:57 2006 +0900
@@ -1189,6 +1189,8 @@ class XendDomainInfo:
         """
         if name is None or name == '':
             raise VmError('missing vm name')
+        if name[0] == '-':
+            raise VmError('invalid vm name')
         for c in name:
             if c in string.digits: continue
             if c in '_-.:/+': continue

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] [RFC] Domain name issue
  2006-06-18  9:24 [PATCH] [RFC] Domain name issue Masaki Kanno
@ 2006-06-18  9:29 ` Muli Ben-Yehuda
  2006-06-19  2:02   ` Masaki Kanno
  0 siblings, 1 reply; 3+ messages in thread
From: Muli Ben-Yehuda @ 2006-06-18  9:29 UTC (permalink / raw)
  To: Masaki Kanno; +Cc: xen-devel

On Sun, Jun 18, 2006 at 06:24:09PM +0900, Masaki Kanno wrote:
Content-Description: Mail message body

> Hi,
> 
> When we tested xm commands, we found a issue about a domain name.
> The domain name can use character '-'. However, when character '-' 
> was used for the top of the domain name character string, the 
> following issue was found. 
> 
> # xm list
> Name                              ID Mem(MiB) VCPUs State  Time(s)
> -domUtemp                          1      512     1 r-----    43.2
> Domain-0                           0      492     1 r-----   199.2
> # xm list -domUtemp
> Error: option -d not recognized
> 
> Some xm commands mistook such the domain name for a option. 
> We suggest the following patch. The patch changes XendDomainInfo.py 
> not to be able to use character '-' for the top of the domain name 
> character string. 

The standard way of handling this is to add '--' on the command line
to tell the program that everything that follows is an argument, not
an option. I don't know if xm supports this however.

The above command line would then become

xm list -- -domUtemp

Does this work?

Cheers,
Muli

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] [RFC] Domain name issue
  2006-06-18  9:29 ` Muli Ben-Yehuda
@ 2006-06-19  2:02   ` Masaki Kanno
  0 siblings, 0 replies; 3+ messages in thread
From: Masaki Kanno @ 2006-06-19  2:02 UTC (permalink / raw)
  To: Muli Ben-Yehuda; +Cc: xen-devel

Hi Muli,

Thanks for your information.

Best regards,
 Kan

>On Sun, Jun 18, 2006 at 06:24:09PM +0900, Masaki Kanno wrote:
>Content-Description: Mail message body
>
>> Hi,
>> 
>> When we tested xm commands, we found a issue about a domain name.
>> The domain name can use character '-'. However, when character '-' 
>> was used for the top of the domain name character string, the 
>> following issue was found. 
>> 
>> # xm list
>> Name                              ID Mem(MiB) VCPUs State  Time(s)
>> -domUtemp                          1      512     1 r-----    43.2
>> Domain-0                           0      492     1 r-----   199.2
>> # xm list -domUtemp
>> Error: option -d not recognized
>> 
>> Some xm commands mistook such the domain name for a option. 
>> We suggest the following patch. The patch changes XendDomainInfo.py 
>> not to be able to use character '-' for the top of the domain name 
>> character string. 
>
>The standard way of handling this is to add '--' on the command line
>to tell the program that everything that follows is an argument, not
>an option. I don't know if xm supports this however.
>
>The above command line would then become
>
>xm list -- -domUtemp
>
>Does this work?
>
>Cheers,
>Muli

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-06-19  2:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-18  9:24 [PATCH] [RFC] Domain name issue Masaki Kanno
2006-06-18  9:29 ` Muli Ben-Yehuda
2006-06-19  2:02   ` Masaki Kanno

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.