qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 5/6] virtio-9p-proxy: replace v9fs_receivefd wit


From: Daniel P. Berrange
Subject: Re: [Qemu-devel] [PATCH 5/6] virtio-9p-proxy: replace v9fs_receivefd with qemu_recv_with_fd
Date: Thu, 16 Jan 2014 10:16:31 +0000
User-agent: Mutt/1.5.21 (2010-09-15)

On Wed, Jan 08, 2014 at 05:12:55PM +0800, Lei Li wrote:
> Signed-off-by: Lei Li <address@hidden>
> ---
>  hw/9pfs/virtio-9p-proxy.c |   60 ++------------------------------------------
>  1 files changed, 3 insertions(+), 57 deletions(-)
> 
> diff --git a/hw/9pfs/virtio-9p-proxy.c b/hw/9pfs/virtio-9p-proxy.c
> index 5f44bb7..f34b845 100644
> --- a/hw/9pfs/virtio-9p-proxy.c
> +++ b/hw/9pfs/virtio-9p-proxy.c

> -    do {
> -        retval = recvmsg(sockfd, &msg, 0);
> -    } while (retval < 0 && errno == EINTR);
> -    if (retval <= 0) {
> -        return retval;
> -    }
> -    /*
> -     * data is set to V9FS_FD_VALID, if ancillary data is sent.  If this
> -     * request doesn't need ancillary data (fd) or an error occurred,
> -     * data is set to negative errno value.
> -     */
> -    if (data != V9FS_FD_VALID) {
> -        *status = data;
> -        return 0;
> -    }

This code is handling the 'data' value...


> @@ -307,6 +252,7 @@ static int v9fs_request(V9fsProxy *proxy, int type,
>      V9fsString *name, *value;
>      V9fsString *path, *oldpath;
>      struct iovec *iovec = NULL, *reply = NULL;
> +    int data = V9FS_FD_VALID;
>  
>      qemu_mutex_lock(&proxy->mutex);
>  
> @@ -548,7 +494,7 @@ static int v9fs_request(V9fsProxy *proxy, int type,
>           * A file descriptor is returned as response for
>           * T_OPEN,T_CREATE on success
>           */
> -        if (v9fs_receivefd(proxy->sockfd, &retval) < 0) {
> +        if (qemu_recv_with_fd(proxy->sockfd, &retval, &data, sizeof(data)) < 
> 0) {
>              goto close_error;
>          }

...but this code is ignoring the return value in 'data'.


Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|



reply via email to

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