mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 07:43:54 -06:00
cpu: Register VMStateDescription through CPUState
In comparison to DeviceClass::vmsd, CPU VMState is split in two, "cpu_common" and "cpu", and uses cpu_index as instance_id instead of -1. Therefore add a CPU-specific CPUClass::vmsd field. Unlike the legacy CPUArchState registration, rather register CPUState. Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de> Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
This commit is contained in:
parent
c71c3e99b8
commit
b170fce3dd
2 changed files with 12 additions and 2 deletions
|
@ -44,6 +44,7 @@ typedef struct CPUState CPUState;
|
|||
* @class_by_name: Callback to map -cpu command line model name to an
|
||||
* instantiatable CPU type.
|
||||
* @reset: Callback to reset the #CPUState to its initial state.
|
||||
* @vmsd: State description for migration.
|
||||
*
|
||||
* Represents a CPU family or model.
|
||||
*/
|
||||
|
@ -55,6 +56,8 @@ typedef struct CPUClass {
|
|||
ObjectClass *(*class_by_name)(const char *cpu_model);
|
||||
|
||||
void (*reset)(CPUState *cpu);
|
||||
|
||||
const struct VMStateDescription *vmsd;
|
||||
} CPUClass;
|
||||
|
||||
struct KVMState;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue