]> git.ipfire.org Git - thirdparty/libvirt.git/commit
Fix race condition when destroying guests
authorDaniel P. Berrange <berrange@redhat.com>
Fri, 18 Jan 2013 14:33:51 +0000 (14:33 +0000)
committerLaine Stump <laine@laine.org>
Fri, 18 Jan 2013 18:23:23 +0000 (13:23 -0500)
commit2d6eaba20119aaba25b7180f1bbf454146f20a44
treea80d3ec2f24e2d7e70319e11d56a123ee13193fb
parenta054aa94e8497323e367ed132f519ebdba0fbade
Fix race condition when destroying guests

When running virDomainDestroy, we need to make sure that no other
background thread cleans up the domain while we're doing our work.
This can happen if we release the domain object while in the
middle of work, because the monitor might detect EOF in this window.
For this reason we have a 'beingDestroyed' flag to stop the monitor
from doing its normal cleanup. Unfortunately this flag was only
being used to protect qemuDomainBeginJob, and not qemuProcessKill

This left open a race condition where either libvirtd could crash,
or alternatively report bogus error messages about the domain already
having been destroyed to the caller

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
(cherry picked from commit 81621f3e6e45e8681cc18ae49404736a0e772a11)

Conflicts:

  src/qemu/qemu_driver.c - virReportError had been removed from
      upstream in cases where qemuProcessKill failed, creating
      different context.
src/qemu/qemu_driver.c