mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-07 09:43:56 -06:00
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>
This commit is contained in:
parent
4f43c1ff3b
commit
0be71e324f
85 changed files with 163 additions and 138 deletions
22
savevm.c
22
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;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue