]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commit
qemu: Remove double unlock for domains
authorMartin Kletzander <mkletzan@redhat.com>
Wed, 15 Jul 2015 07:07:50 +0000 (09:07 +0200)
committerMartin Kletzander <mkletzan@redhat.com>
Mon, 3 Aug 2015 14:59:20 +0000 (16:59 +0200)
commitc43c661fe4d5ca25b118cd830e2d7f7960b2a490
treec61ca4a4cf399c5e17cf74b795b513e66f41f145
parentb7102e9031e7f53187d817ef39b074ca208fbf6d
qemu: Remove double unlock for domains

The virDomainObjListRemove() function unlocks a domain that it's given
due to legacy code.  And because of that code, which should be
refactored, that last virObjectUnlock() cannot be just removed.  So
instead, lock it right back for qemu for now.  All calls to
qemuDomainRemoveInactive() are followed by code that unlocks the domain
again, plus the domain should be locked during qemuDomainObjEndJob(), so
the right place to lock it is right after virDomainObjListRemove().

The only place where this would cause a problem is the autodestroy
callback, so we need to get another reference there and uref+unlock it
afterwards.  Luckily, returning NULL from that function doesn't mean an
error, and only means that it doesn't need to be unlocked anymore.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
src/qemu/qemu_domain.c
src/qemu/qemu_process.c