Received: from eggs.gnu.org ([2001:4830:134:3::10]:47495) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X0Sgr-0000uJ-3G for qemu-devel@nongnu.org; Fri, 27 Jun 2014 05:43:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X0Sgk-0007N7-VK for qemu-devel@nongnu.org; Fri, 27 Jun 2014 05:43:29 -0400 Received: from mx1.redhat.com ([209.132.183.28]:2302) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X0Sgk-0007Mn-Nq for qemu-devel@nongnu.org; Fri, 27 Jun 2014 05:43:22 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s5R9hMuH000747 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Fri, 27 Jun 2014 05:43:22 -0400 Date: Fri, 27 Jun 2014 11:43:20 +0200 From: Stefan Hajnoczi Message-ID: <20140627094320.GF12061@stefanha-thinkpad.muc.redhat.com> References: <1401813551-6667-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="xkXJwpr35CY/Lc3I" Content-Disposition: inline In-Reply-To: <1401813551-6667-1-git-send-email-pbonzini@redhat.com> Subject: Re: [Qemu-devel] [PATCH 0/5] qemu-char/monitor: make monitor_puts thread safe List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: kwolf@redhat.com, famz@redhat.com, kraxel@redhat.com, qemu-devel@nongnu.org, lcapitulino@redhat.com --xkXJwpr35CY/Lc3I Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jun 03, 2014 at 06:39:05PM +0200, Paolo Bonzini wrote: > Even though virtio-blk-dataplane mostly synchronizes with the block layer > by means of the AioContext, we still need to introduce mutexes for other > QEMU subsystems that the dataplane thread might encounter on its way. > Adding rerror/werror support, for example, means that the dataplane > thread will have to generate QMP events. >=20 > monitor_puts is the entry point for generating QMP responses and events. > Making it thread-safe lets virtio-blk-dataplane threads generate QMP > events; because the same entry point is also used for responses, a > response and an event will never be intertwined. >=20 > Protection is inserted at both the qemu-char and monitor levels. > A generic mutex is necessary in qemu_fe_chr_write so that > qemu_chr_fe_write_all does not break its output; we reuse that > mutex in some of the character devices. >=20 > There is no need to protect against removal of the monitor's backend, > since the monitor itself cannot be removed. >=20 > Paolo Bonzini (6): > qemu-char: introduce qemu_chr_alloc > qemu-char: do not call chr_write directly > qemu-char: move pty_chr_update_read_handler around > qemu-char: make writes thread-safe > monitor: protect outbuf with mutex > monitor: protect event emission >=20 > backends/baum.c | 2 +- > backends/msmouse.c | 2 +- > include/sysemu/char.h | 20 ++++++-- > monitor.c | 55 ++++++++++++++++++---- > qemu-char.c | 125 +++++++++++++++++++++++++++++++++-----------= ------ > spice-qemu-char.c | 2 +- > ui/console.c | 2 +- > 7 files changed, 149 insertions(+), 59 deletions(-) Modulo Fam's missing unlock comment: Reviewed-by: Stefan Hajnoczi --xkXJwpr35CY/Lc3I Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJTrTy4AAoJEJykq7OBq3PIQKIH/3b3OnfJJ/zqkmWvV7wX8phs 7Gf9RRfje/KMeD58ZbousBhil5o8ymol3o7DU/exisP7n+l6C5wSiHevTBjwAXps h2XsDdThun6bUp3eax+KQ4yCDAe5dOBr/1v4Harmt54x4zb7pqKiD5yZHzp+4L7w 1ETzFA+HazXJe+Kfs2HjdpGTUY6deWNjntTkOyrQr43+scW6JWCxfdsGOFblO6Pf 7MH5JBseRk4dXw8NDDYBlHLSnD6cqk6w8sMajEknD6lONt+zwev8RTg1yGEZAoAj cVJvfN+izlhU94fGD6B57ToPsAGon45Uecnsv+qfN3PaFZKb07o7lOhW5fNd8SQ= =Ppor -----END PGP SIGNATURE----- --xkXJwpr35CY/Lc3I--