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;
> + }