Re: [PATCH] qemu: Fix deadlock when qemuDomainOpenConsole cleans up a connection

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]