vmstate: add sensible arguments to vmstate_unregister()
vmsd alone is not enugh, because we can have several structs saved with the same description (vmsd). Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
274dfed8ba
commit
1eb7538b77
2
hw/hw.h
2
hw/hw.h
@ -509,5 +509,5 @@ extern void vmstate_save_state(QEMUFile *f, const VMStateDescription *vmsd,
|
|||||||
const void *opaque);
|
const void *opaque);
|
||||||
extern int vmstate_register(int instance_id, const VMStateDescription *vmsd,
|
extern int vmstate_register(int instance_id, const VMStateDescription *vmsd,
|
||||||
void *base);
|
void *base);
|
||||||
extern void vmstate_unregister(const char *idstr, void *opaque);
|
void vmstate_unregister(const VMStateDescription *vmsd, void *opaque);
|
||||||
#endif
|
#endif
|
||||||
|
11
savevm.c
11
savevm.c
@ -1002,9 +1002,16 @@ int vmstate_register(int instance_id, const VMStateDescription *vmsd,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void vmstate_unregister(const char *idstr, void *opaque)
|
void vmstate_unregister(const VMStateDescription *vmsd, void *opaque)
|
||||||
{
|
{
|
||||||
unregister_savevm(idstr, opaque);
|
SaveStateEntry *se, *new_se;
|
||||||
|
|
||||||
|
TAILQ_FOREACH_SAFE(se, &savevm_handlers, entry, new_se) {
|
||||||
|
if (se->vmsd == vmsd && se->opaque == opaque) {
|
||||||
|
TAILQ_REMOVE(&savevm_handlers, se, entry);
|
||||||
|
qemu_free(se);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int vmstate_load_state(QEMUFile *f, const VMStateDescription *vmsd,
|
int vmstate_load_state(QEMUFile *f, const VMStateDescription *vmsd,
|
||||||
|
Loading…
Reference in New Issue
Block a user