summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorJuan Quintela <quintela@redhat.com>2010-07-26 21:38:43 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2010-07-26 16:19:51 -0500
commit811814bd2859ff272320f0c5765b0605f90ce7b3 (patch)
tree375e788793249a501508d3084a881da4d139befc /hw
parent57338424aa6808c65b85c43ec66f9c88a01c559e (diff)
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>
Diffstat (limited to 'hw')
-rw-r--r--hw/hw.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/hw/hw.h b/hw/hw.h
index c2de6fe8c..e3c3db27f 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;