Hide Forgot
Description of problem: Several monitor commands rely on the monitor current CPU. eg, 'info registers'. The current CPU is changed by running 'cpu NN'. Doing this works fine in a traditional HMP monitor, but fails if doing it via QMP with HMP passthrough. eg # virsh start f14i686 Domain f14i686 started # virsh qemu-monitor-command --hmp f14i686 'info cpus' * CPU #0: pc=0x00000000000fe4e4 thread_id=2828 CPU #1: pc=0x00000000000ff0a2 (halted) thread_id=2828 CPU #2: pc=0x00000000000ff0a2 (halted) thread_id=2828 CPU #3: pc=0x00000000000ff0a2 (halted) thread_id=2828 # virsh qemu-monitor-command --hmp f14i686 'cpu 2' # virsh qemu-monitor-command --hmp f14i686 'info cpus' * CPU #0: pc=0x00000000c06669ea thread_id=2828 CPU #1: pc=0x00000000c042849b (halted) thread_id=2828 CPU #2: pc=0x00000000c042849b (halted) thread_id=2828 CPU #3: pc=0x00000000c042849b (halted) thread_id=2828 In this example the '*' should have moved to CPU #2. This is a big problem, because being able to run 'info registers' and similar commands via HMP passthrough is critical for troubleshooting / debugging running QEMU instances under libvirt Version-Release number of selected component (if applicable): qemu-kvm-0.12.1.2-2.180.el6 How reproducible: Always Steps to Reproduce: 1. See above example, or alternatively: $ qemu-kvm -cdrom ~/boot.iso -qmp stdio -smp 4 {"QMP": {"version": {"qemu": {"micro": 50, "minor": 15, "major": 0}, "package": ""}, "capabilities": []}} {"execute":"qmp_capabilities"} {"return": {}} {"execute":"human-monitor-command","arguments":{"command-line":"info cpus"}} {"return": "* CPU #0: pc=0x000000000010017c (halted) thread_id=2570 \r\n CPU #1: pc=0x00000000000ff0a2 (halted) thread_id=2570 \r\n CPU #2: pc=0x00000000000ff0a2 (halted) thread_id=2570 \r\n CPU #3: pc=0x00000000000ff0a2 (halted) thread_id=2570 \r\n"} {"execute":"human-monitor-command","arguments":{"command-line":"cpu 2"}} {"return": {}} {"execute":"human-monitor-command","arguments":{"command-line":"info cpus"}} {"return": "* CPU #0: pc=0x000000000010017c (halted) thread_id=2570 \r\n CPU #1: pc=0x00000000000ff0a2 (halted) thread_id=2570 \r\n CPU #2: pc=0x00000000000ff0a2 (halted) thread_id=2570 \r\n CPU #3: pc=0x00000000000ff0a2 (halted) thread_id=2570 \r\n"} Notice the '*' did not update to CPU #2.
Created attachment 520998 [details] Fix HMP passthrough to honour current monitor CPU This patch is against QEMU GIT master, but can almost certainly be re-diffed to RHEL-6 trees without much (if any) difficulty
Luiz, can you please follow up Daniel's patch?
Daniel, as discussed on qemu-devel, you can use the "cpu-index" argument for the passthrough command. Does it solve the issue for you?
I believe this has been settled already in the following upstream thread: http://lists.gnu.org/archive/html/qemu-devel/2011-09/msg00064.html Closing as not a bug.