Re: [Qemu-devel] [PATCH 2/2] io: fix qio_channel_socket_accept err handling

2017-08-02 Thread Peter Xu
On Wed, Aug 02, 2017 at 10:30:20AM +0100, Daniel P. Berrange wrote: > On Wed, Aug 02, 2017 at 11:25:21AM +0800, Peter Xu wrote: > > When accept failed, we should setup errp with the reason. More > > importantly, the caller may assume errp be non-NULL when error happens, > > and not setting the

Re: [Qemu-devel] [PATCH 2/2] io: fix qio_channel_socket_accept err handling

2017-08-02 Thread Juan Quintela
Peter Xu wrote: > When accept failed, we should setup errp with the reason. More > importantly, the caller may assume errp be non-NULL when error happens, > and not setting the errp may crash QEMU. > > At the same time, move the trace_qio_channel_socket_accept_fail() after >

[Qemu-devel] [PATCH 2/2] io: fix qio_channel_socket_accept err handling

2017-08-01 Thread Peter Xu
When accept failed, we should setup errp with the reason. More importantly, the caller may assume errp be non-NULL when error happens, and not setting the errp may crash QEMU. At the same time, move the trace_qio_channel_socket_accept_fail() after the if check on EINTR. Two reasons: 1. when