mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-08 10:13:56 -06:00
vmstate: add subsections code
This commit adds subsections for each device section. Subsections is the way to handle information that don't need to be sent to de destination of a migration because its values are not needed. It is the way to handle optional information. Notice that only the source can decide if the information is optional or not. The destination needs to understand all subsections that it receives to have a sucessful load. Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
57338424aa
commit
811814bd28
2 changed files with 91 additions and 1 deletions
6
hw/hw.h
6
hw/hw.h
|
@ -313,6 +313,11 @@ typedef struct {
|
|||
bool (*field_exists)(void *opaque, int version_id);
|
||||
} VMStateField;
|
||||
|
||||
typedef struct VMStateSubsection {
|
||||
const VMStateDescription *vmsd;
|
||||
bool (*needed)(void *opaque);
|
||||
} VMStateSubsection;
|
||||
|
||||
struct VMStateDescription {
|
||||
const char *name;
|
||||
int version_id;
|
||||
|
@ -323,6 +328,7 @@ struct VMStateDescription {
|
|||
int (*post_load)(void *opaque, int version_id);
|
||||
void (*pre_save)(void *opaque);
|
||||
VMStateField *fields;
|
||||
const VMStateSubsection *subsections;
|
||||
};
|
||||
|
||||
extern const VMStateInfo vmstate_info_int8;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue