From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54532) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VlGmh-0003h4-ID for qemu-devel@nongnu.org; Tue, 26 Nov 2013 06:26:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VlGmX-0008Gi-8A for qemu-devel@nongnu.org; Tue, 26 Nov 2013 06:26:27 -0500 Received: from mail-qa0-x233.google.com ([2607:f8b0:400d:c00::233]:41770) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VlGmX-0008GR-3u for qemu-devel@nongnu.org; Tue, 26 Nov 2013 06:26:17 -0500 Received: by mail-qa0-f51.google.com with SMTP id o15so8613206qap.3 for ; Tue, 26 Nov 2013 03:26:16 -0800 (PST) Sender: Paolo Bonzini Message-ID: <52948554.2050205@redhat.com> Date: Tue, 26 Nov 2013 12:26:12 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1385025100-3191-1-git-send-email-lilei@linux.vnet.ibm.com> <1385025100-3191-7-git-send-email-lilei@linux.vnet.ibm.com> In-Reply-To: <1385025100-3191-7-git-send-email-lilei@linux.vnet.ibm.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 06/17] migration-local: add send_pipefd() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Lei Li Cc: aarcange@redhat.com, quintela@redhat.com, mdroth@linux.vnet.ibm.com, mrhines@linux.vnet.ibm.com, qemu-devel@nongnu.org, aliguori@amazon.com, lagarcia@br.ibm.com, rcj@linux.vnet.ibm.com Il 21/11/2013 10:11, Lei Li ha scritto: > + struct cmsghdr *cmptr; > + char req[1] = { 0x01 }; About this, see my reply to patch 8. > + if (pipefd < 0) { > + msg.msg_control = NULL; > + msg.msg_controllen = 0; > + /* Negative status means error */ > + req[0] = pipefd; No need for this. qemu_fopen_socket_local has failed already, and you will never get here. Paolo > + } else { > + msg.msg_control = control_un.control; > + msg.msg_controllen = sizeof(control_un.control); > + > + cmptr = CMSG_FIRSTHDR(&msg); > + cmptr->cmsg_len = CMSG_LEN(sizeof(int)); > + cmptr->cmsg_level = SOL_SOCKET; > + cmptr->cmsg_type = SCM_RIGHTS; > + *((int *) CMSG_DATA(cmptr)) = pipefd; > + > + msg.msg_name = NULL; > + msg.msg_namelen = 0; > + > + iov[0].iov_base = req; > + iov[0].iov_len = sizeof(req); > + msg.msg_iov = iov; > + msg.msg_iovlen = 1; > + }