[Libvir] [PATCH] xend 404 errors return VIR_ERR_NO_DOMAIN

Richard W.M. Jones rjones at redhat.com
Wed Jul 4 11:07:45 UTC 2007


(1) Check for 404 errors from xend and turn them into VIR_ERR_NO_DOMAIN 
(currently they are VIR_ERR_POST_FAILED).

You'll typically see this when you have a handle to a domain, but the 
underlying domain is shutdown, as in this example:

$ python
Python 2.4.3 (#1, Dec 11 2006, 11:39:03)
[GCC 4.1.1 20061130 (Red Hat 4.1.1-43)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
 >>> import libvirt
 >>> conn = libvirt.open ("xen+tls:///")
 >>> dom = conn.lookupByName ("fc6_6")
 >>> dom.suspend ()
0
 >>> dom.resume ()
0
	#### here, I shut down the domain using 'xm'
 >>> dom.suspend ()
libvir: Xen Daemon error : Domain not found: No such domain fc6_6
Traceback (most recent call last):
   File "<stdin>", line 1, in ?
   File "/home/rjones/local/lib/python2.4/site-packages/libvirt.py", 
line 359, in suspend
     if ret == -1: raise libvirtError ('virDomainSuspend() failed', 
dom=self)
libvirt.libvirtError: virDomainSuspend() failed Domain not found: No 
such domain fc6_6

(2) There was a case where xend was returning an error, but we didn't 
translate that into an error return code (-1).  I'm sure this is an 
oversight, and the patch fixes it.

Rich.

-- 
Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/
Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod
Street, Windsor, Berkshire, SL4 1TE, United Kingdom.  Registered in
England and Wales under Company Registration No. 03798903
-------------- next part --------------
A non-text attachment was scrubbed...
Name: libvirt-xend-no-domain-20070704.patch
Type: text/x-patch
Size: 983 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20070704/9097a2dc/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3237 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20070704/9097a2dc/attachment-0003.bin>


More information about the libvir-list mailing list