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.
> 
> Signed-off-by: Gerd Hoffmann <kra...@redhat.com>
> ---
>  qapi-schema.json |   13 +++++++++++
>  qemu-char.c      |   62 
> +++++++++++++++++++++++++++++++++++++++++++++++-------
>  qemu-options.hx  |    9 +++----
>  3 files changed, 71 insertions(+), 13 deletions(-)
> 

> +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 = O_RDWR;
> +        fd = 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?

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to