
On 02/22/2012 11:16 AM, Eric Blake wrote:
On 02/22/2012 07:06 AM, Guido Winkelmann wrote:
Hi,
As the subject line indicates, when I'm calling virDomainCreate() to start a defined domain, and that command fails because the domain is already running at that point, virGetLastError() will return NULL, instead of a proper pointer to an error code. Libvirt will, however, print an error to the console:
libvir: QEMU error : Requested operation is not valid: domain is already running
Any return of NULL without a last error set is a bug. I'm trying to chase this down, and hope to have a patch soon.
I can't reproduce this. I tested on libvirt 0.9.10, starting with an inactive domain 'dom' and using 'virsh dumpxml dom > dom.xml; virsh create dom.xml; virsh create dom.xml', and the second create gave me a proper error message of "Requested operation is not valid: domain is already active as 'dom'". Can you post the code snippet you are using to get this situation? Could it be that you have a different name and/or UUID in the xml from the domain already running (my test obviously reused the same name and uuid from what is already running). -- Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org