]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu: Don't unref domain after exit from nested async job
authorPeter Krempa <pkrempa@redhat.com>
Wed, 7 Jan 2015 10:35:08 +0000 (11:35 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Wed, 7 Jan 2015 12:47:31 +0000 (13:47 +0100)
commit79bb49a83d01a4f6765552179b9a42ec23b1618d
tree6035d16cddc3eaf4205646247ec555e0b6768160
parentdb19a4a3c6f72e464bc3ad00e904d8df13887382
qemu: Don't unref domain after exit from nested async job

In commit 540c339a2535ec30d79e5ef84d8f50a17bc60723 the whole domain
reference counting was refactored in the qemu driver. Domain jobs now
don't need to reference the domain object as they now expect the
reference from the calling function.

However, the patch forgot to remove the unref call in case we exit the
monitor when we were acquiring a nested job. This caused the daemon to
crash on a subsequent access to the domain object once we've done an
operation requiring a nested job for a monitor access.

An easy reproducer case:

1) Start a vm with qcow disks
2) virsh snapshot-create-as DOMNAME
3) virsh dumpxml DOMNAME
4) daemon crashes in a semi-random spot while accessing a now-removed VM
object.

Fortunately, the commit wasn't released yet, so there are no security
implications.

Reported-by: Shanzi Yu <shyu@redhat.com>
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
src/qemu/qemu_domain.c