[libvirt] [PATCH] Fix potential deadlock across fork() in QEMU driver

Eric Blake eblake at redhat.com
Mon Feb 11 19:00:43 UTC 2013


On 02/11/2013 09:12 AM, Daniel P. Berrange wrote:
> From: "Daniel P. Berrange" <berrange at redhat.com>
> 
> The hook scripts used by virCommand must be careful wrt
> accessing any mutexes that may have been held by other
> threads in the parent process. With the recent refactorigng

s/refactorigng/refactoring/

> there are 2 potential flaws lurking, which will become real
> deadlock bugs once the global QEMU driver lock is removed.
> 
> Remove use of the QEMU driver lock from the hook function
> by passing in the 'virQEMUDriverConfigPtr' instance directly.
> 
> Add functions to the virSecurityManager to be invoked before
> and after fork, to ensure the mutex is held by the current
> thread. This allows it to be safely used in the hook script
> in the child procss.

s/procss/process/

> 
> Signed-off-by: Daniel P. Berrange <berrange at redhat.com>
> ---
>  src/libvirt_private.syms        |  2 ++
>  src/qemu/qemu_process.c         | 16 ++++++++++++----
>  src/security/security_manager.c | 20 ++++++++++++++++++++
>  src/security/security_manager.h |  3 +++
>  4 files changed, 37 insertions(+), 4 deletions(-)
> 

ACK.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 621 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20130211/20daad22/attachment-0001.sig>


More information about the libvir-list mailing list