qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [qemu-devel]The problem of QMP command getfd.


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [qemu-devel]The problem of QMP command getfd.
Date: Mon, 28 Jan 2013 14:28:56 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

On Mon, Jan 28, 2013 at 03:27:01PM +0800, Li Zhang wrote:
> Hi all,
> 
> I am trying to executing qmp command getfd according to qmp-commands.hx.
> 
> { "execute": "getfd", "arguments": { "fdname": "fd1" } }
> 
> Every time, it returns the error.
> 
> {
>     "error": {
>         "class": "GenericError",
>         "desc": "No file descriptor supplied via SCM_RIGHTS"
>     }
> }
> 
> This error is related with SCM_RIGHTS.
> I don't know about SCM at all.
> 
> Can anyone give some hints about this?

The "getfd" command allows the client to pass a file descriptor to QEMU
and give it a name.  Later that file descriptor can be used by QEMU.

The QMP client must send '{ "execute": "getfd", "arguments": { "fdname":
"fd1" } }' together with SCM_RIGHTS CMSG.  You are getting the error
because you sent the "getfd" command but forgot to include a file
descriptor using SCM_RIGHTS.

SCM_RIGHTS is a feature of UNIX domain sockets.  It allows one process
to pass a file descriptor to another process through the UNIX domain
socket.  See "man 7 unix" and "man 3 cmsg" for details.

Look at monitor.c:qmp_getfd() to understand how this works.  The QEMU
code to receive a passed file descriptor is in
qemu-char.c:unix_process_msgfd().

Stefan



reply via email to

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