From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60599) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WxdcP-0003mT-Tx for qemu-devel@nongnu.org; Thu, 19 Jun 2014 10:47:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WxdcN-0004vF-Kb for qemu-devel@nongnu.org; Thu, 19 Jun 2014 10:47:13 -0400 Received: from mx1.redhat.com ([209.132.183.28]:23736) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WxdcN-0004v2-Ct for qemu-devel@nongnu.org; Thu, 19 Jun 2014 10:47:11 -0400 Message-ID: <53A2F7EC.8000708@redhat.com> Date: Thu, 19 Jun 2014 08:47:08 -0600 From: Eric Blake MIME-Version: 1.0 References: <1403073840-32603-1-git-send-email-pbonzini@redhat.com> <1403073840-32603-33-git-send-email-pbonzini@redhat.com> In-Reply-To: <1403073840-32603-33-git-send-email-pbonzini@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="3lWC4cIqLqR5lVNGL18pF2jBQXmExPrMR" Subject: Re: [Qemu-devel] [PATCH 2.1 32/36] qemu-char: do not call chr_write directly List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini , qemu-devel@nongnu.org Cc: wenchaoqemu@gmail.com, lcapitulino@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --3lWC4cIqLqR5lVNGL18pF2jBQXmExPrMR Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 06/18/2014 12:43 AM, Paolo Bonzini wrote: > Make the mux always go through qemu_chr_fe_write, so that we'll get > the mutex for the underlying chardev. >=20 > Reviewed-by: Fam Zheng > Signed-off-by: Paolo Bonzini > --- > qemu-char.c | 14 +++++++------- > 1 file changed, 7 insertions(+), 7 deletions(-) Reviewed-by: Eric Blake > @@ -301,10 +301,10 @@ static int mux_chr_write(CharDriverState *chr, co= nst uint8_t *buf, int len) > (secs / 60) % 60, > secs % 60, > (int)(ti % 1000)); > - d->drv->chr_write(d->drv, (uint8_t *)buf1, strlen(buf1= )); > + qemu_chr_fe_write(d->drv, (uint8_t *)buf1, strlen(buf1= )); > d->linestart =3D 0; > } > - ret +=3D d->drv->chr_write(d->drv, buf+i, 1); > + ret +=3D qemu_chr_fe_write(d->drv, buf+i, 1); Worth fixing the spacing around + while at it? > @@ -370,7 +370,7 @@ static int mux_proc_byte(CharDriverState *chr, MuxD= river *d, int ch) > case 'x': > { > const char *term =3D "QEMU: Terminated\n\r"; > - chr->chr_write(chr,(uint8_t *)term,strlen(term)); > + qemu_chr_fe_write(chr, (uint8_t *)term, strlen(term))= ; > exit(0); > break; The break is dead code; you could clean it up while in the area. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --3lWC4cIqLqR5lVNGL18pF2jBQXmExPrMR Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJTovfsAAoJEKeha0olJ0NqFvMH/34Uqr6hozZxdQBVt4VtUr5l jRNY8jsfsc6/Pabaym4eYVrPe/FjuIwpVYMmbIx/aOlmgSEBhOghO4ulsHE8PJhx iTxutgEJDU1J4mRK3HNZq2BqTu9vgTlccuYsPlMQya3bD2/cizxNM8EajhD5absz 7U7RmQbsv78E1MFZamdANfGeKfw9lAL0rZnY8nl+7o8MorSf0JgZbvcs3ndDyf1P mWr3AEPvHHohtz1kAVGmOgxEPoSeSAl5WkTeAArvqGikgaS/w+724J+pAYBaQWg4 0kL1B7BBKNhJLIAX5hXN9ZdkA++QtFoQKQLsKvW60OwEYKv6r5uWCAsPTc9O//g= =HP0t -----END PGP SIGNATURE----- --3lWC4cIqLqR5lVNGL18pF2jBQXmExPrMR--