OSDN Git Service

qemu-char: make writes thread-safe
authorPaolo Bonzini <pbonzini@redhat.com>
Wed, 18 Jun 2014 06:43:58 +0000 (08:43 +0200)
committerLuiz Capitulino <lcapitulino@redhat.com>
Mon, 23 Jun 2014 15:12:28 +0000 (11:12 -0400)
commit9005b2a7589540a3733b3abdcfbccfe7746cd1a1
tree9cccfcf20b99cc301f8da9777bcbd97e880dd315
parent1bb7fe725c5f24a441c93fcffddcf4726f11cab5
qemu-char: make writes thread-safe

This will let threads other than the I/O thread raise QMP events.

GIOChannel is thread-safe, and send and receive state is usually
well-separated.  The only driver that requires some care is the
pty driver, where some of the state is shared by the read and write
sides.  That state is protected with the chr_write_lock too.

Reviewed-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
include/sysemu/char.h
qemu-char.c