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:
Andreas Färber 2013-01-20 20:23:22 +01:00
parent c71c3e99b8
commit b170fce3dd
2 changed files with 12 additions and 2 deletions

View file

@ -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;