On 9/9/24 12:00 PM, DUO Labs wrote:
> I'm trying to write an application that interacts with a running QEMU instance
> to create drives from shared memory. I'm on a macOS host, so I can't just do
> something like `/dev/shm/<id>`, or `/proc/<fd>/fd/<num>`. So, is there a way
> to
> send the fd to the QEMU instance? If it helps, the QMP socket is exposed as a
> UNIX socket.
>
I don't understand your question.
May I assume you would like to pass a fd to QEMU so that QEMU may
read/write/ioctl with the fd?
I suggest QMP getfd command.
Combined with SCM_RIGHTS, you will be able to send the getfd command to a
running QEMU instance, with the fd in the message.
For instance, you may create a vhostfd, and send to QEMU via getfd.
Dongli Zhang