From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:36052) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TtNym-0007y0-S7 for qemu-devel@nongnu.org; Thu, 10 Jan 2013 14:40:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TtNyf-0003Ah-4D for qemu-devel@nongnu.org; Thu, 10 Jan 2013 14:39:56 -0500 Received: from mx1.redhat.com ([209.132.183.28]:55392) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TtNye-0003AY-RU for qemu-devel@nongnu.org; Thu, 10 Jan 2013 14:39:49 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r0AJdmsM029645 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 10 Jan 2013 14:39:48 -0500 Message-ID: <50EF1903.7040301@redhat.com> Date: Thu, 10 Jan 2013 12:39:47 -0700 From: Eric Blake MIME-Version: 1.0 References: <1357827786-14624-1-git-send-email-kraxel@redhat.com> <1357827786-14624-8-git-send-email-kraxel@redhat.com> In-Reply-To: <1357827786-14624-8-git-send-email-kraxel@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enig7B756DA50571E6931BF50E45" Subject: Re: [Qemu-devel] [PATCH v2 07/10] chardev: add serial chardev support to chardev-add (qmp) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann Cc: qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig7B756DA50571E6931BF50E45 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 01/10/2013 07:23 AM, Gerd Hoffmann wrote: > Simliar to file, except that no separate in/out files are supported s/Simliar/Similar/ > because it's pointless for direct device access. Also the special > tty ioctl hooks (pass through linespeed settings etc) are activated > on Unix. >=20 > Signed-off-by: Gerd Hoffmann > --- > qapi-schema.json | 13 +++++++++++ > qemu-char.c | 62 ++++++++++++++++++++++++++++++++++++++++++++++= +------- > qemu-options.hx | 9 +++---- > 3 files changed, 71 insertions(+), 13 deletions(-) >=20 > +static CharDriverState *qmp_chardev_open_port(ChardevPort *port, Error= **errp) > +{ > + int flags, fd; > + > + switch (port->type) { > +#ifdef HAVE_CHARDEV_TTY > + case CHARDEV_PORT_KIND_SERIAL: > + flags =3D O_RDWR; > + fd =3D qmp_chardev_open_file_source(port->device, flags, errp)= ; > + if (error_is_set(errp)) { > + return NULL; > + } > + socket_set_nonblock(fd); Can this fail? And if so, should you react to failure? --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --------------enig7B756DA50571E6931BF50E45 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.4.12 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with undefined - http://www.enigmail.net/ iQEcBAEBCAAGBQJQ7xkDAAoJEKeha0olJ0NqlnkIAI6K+K3tnuCtTeU0zd8hwt/I 1AUkw9d4cZJcwEkWP9AV5r40aEHcUcHFr2U9v/caKwH7+FrONIMIV6Gz4/UToUHy JACAyJeOCKbEl8N4Rr/JqljVWPxfdHXx75GGlKql+FLEnqQaNkSZIxKlAzUAMbc5 M0nl3lJR72l3YSCSxlvjKt3irKe0mzA/4RAy3UhJTLBLbEbJi24oghRXPzkbmh9C zQYRzj9hwIzSBormYNFFxBL+BjH1hpuD51D99xc2XzN9e2VXqGTlUSAvUZNB9xDe 8Y+U+W2Y/io7C0sofAapjgWj8tf0fb+GijeTF76J7euhvvhq2sMRPQi34y/2lR0= =pBXy -----END PGP SIGNATURE----- --------------enig7B756DA50571E6931BF50E45--