]> xenbits.xensource.com Git - libvirt.git/commit
Fix virDomainObj ref handling in QEMU driver
authorDaniel P. Berrange <berrange@redhat.com>
Tue, 8 Dec 2009 14:42:43 +0000 (14:42 +0000)
committerDaniel P. Berrange <berrange@redhat.com>
Wed, 9 Dec 2009 10:32:45 +0000 (10:32 +0000)
commit8e7d14953ca6ef047112bc6ac177507ea8f824f2
tree238aba728ce0254f5e1d84350d3cccf32fd6e149
parent604c70fd5da43c4105fa92162fd7cb4e9de840e1
Fix virDomainObj ref handling in QEMU driver

Since the monitor I/O is processed out of band from the main
thread(s) invoking monitor  commands, the virDomainObj may be
deleted by the I/O thread. The qemuDomainObjBeginJob takes an
extra reference to protect against final deletion, but this
reference is released by the corresponding EndJob call. THus
after the EndJob call it may not be valid to reference the
virDomainObj any more. To allow callers to detect this, the
EndJob call is changed to return the remaining reference count.

* src/conf/domain_conf.c: Make virDomainObjUnref return the
  remaining reference count
* src/qemu/qemu_driver.c: Avoid referencing virDomainObjPtr
  after qemuDomainObjEndJob if it has been deleted.
src/conf/domain_conf.c
src/qemu/qemu_driver.c