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

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@redhat.com, please ensure my email address in your cc-list when you reply, thanks)

On 08/31/2010 03:41 AM, Lai Jiangshan wrote:
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.
The only way to do this with libvirt 0.8.1 is to write a wrapper script which adds arguments and invokes the real qemu, then point libvirt to the location of the wrapper instead of the real qemu. Not the most trivial task.
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?
That's different than the 0.8.1 of your subject line. Yes, 0.8.3 makes it easier to add additional arbitrary arguments to the qemu command line via your XML file. The list archives has several examples of this; most recently: https://www.redhat.com/archives/libvir-list/2010-August/msg00589.html -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org

On 08/31/2010 09:55 PM, Eric Blake wrote:
On 08/31/2010 03:41 AM, Lai Jiangshan wrote:
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.
The only way to do this with libvirt 0.8.1 is to write a wrapper script which adds arguments and invokes the real qemu, then point libvirt to the location of the wrapper instead of the real qemu. Not the most trivial task.
Does this way breaks libvirt? libvirt also uses the qemu-monitor If I change the arguments for monitor, I think it will break libvirt. what I want to do is sending some commands to qemu-monitor, I don't want to change existed things.
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?
That's different than the 0.8.1 of your subject line. Yes, 0.8.3 makes it easier to add additional arbitrary arguments to the qemu command line via your XML file. The list archives has several examples of this; most recently:
https://www.redhat.com/archives/libvir-list/2010-August/msg00589.html
Another question, how can I use the remote protocol(arbitrary qemu monitor commands)? Thanks, Lai.
participants (2)
-
Eric Blake
-
Lai Jiangshan