aboutsummaryrefslogtreecommitdiff
path: root/savevm.c
diff options
context:
space:
mode:
authorAlex Williamson <alex.williamson@redhat.com>2010-06-25 11:09:07 -0600
committerAnthony Liguori <aliguori@us.ibm.com>2010-07-06 10:36:28 -0500
commit0be71e324f774a77243f1a1487f468232d69542b (patch)
treef3ac4560e61b5874fd359da3ada9bd371c25efc4 /savevm.c
parent4f43c1ff3b8ce99de80db7c51423e5ba8b143802 (diff)
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.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/savevm.c b/savevm.c
index f1f450edc4..d874d089c4 100644
--- a/savevm.c
+++ b/savevm.c
@@ -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;