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.
Bug 735084 - HMP passthrough command processing does not honour the monitor current CPU
Summary: HMP passthrough command processing does not honour the monitor current CPU
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: qemu-kvm
Version: 6.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Luiz Capitulino
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-09-01 11:52 UTC by Daniel Berrangé
Modified: 2013-01-10 00:16 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-09-27 14:04:09 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Fix HMP passthrough to honour current monitor CPU (3.06 KB, patch)
2011-09-01 11:58 UTC, Daniel Berrangé
no flags Details | Diff

Description Daniel Berrangé 2011-09-01 11:52:18 UTC
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.

Comment 1 Daniel Berrangé 2011-09-01 11:58:59 UTC
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

Comment 2 Dor Laor 2011-09-12 07:06:25 UTC
Luiz, can you please follow up Daniel's patch?

Comment 3 Luiz Capitulino 2011-09-12 13:12:53 UTC
Daniel, as discussed on qemu-devel, you can use the "cpu-index" argument for the passthrough command.

Does it solve the issue for you?

Comment 4 Luiz Capitulino 2011-09-27 14:04:09 UTC
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.


Note You need to log in before you can comment on or make changes to this bug.