diff options
author | Jan Kiszka <jan.kiszka@siemens.com> | 2010-05-15 13:32:40 +0200 |
---|---|---|
committer | Blue Swirl <blauwirbel@gmail.com> | 2010-05-15 14:23:31 +0000 |
commit | 4d2ffa08b601bdd40d9ccf225480c0a7e90ca078 (patch) | |
tree | c58243f040336217efae96032a3fb666d5bcae98 /hw/hw.h | |
parent | ec86f3e1af558a9a6f8476b9c1903cb6f152b771 (diff) |
vmstate: Add support for alias ID
Some legacy users (mostly PC devices) of vmstate_register manage
instance IDs on their own, and that unfortunately in a way that is
incompatible with automatically generated ones. This so far prevents
switching those users to vmstates that are registered by qdev.
To establish a migration path, this patch introduces the concept of
alias IDs. They can be passed to an extended vmstate registration
service, and qdev provides a set service to be used during device init.
find_se will consider the alias in addition to the default ID. We can
then start generating the default ID automatically and writing it on
vmsave, thus converting that format without breaking support for upward
migration.
The user is required specify the highest vmstate version for which the
alias is required. Once this version falls behind the minimum required
for a specific vmstate, an assertion triggers to motivate cleaning up
the obsolete alias.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'hw/hw.h')
-rw-r--r-- | hw/hw.h | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -758,5 +758,9 @@ extern void vmstate_save_state(QEMUFile *f, const VMStateDescription *vmsd, void *opaque); extern int vmstate_register(int instance_id, const VMStateDescription *vmsd, void *base); +extern int vmstate_register_with_alias_id(int instance_id, + const VMStateDescription *vmsd, + void *base, int alias_id, + int required_for_version); void vmstate_unregister(const VMStateDescription *vmsd, void *opaque); #endif |