[libvirt] Need help, how can I access to qemu-monitor with libvirt 0.8.1

Lai Jiangshan laijs at cn.fujitsu.com
Tue Aug 31 09:41:43 UTC 2010


Hi, all

I encounter this problem when I try to send NMI to guest.
I don't know how. I think if I can access to the qemu-monitor, I can
just do this command in the qemu-monitor: "nmi <cpu#>".
But I don't know how to access to qemu-monitor, I think I can
get help here.

I noticed that the guest is started by libvirt with these parameters:
-chardev socket,id=monitor,path=/var/lib/libvirt/qemu/vm~laijs.monitor,server,nowait \
-mon chardev=monitor,mode=control

So I wrote a simple program and tried to access qemu-monitor by accessing the socket
/var/lib/libvirt/qemu/vm~laijs.monitor. It failed, because I don't know how
to send commands with "mode=control", I don't know the protocol for exchanging
data with this file.

(If I start guest with the same parameters as libvirt but using "mode=readline",
I successfully sent commands to qemu-monitor by my simple program, I just
send text commands)

I noticed that libvirt 0.8.3 supports remote protocol and arbitrary qemu commands,
but I did not found any document, how can I use it?

Thanks, Lai,

(I'm not in this email-list:libvir-list at redhat.com, please ensure my email address
in your cc-list when you reply, thanks)





More information about the libvir-list mailing list