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


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.