Qemu.monitor ,any tools to talk to it directly?

like socat or curl ?

thanks .

That won’t work, Incus is always connected to that socket and the socket isn’t multi-threaded. In general, you really shouldn’t directly try to connect to anything in there.

# qemu [...] -qmp unix:./qmp-sock,server,wait=off
# qmp-shell ./qmp-sock

I guess incus also use qmp protocol , rt ? what is the difference with qmp socket and monitor socket .

thanks stgraber

qemu.monitor is a control mode server endpoint using the socket backend chardev backend (non-blocking, single connection).

Incus always keeps a connection to that and uses it to send/receive QMP JSON messages.

1 Like

What I do when debugging QEMU instances over their monitor is that I declare a second monitor in QEMU, then connect to it with socat. On my setup, I need to add an apparmor exception for the monitor:

raw.apparmor: /tmp/monitor rw,
raw.qemu: -qmp unix:/tmp/monitor,server,nowait

The socat connection is simply a matter of socat - unix-connect:/tmp/monitor, then a capability negotiation by sending to the monitor {"execute": "qmp_capabilities"}.

If you’re not doing any kind of low-level development on the QEMU driver in Incus, I strongly advise against talking to the monitor, as you can break things in lots of non-trivial ways (and we probably won’t be giving any support here :slight_smile:).

1 Like

Great idea , thank you so much Benjamin. I just have some interest about how it works :slight_smile: