Re: [PATCH v2 11/11] vsock_test: wait for the remote to close the connection

2019-08-23 Thread Stefan Hajnoczi
On Thu, Aug 22, 2019 at 11:15:46AM +0200, Stefano Garzarella wrote: > On Tue, Aug 20, 2019 at 09:28:28AM +0100, Stefan Hajnoczi wrote: > > On Thu, Aug 01, 2019 at 05:25:41PM +0200, Stefano Garzarella wrote: > > > +/* Wait for the remote to close the connection */ > > > +void

Re: [PATCH v2 11/11] vsock_test: wait for the remote to close the connection

2019-08-22 Thread Stefano Garzarella
On Tue, Aug 20, 2019 at 09:28:28AM +0100, Stefan Hajnoczi wrote: > On Thu, Aug 01, 2019 at 05:25:41PM +0200, Stefano Garzarella wrote: > > +/* Wait for the remote to close the connection */ > > +void vsock_wait_remote_close(int fd) > > +{ > > + struct epoll_event ev; > > + int epollfd, nfds; >

Re: [PATCH v2 11/11] vsock_test: wait for the remote to close the connection

2019-08-20 Thread Stefan Hajnoczi
On Thu, Aug 01, 2019 at 05:25:41PM +0200, Stefano Garzarella wrote: > +/* Wait for the remote to close the connection */ > +void vsock_wait_remote_close(int fd) > +{ > + struct epoll_event ev; > + int epollfd, nfds; > + > + epollfd = epoll_create1(0); > + if (epollfd == -1) { > +

[PATCH v2 11/11] vsock_test: wait for the remote to close the connection

2019-08-01 Thread Stefano Garzarella
Before check if a send returns -EPIPE, we need to make sure the connection is closed. To do that, we use epoll API to wait EPOLLRDHUP or EPOLLHUP events on the socket. Reported-by: Jorgen Hansen Signed-off-by: Stefano Garzarella --- tools/testing/vsock/util.c | 38