From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56865) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WJQin-0007m6-4Y for qemu-devel@nongnu.org; Fri, 28 Feb 2014 11:55:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WJQig-0003No-RJ for qemu-devel@nongnu.org; Fri, 28 Feb 2014 11:55:36 -0500 Received: from mx1.redhat.com ([209.132.183.28]:36615) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WJQig-0003Mm-JW for qemu-devel@nongnu.org; Fri, 28 Feb 2014 11:55:30 -0500 Date: Fri, 28 Feb 2014 17:55:26 +0100 From: Stefan Hajnoczi Message-ID: <20140228165526.GA28466@stefanha-thinkpad.redhat.com> References: <53100AF8.8080409@ozlabs.ru> <20140228102731.GC30385@stefanha-thinkpad.redhat.com> <53106549.2050208@ozlabs.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <53106549.2050208@ozlabs.ru> Subject: Re: [Qemu-devel] migrate to fd - how to use with HMP? List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexey Kardashevskiy Cc: "qemu-devel@nongnu.org" On Fri, Feb 28, 2014 at 09:30:33PM +1100, Alexey Kardashevskiy wrote: > On 02/28/2014 09:27 PM, Stefan Hajnoczi wrote: > > On Fri, Feb 28, 2014 at 03:05:12PM +1100, Alexey Kardashevskiy wrote: > >> However once socket_scm_helper talked to "mon" (./qemu.monitor), I cannot > >> get any response from it via "socat UNIX-CONNECT:./qemu.monitor STDIN". > > > > Have you tried with QMP? Perhaps the HMP monitor handles > > connect/disconnect differently from the QMP monitor. > > > > I guess this will require more step-by-step debugging of monitor.c to > > find out what's going on. > > > One of my questions is still unanswered :) Is socket_scm_helper assumed to > be correct or it is a bug? Because if it is correct, I do not know what to > think. Thanks. > > > 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)); Don't assume the 045 test or socket_scm_helper is correct. Your patch makes sense. Please post it to qemu-devel. Stefan