]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commit
virDomainCreateXML: Don't remove persistent domains on error
authorMichal Privoznik <mprivozn@redhat.com>
Tue, 22 Sep 2015 14:52:03 +0000 (16:52 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 24 Sep 2015 08:52:37 +0000 (10:52 +0200)
commit37405b910907bd1ad338fb0d6a967bfd23529cf6
treeb244c25385427f01a9442386de4b46abed0b3260
parent3824c19df8b5170aacf5c728d251213e77a46aae
virDomainCreateXML: Don't remove persistent domains on error

https://bugzilla.redhat.com/show_bug.cgi?id=871452

Okay, so we allow users to 'virsh create' an already existing
domain, providing completely different XML than the one stored in
Libvirt. Well, as long as name and UUID matches. However, in some
drivers the code that handles errors unconditionally removes the
domain that failed to start even though the domain might have
been persistent. Fortunately, the domain is removed just from the
internal list of domains and the config file is kept around.

Steps to reproduce:

1) virsh dumpxml $dom > /tmp/dom.xml
2) change XML so that it is still parse-able but won't boot, e.g.
change guest agent path to /foo/bar
3) virsh create /tmp/dom.xml
4) virsh dumpxml $dom
5) Observe "No such domain" error

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
src/lxc/lxc_driver.c
src/qemu/qemu_driver.c
src/test/test_driver.c
src/uml/uml_driver.c
src/vmware/vmware_driver.c