[Top][All Lists]

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

Re: [Qemu-trivial] [PATCH 1/1] Do not hang on full PTY

From: Don Slutz
Subject: Re: [Qemu-trivial] [PATCH 1/1] Do not hang on full PTY
Date: Mon, 29 Dec 2014 15:27:49 -0500
User-agent: Mozilla/5.0 (X11; Linux i686 on x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0

On 12/29/14 04:59, Michael Tokarev wrote:
> 22.12.2014 18:04, Don Slutz wrote:
>> --- a/qemu-char.c
>> +++ b/qemu-char.c
>> @@ -1387,6 +1387,7 @@ static CharDriverState *qemu_chr_open_pty(const char 
>> *id,
>>      }
>>      close(slave_fd);
>> +    qemu_set_nonblock(master_fd);
>>      chr = qemu_chr_alloc();
> Hm.  I'm not sure at all this is a trivial change.  While the
> patch itself is trivial indeed, it changes behavour of the file
> descriptor significantly.  Are all the places where this fd is
> subsequently used prepared for it being non-blocking?  Oh well... ;)

I was not sure on this being trivial also, but it looked like it could
be to me.  The uses of this FD all looked that they handle non-blocking.

Here are the calls to qemu_set_nonblock in qemu-char.c (including this
add) :

b qemu-char.c             qemu_chr_open_fd           1070
c qemu-char.c             qemu_chr_open_stdio        1166
d qemu-char.c             qemu_chr_open_pty          1390
e qemu-char.c             tcp_chr_add_client         2952
f qemu-char.c             qmp_chardev_open_serial    4060
g qemu-char.c             qmp_chardev_open_socket    4172

So there are many cases where the FD is non-blocking already.

Hope this info helps.

> Thanks,
> /mjt

reply via email to

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