diff options
| author | Eduardo Habkost | 2017-07-26 20:44:35 +0200 |
|---|---|---|
| committer | Eduardo Habkost | 2017-09-01 16:54:24 +0200 |
| commit | 5ce46cb34eecec0bc94a4b1394763f9a1bbe20c3 (patch) | |
| tree | 7bd400d87bc3fc95068e397bd9f0a947e9e790e8 /include/qom | |
| parent | qom: Remove unused errp parameter from can_be_deleted() (diff) | |
| download | qemu-5ce46cb34eecec0bc94a4b1394763f9a1bbe20c3.tar.gz qemu-5ce46cb34eecec0bc94a4b1394763f9a1bbe20c3.tar.xz qemu-5ce46cb34eecec0bc94a4b1394763f9a1bbe20c3.zip | |
cpu: cpu_by_arch_id() helper
The helper can be used for CPU object lookup using the CPU's
arch-specific ID (the one returned by CPUClass::get_arch_id()).
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
[Yi Wang: Added documentation comments]
Signed-off-by: Yi Wang <wang.yi59@zte.com.cn>
Signed-off-by: Yun Liu <liu.yunh@zte.com.cn>
[ehabkost: extracted cpu_by_arch_id() to a separate patch]
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Diffstat (limited to 'include/qom')
| -rw-r--r-- | include/qom/cpu.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/qom/cpu.h b/include/qom/cpu.h index 25eefea7ab..b7ac9491c8 100644 --- a/include/qom/cpu.h +++ b/include/qom/cpu.h @@ -755,6 +755,16 @@ CPUState *qemu_get_cpu(int index); bool cpu_exists(int64_t id); /** + * cpu_by_arch_id: + * @id: Guest-exposed CPU ID of the CPU to obtain. + * + * Get a CPU with matching @id. + * + * Returns: The CPU or %NULL if there is no matching CPU. + */ +CPUState *cpu_by_arch_id(int64_t id); + +/** * cpu_throttle_set: * @new_throttle_pct: Percent of sleep time. Valid range is 1 to 99. * |
