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));



-- 
Alexey

Reply via email to