From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54389) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XSMGV-0004bG-Nx for qemu-devel@nongnu.org; Fri, 12 Sep 2014 04:31:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XSMGP-00086g-Nk for qemu-devel@nongnu.org; Fri, 12 Sep 2014 04:31:35 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55355) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XSMGP-00086X-FD for qemu-devel@nongnu.org; Fri, 12 Sep 2014 04:31:29 -0400 Date: Fri, 12 Sep 2014 10:31:17 +0200 From: Kevin Wolf Message-ID: <20140912083117.GB5076@noname.redhat.com> References: <1410448769-10495-1-git-send-email-psomas@grnet.gr> <1410448769-10495-3-git-send-email-psomas@grnet.gr> <87sijx1fqx.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87sijx1fqx.fsf@blackfin.pond.sub.org> Subject: Re: [Qemu-devel] [PATCH 2/2] iotests: Send the correct fd in socket_scm_helper List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: synnefo-devel@googlegroups.com, Stratos Psomadakis , qemu-devel@nongnu.org, Stefan Hajnoczi Am 12.09.2014 um 09:04 hat Markus Armbruster geschrieben: > Stratos Psomadakis writes: > > > Make sure to pass the correct fd via SCM_RIGHTS in socket_scm_helper.c > > (i.e. fd_to_send, not socket-fd). > > > > Signed-off-by: Stratos Psomadakis > > Signed-off-by: Dimitris Aragiorgis Thanks, applied to the block branch. (Also thanks to Markus for copying me, would have missed the patch otherwise.) > > tests/qemu-iotests/socket_scm_helper.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/tests/qemu-iotests/socket_scm_helper.c b/tests/qemu-iotests/socket_scm_helper.c > > index 0e2b285..8195983 100644 > > --- a/tests/qemu-iotests/socket_scm_helper.c > > +++ b/tests/qemu-iotests/socket_scm_helper.c > > @@ -52,7 +52,7 @@ static int send_fd(int fd, int fd_to_send) > > cmsg->cmsg_len = CMSG_LEN(sizeof(int)); > > cmsg->cmsg_level = SOL_SOCKET; > > cmsg->cmsg_type = SCM_RIGHTS; > > - memcpy(CMSG_DATA(cmsg), &fd, sizeof(int)); > > + memcpy(CMSG_DATA(cmsg), &fd_to_send, sizeof(int)); > > > > do { > > ret = sendmsg(fd, &msg, 0); > > Ouch. Do you have an idea what's broken without this fix? As far as I can tell, nothing. Test case 045 will send a different file descriptor than it intended to, but the file descriptors aren't used other than checking whether qemu correctly reports their existence, so it doesn't matter. I'm not adding qemu-stable therefore. Please correct me if I'm missing something. Kevin