**作者:张华 发表于:2016-08-11
版权声明:可以任意转载,转载时请务必以超链接形式标明文章原始出处和作者信息及本版权声明
( http://blog.csdn.net/quqi99 )**
1, Capture DEBUG for QEMU & libvirt but only WARN + ERROR for the rest, modify the file /etc/libvirt/libvirtd.conf
log_filters="1:qemu 1:libvirt 3:security 3:event 3:util 3:file"
log_outputs="1:file:/var/log/libvirt/libvirtd.log"
2, To log all libvirt API calls, export:
LIBVIRT_DEBUG=1
LIBVIRT_LOG_FILTERS="1:qemu"
LIBVIRT_LOG_OUTPUTS="1:journald 1:file:virsh.log"
3, sudo service libvirt-bin restart
/var/log/libvirt/qemu/instance-00000002.log
/var/log/libvirt/libvirtd.log
#sudo virsh qemu-monitor-command instance-00000002 --pretty '{"execute":"query-commands"}'
#sudo virsh qemu-monitor-command instance-00000002 --pretty '{"execute":"query-block"}'
sudo virsh qemu-monitor-event instance-00000002 --pretty --loop
#nova live-migrate --block-migrate vm1 $DEST-HOST
#sudo virsh migrate –verbose --copy-storage-inc --p2p --live vm1 qemu+ssh://root@dest/system
$ sudo virsh qemu-monitor-event instance-00000002 --pretty --loop
error: internal error: virsh qemu-monitor-event: no domain VSH_OT_DATA option
event POWERDOWN at 1470898098.552573 for domain instance-00000002: <null>
event NIC_RX_FILTER_CHANGED at 1470898099.457593 for domain instance-00000002: {
"name": "net0",
"path": "/machine/peripheral/net0/virtio-backend"
}
event SHUTDOWN at 1470898100.598173 for domain instance-00000002: <null>
event STOP at 1470898100.600347 for domain instance-00000002: <null>
event SHUTDOWN at 1470898100.601556 for domain instance-00000002: <null>
event RESUME at 1470898102.503793 for domain instance-00000002: <null>
event NIC_RX_FILTER_CHANGED at 1470898122.381443 for domain instance-00000002: {
"name": "net0",
"path": "/machine/peripheral/net0/virtio-backend"
}
**