
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 ()
(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. 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