qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] hw/char/serial: Only retry if qemu_chr_fe_write


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH] hw/char/serial: Only retry if qemu_chr_fe_write returns 0
Date: Fri, 13 Jul 2018 17:05:41 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0

On 13/07/2018 16:55, Marc-André Lureau wrote:
> -                return;
> +        } else {
> +            int rc = qemu_chr_fe_write(&s->chr, &s->tsr, 1);
> +
> +            if ((rc == 0 ||
> +                 (rc == -1 && (errno == EAGAIN || errno == EINTR))) &&
> +                s->tsr_retry < MAX_XMIT_RETRY) {
> +                assert(s->watch_tag == 0);
> +                s->watch_tag =
> +                    qemu_chr_fe_add_watch(&s->chr, G_IO_OUT | G_IO_HUP,
> +                                          serial_watch_cb, s);
> +                if (s->watch_tag > 0) {
> +                    s->tsr_retry++;
> +                    return;
> +                }

I think EINTR should be handled by chardev, otherwise yes.

Paolo



reply via email to

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