]> git.ipfire.org Git - thirdparty/libvirt.git/commit
lxc: Don't crash by forgetting to ref transient domains
authorMartin Kletzander <mkletzan@redhat.com>
Wed, 20 Jul 2016 07:23:03 +0000 (09:23 +0200)
committerMartin Kletzander <mkletzan@redhat.com>
Sun, 24 Jul 2016 07:08:20 +0000 (09:08 +0200)
commite4200bbb9d9bbc58a51ca55c6073146126447afb
tree678edec1fb837d263a4b2e676ef200aa45df4cba
parent0d55e0b24cae70391b3f277226a5903f8f88cd37
lxc: Don't crash by forgetting to ref transient domains

So commit 306b3a8504 tried mimicking behaviour of commit 540c339a25, but
added a virObjectRef(vm) only after virDomainObjListAdd() in
lxcDomainDefineXMLFlags() and not in lxcDomainCreateXMLWithFiles().
That way undefining a domain that was started with different XML than
defined will leave the domain object in a state with not enough
references to then remove it.  Hence any lxcDomainDestroyFlags() called
afterwards crashes the daemon.

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

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
src/lxc/lxc_driver.c