From: Masaki Kanno Subject: [PATCH] [RFC] Domain name issue Date: Sun, 18 Jun 2006 18:24:09 +0900 Message-ID: <0C692B8F40423kanno.masaki@jp.fujitsu.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Boundary-n61si3tkBvEjRqQpsRP3p" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org --Boundary-n61si3tkBvEjRqQpsRP3p Content-Type: text/plain; charset=iso-2022-jp Content-Transfer-Encoding: 7bit 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. 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 Signed-off-by: Masaki Kanno 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 --Boundary-n61si3tkBvEjRqQpsRP3p Content-Type: application/octet-stream; name="domainname.patch" Content-Disposition: attachment; filename="domainname.patch" Content-Transfer-Encoding: base64 ZGlmZiAtciAwZDFkYWIxZDliNjcgdG9vbHMvcHl0aG9uL3hlbi94ZW5kL1hlbmREb21haW5J bmZvLnB5Ci0tLSBhL3Rvb2xzL3B5dGhvbi94ZW4veGVuZC9YZW5kRG9tYWluSW5mby5weQlG cmkgSnVuIDE2IDEwOjE4OjU0IDIwMDYgLTA2MDAKKysrIGIvdG9vbHMvcHl0aG9uL3hlbi94 ZW5kL1hlbmREb21haW5JbmZvLnB5CVN1biBKdW4gMTggMTc6MTk6NTcgMjAwNiArMDkwMApA QCAtMTE4OSw2ICsxMTg5LDggQEAgY2xhc3MgWGVuZERvbWFpbkluZm86CiAgICAgICAgICIi IgogICAgICAgICBpZiBuYW1lIGlzIE5vbmUgb3IgbmFtZSA9PSAnJzoKICAgICAgICAgICAg IHJhaXNlIFZtRXJyb3IoJ21pc3Npbmcgdm0gbmFtZScpCisgICAgICAgIGlmIG5hbWVbMF0g PT0gJy0nOgorICAgICAgICAgICAgcmFpc2UgVm1FcnJvcignaW52YWxpZCB2bSBuYW1lJykK ICAgICAgICAgZm9yIGMgaW4gbmFtZToKICAgICAgICAgICAgIGlmIGMgaW4gc3RyaW5nLmRp Z2l0czogY29udGludWUKICAgICAgICAgICAgIGlmIGMgaW4gJ18tLjovKyc6IGNvbnRpbnVl Cg== --Boundary-n61si3tkBvEjRqQpsRP3p Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --Boundary-n61si3tkBvEjRqQpsRP3p--