diff options
author | Alex Williamson <alex.williamson@redhat.com> | 2010-06-25 11:09:07 -0600 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2010-07-06 10:36:28 -0500 |
commit | 0be71e324f774a77243f1a1487f468232d69542b (patch) | |
tree | f3ac4560e61b5874fd359da3ada9bd371c25efc4 /savevm.c | |
parent | 4f43c1ff3b8ce99de80db7c51423e5ba8b143802 (diff) | |
download | qemu-0be71e324f774a77243f1a1487f468232d69542b.tar.gz qemu-0be71e324f774a77243f1a1487f468232d69542b.tar.bz2 qemu-0be71e324f774a77243f1a1487f468232d69542b.zip |
savevm: Add DeviceState param
When available, we'd like to be able to access the DeviceState
when registering a savevm. For buses with a get_dev_path()
function, this will allow us to create more unique savevm
id strings.
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'savevm.c')
-rw-r--r-- | savevm.c | 22 |
1 files changed, 13 insertions, 9 deletions
@@ -1023,7 +1023,8 @@ static int calculate_new_instance_id(const char *idstr) of the system, so instance_id should be removed/replaced. Meanwhile pass -1 as instance_id if you do not already have a clearly distinguishing id for all instances of your device class. */ -int register_savevm_live(const char *idstr, +int register_savevm_live(DeviceState *dev, + const char *idstr, int instance_id, int version_id, SaveSetParamsHandler *set_params, @@ -1055,18 +1056,19 @@ int register_savevm_live(const char *idstr, return 0; } -int register_savevm(const char *idstr, +int register_savevm(DeviceState *dev, + const char *idstr, int instance_id, int version_id, SaveStateHandler *save_state, LoadStateHandler *load_state, void *opaque) { - return register_savevm_live(idstr, instance_id, version_id, + return register_savevm_live(dev, idstr, instance_id, version_id, NULL, NULL, save_state, load_state, opaque); } -void unregister_savevm(const char *idstr, void *opaque) +void unregister_savevm(DeviceState *dev, const char *idstr, void *opaque) { SaveStateEntry *se, *new_se; @@ -1078,7 +1080,7 @@ void unregister_savevm(const char *idstr, void *opaque) } } -int vmstate_register_with_alias_id(int instance_id, +int vmstate_register_with_alias_id(DeviceState *dev, int instance_id, const VMStateDescription *vmsd, void *opaque, int alias_id, int required_for_version) @@ -1109,13 +1111,15 @@ int vmstate_register_with_alias_id(int instance_id, return 0; } -int vmstate_register(int instance_id, const VMStateDescription *vmsd, - void *opaque) +int vmstate_register(DeviceState *dev, int instance_id, + const VMStateDescription *vmsd, void *opaque) { - return vmstate_register_with_alias_id(instance_id, vmsd, opaque, -1, 0); + return vmstate_register_with_alias_id(dev, instance_id, vmsd, + opaque, -1, 0); } -void vmstate_unregister(const VMStateDescription *vmsd, void *opaque) +void vmstate_unregister(DeviceState *dev, const VMStateDescription *vmsd, + void *opaque) { SaveStateEntry *se, *new_se; |