Re: [Qemu-devel] [PATCH] qemu-char: reset errno before qemu char write or read action

2018-07-03 Thread xinhua . Cao
在 2018/7/2 16:46, Paolo Bonzini 写道: On 02/07/2018 02:49, xinhua.Cao wrote: In the tcp_chr_write function, we checked errno, but errno was not reset before a read or write operation. Therefore, this check of errno's actions is often incorrect after EAGAIN has occurred. We reset errno before re

Re: [Qemu-devel] [PATCH] qemu-char: reset errno before qemu char write or read action

2018-07-03 Thread xinhua . Cao
在 2018/7/2 23:01, Stefan Hajnoczi 写道: On Mon, Jul 02, 2018 at 08:49:10AM +0800, xinhua.Cao wrote: In the tcp_chr_write function, we checked errno, but errno was not reset before a read or write operation. Therefore, this check of errno's actions is often incorrect after EAGAIN has occurred. W

Re: [Qemu-devel] [PATCH] qemu-char: reset errno before qemu char write or read action

2018-07-02 Thread Stefan Hajnoczi
On Mon, Jul 02, 2018 at 08:49:10AM +0800, xinhua.Cao wrote: > In the tcp_chr_write function, we checked errno, > but errno was not reset before a read or write operation. > Therefore, this check of errno's actions is often > incorrect after EAGAIN has occurred. > We reset errno before reading and w

Re: [Qemu-devel] [PATCH] qemu-char: reset errno before qemu char write or read action

2018-07-02 Thread Eric Blake
On 07/01/2018 07:49 PM, xinhua.Cao wrote: In the tcp_chr_write function, we checked errno, but errno was not reset before a read or write operation. Therefore, this check of errno's actions is often incorrect after EAGAIN has occurred. We reset errno before reading and writing to ensure the corre

Re: [Qemu-devel] [PATCH] qemu-char: reset errno before qemu char write or read action

2018-07-02 Thread Paolo Bonzini
On 02/07/2018 02:49, xinhua.Cao wrote: > In the tcp_chr_write function, we checked errno, > but errno was not reset before a read or write operation. > Therefore, this check of errno's actions is often > incorrect after EAGAIN has occurred. > We reset errno before reading and writing to > ensure th

Re: [Qemu-devel] [PATCH] qemu-char: reset errno before qemu char write or read action

2018-07-01 Thread Philippe Mathieu-Daudé
On 07/01/2018 09:49 PM, xinhua.Cao wrote: > In the tcp_chr_write function, we checked errno, > but errno was not reset before a read or write operation. > Therefore, this check of errno's actions is often > incorrect after EAGAIN has occurred. > We reset errno before reading and writing to > ensure

[Qemu-devel] [PATCH] qemu-char: reset errno before qemu char write or read action

2018-07-01 Thread xinhua . Cao
In the tcp_chr_write function, we checked errno, but errno was not reset before a read or write operation. Therefore, this check of errno's actions is often incorrect after EAGAIN has occurred. We reset errno before reading and writing to ensure the correctness of errno's judgment Signed-off-by: x