qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2 07/10] chardev: add serial chardev support to


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH v2 07/10] chardev: add serial chardev support to chardev-add (qmp)
Date: Thu, 10 Jan 2013 12:39:47 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0

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 <address@hidden>
> ---
>  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

[Prev in Thread] Current Thread [Next in Thread]