On 04/10/2012 07:29 AM, Peter Krempa wrote:
The new safe console handling introduced a possibility to deadlock
the
qemu driver when a new console connection forcibly disconnects a
previous console stream that belongs to an already closed connection.
The virStreamFree function calls subsequently a the virReleaseConnect
function that tries to lock the driver while discarding the connection,
but the driver was already locked in qemuDomainOpenConsole.
* src/qemu/qemu_driver.c: qemuDomainOpenConsole()
-- unlock the qemu driver right after acquiring the domain
object
---
Found while writing tests for the libvirt-test-API, its 100% reproducible:
1: Start a domain with serial console and run "cat" on this console
2: download python reproducer:
http://files.pipo.sk/console_deadlock.py
3: set guest name in the script
4: run the reproducer and "virsh console 'guestname' --force" after
that
5: <deadlocked>
src/qemu/qemu_driver.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
ACK; the rest of the function does not refer to driver, so moving the
unlock sooner is safe.
--
Eric Blake eblake(a)redhat.com +1-919-301-3266
Libvirt virtualization library
http://libvirt.org