qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 2/4] qemu-socket: set passed fd non-blocking in


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH 2/4] qemu-socket: set passed fd non-blocking in socket_connect()
Date: Tue, 26 Mar 2013 10:34:58 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130311 Thunderbird/17.0.4

On 03/26/2013 10:07 AM, Stefan Hajnoczi wrote:
> socket_connect() sets non-blocking on TCP or UNIX domain sockets if a
> callback function is passed.  Do the same for file descriptor passing,
> otherwise we could unexpectedly be using a blocking file descriptor.
> 
> Signed-off-by: Stefan Hajnoczi <address@hidden>
> ---
>  util/qemu-sockets.c | 1 +
>  1 file changed, 1 insertion(+)
> 

Reviewed-by: Eric Blake <address@hidden>

> diff --git a/util/qemu-sockets.c b/util/qemu-sockets.c
> index b6b78f5..298f6f2 100644
> --- a/util/qemu-sockets.c
> +++ b/util/qemu-sockets.c
> @@ -910,6 +910,7 @@ int socket_connect(SocketAddress *addr, Error **errp,
>      case SOCKET_ADDRESS_KIND_FD:
>          fd = monitor_get_fd(cur_mon, addr->fd->str, errp);
>          if (callback) {
> +            socket_set_nonblock(fd);
>              callback(fd, opaque);
>          }
>          break;
> 

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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