[libvirt-users] Is there a way to disable libvirt qemu monitor while creating kvm vm using virsh?

Min Du min.du.email at gmail.com
Fri Nov 7 22:28:57 UTC 2014


Now for some reason, I need to add “ -qmp tcp:” when creating a KVM VM using libvirt. This command meaning in “qemu-kvm --help” is: -qmp dev        like -monitor but opens in 'control' mode.
I added command-line equivalent options into the xml file, like below format:

         <qemu:arg value="-s"/>
         <qemu:arg value="-qmp"/>
         <qemu:arg value="tcp:"/>

However when I create VM using this xml file, I got the error:

# virsh create instance-libvirt.xml
error: Failed to create domain from instance-libvirt.xml
error: internal error process exited while connecting to monitor: qemu-kvm: -qmp tcp: Duplicate ID 'monitor' for mon
duplicate chardev: monitor

The VM I created, without “—qmp” option, has below options showing in “ps aux | grep qemu-kvm”:

-chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/vmifs_test.monitor,server,nowait -mon chardev=charmonitor,id=monitor,mode=control

Looks like libvirt automatically adds the monitor options upon VM creation.

Is there a way to disable this and use “—qmp” instead when creating VM?

Thanks for your help.

Best Regards,

More information about the libvirt-users mailing list