From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53028) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zleq8-00028q-Hj for qemu-devel@nongnu.org; Mon, 12 Oct 2015 11:16:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zleq7-0004lD-IA for qemu-devel@nongnu.org; Mon, 12 Oct 2015 11:16:40 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33645) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zleq7-0004l1-AJ for qemu-devel@nongnu.org; Mon, 12 Oct 2015 11:16:39 -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 (Postfix) with ESMTPS id 8E9978A344 for ; Mon, 12 Oct 2015 15:16:38 +0000 (UTC) References: <1444637004-20195-1-git-send-email-pbonzini@redhat.com> <1444637004-20195-8-git-send-email-pbonzini@redhat.com> From: Eric Blake Message-ID: <561BCED5.5010303@redhat.com> Date: Mon, 12 Oct 2015 09:16:37 -0600 MIME-Version: 1.0 In-Reply-To: <1444637004-20195-8-git-send-email-pbonzini@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="G5pLCgFeO6Chvq9JODSuvSchK4jp1VO3r" Subject: Re: [Qemu-devel] [PATCH 07/21] qemu-char: convert pipe backend to data-driven creation List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini , qemu-devel@nongnu.org Cc: armbru@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --G5pLCgFeO6Chvq9JODSuvSchK4jp1VO3r Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 10/12/2015 02:03 AM, Paolo Bonzini wrote: > Signed-off-by: Paolo Bonzini > --- > qemu-char.c | 37 +++++++++++++++++++++---------------- > 1 file changed, 21 insertions(+), 16 deletions(-) >=20 > diff --git a/qemu-char.c b/qemu-char.c > index 84cb8d0..3545cd8 100644 > --- a/qemu-char.c > +++ b/qemu-char.c > @@ -1078,18 +1078,17 @@ static CharDriverState *qemu_chr_open_fd(int fd= _in, int fd_out) > return chr; > } > =20 > -static CharDriverState *qemu_chr_open_pipe(ChardevHostdev *opts) > +static CharDriverState *qemu_chr_open_pipe(const char *id, > + ChardevBackend *backend, > + ChardevReturn *ret, > + Error **errp) > { > + ChardevHostdev *opts =3D backend->pipe; > int fd_in, fd_out; > char filename_in[CHR_MAX_FILENAME_SIZE]; > char filename_out[CHR_MAX_FILENAME_SIZE]; > const char *filename =3D opts->device; > =20 > - if (filename =3D=3D NULL) { > - fprintf(stderr, "chardev: pipe: no filename given\n"); > - return NULL; > - } > - > snprintf(filename_in, CHR_MAX_FILENAME_SIZE, "%s.in", filename); Do we need assert(filename) here? > @@ -2096,12 +2097,12 @@ static int win_chr_pipe_init(CharDriverState *c= hr, const char *filename) > =20 > s->hsend =3D CreateEvent(NULL, TRUE, FALSE, NULL); > if (!s->hsend) { > - fprintf(stderr, "Failed CreateEvent\n"); > + error_setg(errp, "Failed CreateEvent\n"); > goto fail; > } > s->hrecv =3D CreateEvent(NULL, TRUE, FALSE, NULL); > if (!s->hrecv) { > - fprintf(stderr, "Failed CreateEvent\n"); > + error_setg(errp, "Failed CreateEvent\n"); > goto fail; Drop the trailing \n, here and throughout this file > @@ -4277,7 +4282,7 @@ ChardevReturn *qmp_chardev_add(const char *id, Ch= ardevBackend *backend, > abort(); > break; > case CHARDEV_BACKEND_KIND_PIPE: > - chr =3D qemu_chr_open_pipe(backend->pipe); > + abort(); > break; another dead break --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --G5pLCgFeO6Chvq9JODSuvSchK4jp1VO3r Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJWG87VAAoJEKeha0olJ0NqmMwH/iXIEKilFS8+uGuz38/n/Den ruFEbQP0Pvy/SAoA4l12gj1jCQ66TVCwUc0RoDzYS7POIQ82lIc21amoOlquEU5C vTyCVMn85WhpFPYcA+wL7t7NQY1l4ps8GblgTKPasIRv82y3WzOdVDwnQeTMETA5 NRT5rnBH5spzF3Oj+iKjIgYiTo+xGhco0D1SRuWJkRcqI+A43+brM8bASRBGY1gw m+7+QXCra1MbKcssHwKF8oZmGljXbkNnvP3OTWmETcy1MUzrj2MAjtbVgh97lhp7 /rcLUZu56j28raeQdz3io03UHullW9FIK8dxZGsYFO0qof13C6Ska/0b2DOUGvM= =WOni -----END PGP SIGNATURE----- --G5pLCgFeO6Chvq9JODSuvSchK4jp1VO3r--