mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 08:13:54 -06:00
migration: remove register_savevm()
We can replace the four remaining calls of register_savevm() by calls to register_savevm_live(). So we can remove the function and as we don't allocate anymore the ops pointer with g_new0() we don't have to free it then. Signed-off-by: Laurent Vivier <lvivier@redhat.com> Reviewed-by: Juan Quintela <quintela@redhat.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
parent
199e19ee53
commit
1b6e748246
6 changed files with 25 additions and 32 deletions
|
@ -645,21 +645,6 @@ int register_savevm_live(DeviceState *dev,
|
|||
return 0;
|
||||
}
|
||||
|
||||
int register_savevm(DeviceState *dev,
|
||||
const char *idstr,
|
||||
int instance_id,
|
||||
int version_id,
|
||||
SaveStateHandler *save_state,
|
||||
LoadStateHandler *load_state,
|
||||
void *opaque)
|
||||
{
|
||||
SaveVMHandlers *ops = g_new0(SaveVMHandlers, 1);
|
||||
ops->save_state = save_state;
|
||||
ops->load_state = load_state;
|
||||
return register_savevm_live(dev, idstr, instance_id, version_id,
|
||||
ops, opaque);
|
||||
}
|
||||
|
||||
void unregister_savevm(DeviceState *dev, const char *idstr, void *opaque)
|
||||
{
|
||||
SaveStateEntry *se, *new_se;
|
||||
|
@ -679,7 +664,6 @@ void unregister_savevm(DeviceState *dev, const char *idstr, void *opaque)
|
|||
if (strcmp(se->idstr, id) == 0 && se->opaque == opaque) {
|
||||
QTAILQ_REMOVE(&savevm_state.handlers, se, entry);
|
||||
g_free(se->compat);
|
||||
g_free(se->ops);
|
||||
g_free(se);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue