-
由 Daniel P. Berrange 提交于
QEMU monitor commands may sleep for a prolonged period of time. If the virDomainObjPtr or qemu driver lock is held this will needlessly block execution of many other API calls. it also prevents asynchronous monitor events from being dispatched while a monitor command is executing, because deadlock will ensure. To resolve this, it is neccessary to release all locks while executing a monitor command. This change introduces a flag indicating that a monitor job is active, and a condition variable to synchronize access to this flag. This ensures that only a single thread can be making a state change or executing a monitor command at a time, while still allowing other API calls to be completed without blocking * src/qemu/qemu_driver.c: Release driver and domain lock when running monitor commands. Re-add locking to disk passphrase callback * src/qemu/THREADS.txt: Document threading rules
f9c56cce