qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 06/17] migration-local: add send_pipefd()


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH 06/17] migration-local: add send_pipefd()
Date: Tue, 26 Nov 2013 12:26:12 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130923 Thunderbird/17.0.9

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




reply via email to

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