cpu: Introduce get_arch_id() method and override it for X86CPU
commit997395d3888fcde6ce41535a8208d7aa919d824b
authorIgor Mammedov <imammedo@redhat.com>
Tue, 23 Apr 2013 08:29:41 +0000 (23 10:29 +0200)
committerAndreas Färber <afaerber@suse.de>
Wed, 1 May 2013 11:04:18 +0000 (1 13:04 +0200)
tree5e6d2bd054bdb7b1f1914916f97dbdd06a7b3374
parentb8b7456d6ab7edb450ae5ec6473d3cd9a80412f4
cpu: Introduce get_arch_id() method and override it for X86CPU

get_arch_id() adds possibility for generic code to get a guest-visible
CPU ID without accessing CPUArchState.
If derived classes don't override it, it will return cpu_index.

Override it on target-i386 in X86CPU to return the APIC ID.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: liguang <lig.fnst@cn.fujitsu.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
include/qom/cpu.h
qom/cpu.c
target-i386/cpu.c