Skip to content

Commit

Permalink
qmp-commands: move 'query-cpus' doc to schema
Browse files Browse the repository at this point in the history
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
  • Loading branch information
elmarco authored and Markus Armbruster committed Jan 16, 2017
1 parent 60639df commit 5c5bee6
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 46 deletions.
46 changes: 0 additions & 46 deletions docs/qmp-commands.txt
Expand Up @@ -1945,52 +1945,6 @@ Example:
]
}

query-cpus
----------

Show CPU information.

Return a json-array. Each CPU is represented by a json-object, which contains:

- "CPU": CPU index (json-int)
- "current": true if this is the current CPU, false otherwise (json-bool)
- "halted": true if the cpu is halted, false otherwise (json-bool)
- "qom_path": path to the CPU object in the QOM tree (json-str)
- "arch": architecture of the cpu, which determines what additional
keys will be present (json-str)
- Current program counter. The key's name depends on the architecture:
"pc": i386/x86_64 (json-int)
"nip": PPC (json-int)
"pc" and "npc": sparc (json-int)
"PC": mips (json-int)
- "thread_id": ID of the underlying host thread (json-int)

Example:

-> { "execute": "query-cpus" }
<- {
"return":[
{
"CPU":0,
"current":true,
"halted":false,
"qom_path":"/machine/unattached/device[0]",
"arch":"x86",
"pc":3227107138,
"thread_id":3134
},
{
"CPU":1,
"current":false,
"halted":true,
"qom_path":"/machine/unattached/device[2]",
"arch":"x86",
"pc":7108165,
"thread_id":3135
}
]
}

query-iothreads
---------------

Expand Down
26 changes: 26 additions & 0 deletions qapi-schema.json
Expand Up @@ -1331,6 +1331,32 @@
# Returns: a list of @CpuInfo for each virtual CPU
#
# Since: 0.14.0
#
# Example:
#
# -> { "execute": "query-cpus" }
# <- { "return": [
# {
# "CPU":0,
# "current":true,
# "halted":false,
# "qom_path":"/machine/unattached/device[0]",
# "arch":"x86",
# "pc":3227107138,
# "thread_id":3134
# },
# {
# "CPU":1,
# "current":false,
# "halted":true,
# "qom_path":"/machine/unattached/device[2]",
# "arch":"x86",
# "pc":7108165,
# "thread_id":3135
# }
# ]
# }
#
##
{ 'command': 'query-cpus', 'returns': ['CpuInfo'] }

Expand Down

0 comments on commit 5c5bee6

Please sign in to comment.