From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57185) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W3k0D-0000wI-2q for qemu-devel@nongnu.org; Thu, 16 Jan 2014 05:16:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W3k09-0006IA-9P for qemu-devel@nongnu.org; Thu, 16 Jan 2014 05:16:45 -0500 Received: from mx1.redhat.com ([209.132.183.28]:34838) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W3k08-0006I1-VX for qemu-devel@nongnu.org; Thu, 16 Jan 2014 05:16:41 -0500 Date: Thu, 16 Jan 2014 10:16:31 +0000 From: "Daniel P. Berrange" Message-ID: <20140116101631.GC29231@redhat.com> References: <1389172376-30636-1-git-send-email-lilei@linux.vnet.ibm.com> <1389172376-30636-6-git-send-email-lilei@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1389172376-30636-6-git-send-email-lilei@linux.vnet.ibm.com> Subject: Re: [Qemu-devel] [PATCH 5/6] virtio-9p-proxy: replace v9fs_receivefd with qemu_recv_with_fd Reply-To: "Daniel P. Berrange" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Lei Li Cc: pbonzini@redhat.com, mohan@in.ibm.com, qemu-devel@nongnu.org On Wed, Jan 08, 2014 at 05:12:55PM +0800, Lei Li wrote: > Signed-off-by: Lei Li > --- > 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 :|