From 811814bd2859ff272320f0c5765b0605f90ce7b3 Mon Sep 17 00:00:00 2001 From: Juan Quintela Date: Mon, 26 Jul 2010 21:38:43 +0200 Subject: 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 Signed-off-by: Anthony Liguori --- hw/hw.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'hw') diff --git a/hw/hw.h b/hw/hw.h index c2de6fe..e3c3db2 100644 --- a/hw/hw.h +++ b/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; -- cgit v1.1