aboutsummaryrefslogtreecommitdiff
path: root/tests/test-vmstate.c
diff options
context:
space:
mode:
authorDr. David Alan Gilbert <dgilbert@redhat.com>2017-02-03 16:06:49 +0000
committerDr. David Alan Gilbert <dgilbert@redhat.com>2017-02-13 17:27:14 +0000
commitbcf45131293664118355df03d2ce5458156deaad (patch)
tree76da0209b74a753d4cabed500f7a9689358da85d /tests/test-vmstate.c
parentb5b5c569570c414bf0aa80a5ae9480debe07ed58 (diff)
migration: Add VMSTATE_WITH_TMP
VMSTATE_WITH_TMP is for handling structures where some calculation or rearrangement of the data needs to be performed before the data hits the wire. For example, where the value on the wire is an offset from a non-migrated base, but the data in the structure is the actual pointer. To use it, a temporary type is created and a vmsd used on that type. The first element of the type must be 'parent' a pointer back to the type of the main structure. VMSTATE_WITH_TMP takes care of allocating and freeing the temporary before running the child vmsd. The post_load/pre_save on the child vmsd can copy things from the parent to the temporary using the parent pointer and do any other calculations needed; it can then use normal VMSD entries to do the actual data storage without having to fiddle around with qemu_get_*/qemu_put_* Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Reviewed-by: Juan Quintela <quintela@redhat.com> Message-Id: <20170203160651.19917-3-dgilbert@redhat.com> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Diffstat (limited to 'tests/test-vmstate.c')
0 files changed, 0 insertions, 0 deletions