Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
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
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.