• J
    qemu: Add shortcut for HMP pass through · 2169472a
    Jiri Denemark 提交于
    Currently users who want to use virDomainQemuMonitorCommand() API or
    it's virsh equivalent has to use the same protocol as libvirt uses for
    communication to qemu. Since the protocol is QMP with current qemu and
    HMP much more usable for humans, one ends up typing something like the
    following:
    
        virsh qemu-monitor-command DOM \
    '{"execute":"human-monitor-command","arguments":{"command-line":"info kvm"}}'
    
    which is not a very convenient way of debugging qemu.
    
    This patch introduces --hmp option to qemu-monitor-command, which says
    that the provided command is in HMP. If libvirt uses QMP to talk with
    qemu, the command will automatically be converted into QMP. So the
    example above is simplified to just
    
        virsh qemu-monitor-command --hmp DOM "info kvm"
    
    Also the result is converted from
    
        {"return":"kvm support: enabled\r\n"}
    
    to just plain HMP:
    
        kvm support: enabled
    
    If libvirt talks to qemu in HMP, --hmp flag is obviously a noop.
    2169472a
qemu_monitor_json.c 73.2 KB