bug report of xm list and xm vcpu-list
Hi,
Xm list and xm vcpu-list show wrong DomID(name).
Under this situation,
# xm list Name ID Mem(MiB) VCPUs State Time(s) Domain-0 0 512 1 r----- 1064.6 test1 13 64 1 r----- 83879.7
# xm list 1 13 Error: Domain '1' not found when running 'xm list' # xm list 13 15 Error: Domain '13' not found when running 'xm list'
An error message shows always the first one of given DomIDs, when xm list is given unexistant DomIDs.
This is serious, when many domains are running.
Vcpu-list is same. In addition, it shows an unnecessary header. This is unnatural.
# xm vcpu-list 13 15 Name ID VCPU CPU State Time(s) CPU Affinity Error: Domain '13' not found when running 'xm vcpu-list'
cause:
In tools/python/xen/xm/main.py, dom is always the first parameter of non_option
def handle_xend_error(cmd, args, ex):
non_option = filter(lambda x: x[0] != '-', args) dom = len(non_option) > 0 and non_option[0] or None
<---------look
error = str(ex)
if error == "Not found" and dom != None:
err("Domain '%s' not found when running 'xm %s'" % (dom, cmd))
else:
err(error)
Thanks.
Quoted 9 lines · Yoshinori Katase
Hi,
Xm list and xm vcpu-list show wrong DomID(name).
Under this situation,# xm list Name ID Mem(MiB) VCPUs State Time(s) Domain-0 0 512 1 r----- 1064.6 test1 13 64 1 r----- 83879.7
Quoted 8 lines
# xm list 1 13 Error: Domain '1' not found when running 'xm list' # xm list 13 15 Error: Domain '13' not found when running 'xm list'An error message shows always the first one of given DomIDs, when xm list is given unexistant DomIDs.
This is serious, when many domains are running.
This is a problem with the exception reporting from Xend (the daemon) to xm (the client tool). The exception does not carry enough information to allow xm to diagnose the problem correctly. Please feel free to fix this (no-one else is working on it at the moment).
Ewan.
Who gives exeption routine in main.py 'Not found' in ex ?
Hi, Ewan.
I investigated at your suggestion.
When un-existant domain name(id)s is given xm, exeption routine in main.py is carried 'Not found' in ex.
932: except xen.xend.XendError.XendError, ex:
933: if len(args) > 0:
934: handle_xend_error(argv[1], args, ex)
But in xend.trace, XendEroor shows error DomID.
| 43 if not dom:
| 44 raise XendError('No such domain ' + str(x))
| |> XendError.py:__init__
| | 21 self.value = value
| |< XendError.py:__init__
| ! Exception:Traceback (most recent call last):
File "/usr/lib/python/xen/xend/server/SrvDomainDir.py", line 44, in domain
raise XendError('No such domain ' + str(x))
XendError: No such domain 100
| ! Exception:
Traceback (most recent call last):
File "/usr/lib/python/xen/xend/server/SrvDomainDir.py", line 52, in get
return self.domain(x)
File "/usr/lib/python/xen/xend/server/SrvDomainDir.py", line 44, in domain
raise XendError('No such domain ' + str(x))
XendError: No such domain 100
| |> XendError.py:__str__ | | 24 return self.value | |< XendError.py:__str__
Who changes xend's error massage ?
Best Regards,
Yoshinori Katase
-----Original Message-----
From: Ewan Mellor [mailto:[email protected]]
Sent: Friday, December 23, 2005 12:40 AM
To: Yoshinori Katase
Cc: [email protected]
Subject: Re: [Xen-devel] bug report of xm list and xm vcpu-list
Quoted 9 lines · Yoshinori Katase
Hi,
Xm list and xm vcpu-list show wrong DomID(name).
Under this situation,# xm list Name ID Mem(MiB) VCPUs State Time(s) Domain-0 0 512 1 r----- 1064.6 test1 13 64 1 r----- 83879.7
Quoted 8 lines
# xm list 1 13 Error: Domain '1' not found when running 'xm list' # xm list 13 15 Error: Domain '13' not found when running 'xm list'An error message shows always the first one of given DomIDs, when xm list is given unexistant DomIDs.
This is serious, when many domains are running.
This is a problem with the exception reporting from Xend (the daemon) to xm (the client tool). The exception does not carry enough information to allow xm to diagnose the problem correctly. Please feel free to fix this (no-one else is working on it at the moment).
Ewan.
Re: Who gives exeption routine in main.py 'Not found' in ex ?
Quoted 29 lines · Yoshinori Katase
Hi, Ewan.
I investigated at your suggestion.When un-existant domain name(id)s is given xm, exeption routine in
main.pyis carried 'Not found' in ex.932: except xen.xend.XendError.XendError, ex:
933: if len(args) > 0:
934:handle_xend_error(argv[1], args, ex)But in xend.trace, XendEroor shows error DomID.
| 43 if not dom: | 44 raise XendError('No such domain ' + str(x)) | |> XendError.py:__init__ | | 21 self.value = value | |< XendError.py:__init__ | ! Exception:Traceback (most recent call last):
File "/usr/lib/python/xen/xend/server/SrvDomainDir.py", line 44, in domain
raise XendError('No such domain ' + str(x))
XendError: No such domain 100
| ! Exception:
Traceback (most recent call last):
File "/usr/lib/python/xen/xend/server/SrvDomainDir.py", line 52, in get
returnself.domain(x)
File "/usr/lib/python/xen/xend/server/SrvDomainDir.py", line 44, in domain
raise XendError('No such domain ' + str(x))
XendError: No such domain 100
Quoted 5 lines
| |> XendError.py:__str__ | | 24 return self.value | |< XendError.py:__str__Who changes xend's error massage ?
Deep in the depths of Xend's communication support (just past the adulterers and fornicators, but before you reach the gluttonous and the slothful) you will find xen.web.SrvDir.getChild. This catches XendError and uses noChild and then xen.web.resource.ErrorPage to convert the exception to an HTTP response. This response includes the exception message as the page message. The HTTP response code "404 Not Found" is set by SrvDir.noChild.
In the client, in xen.xend.XendProtocol.{xendRequest,handleStatus,handleException} the XendError exception is recreated, but this time using the HTTP reason phrase rather than the exception message. So you get "Not found" from the "404 Not Found", and you've lost the domain ID.
Almost any arrangement would be better than this one. Please feel that you have free rein to alter things here (assuming that it still works when you are done ;-)
Thank you,
Ewan.