[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 08/26] vmstate: add sensible arguments to vmstate_un
From: |
Juan Quintela |
Subject: |
[Qemu-devel] [PATCH 08/26] vmstate: add sensible arguments to vmstate_unregister() |
Date: |
Thu, 10 Sep 2009 03:04:29 +0200 |
vmsd alone is not enugh, because we can have several structs saved with the
same description (vmsd).
Signed-off-by: Juan Quintela <address@hidden>
---
hw/hw.h | 2 +-
savevm.c | 11 +++++++++--
2 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/hw/hw.h b/hw/hw.h
index a0cb94e..c703975 100644
--- a/hw/hw.h
+++ b/hw/hw.h
@@ -509,5 +509,5 @@ extern void vmstate_save_state(QEMUFile *f, const
VMStateDescription *vmsd,
const void *opaque);
extern int vmstate_register(int instance_id, const VMStateDescription *vmsd,
void *base);
-extern void vmstate_unregister(const char *idstr, void *opaque);
+void vmstate_unregister(const VMStateDescription *vmsd, void *opaque);
#endif
diff --git a/savevm.c b/savevm.c
index 0dcab79..7b0989f 100644
--- a/savevm.c
+++ b/savevm.c
@@ -1002,9 +1002,16 @@ int vmstate_register(int instance_id, const
VMStateDescription *vmsd,
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,
--
1.6.2.5
- [Qemu-devel] Re: [PATCH 05/26] Unexport ticks_per_sec variable. Create get_ticks_per_sec() function, (continued)
[Qemu-devel] Re: [PATCH 05/26] Unexport ticks_per_sec variable. Create get_ticks_per_sec() function, Jan Kiszka, 2009/09/11
[Qemu-devel] [PATCH 07/26] timers: move them to VMState, Juan Quintela, 2009/09/09
[Qemu-devel] [PATCH 08/26] vmstate: add sensible arguments to vmstate_unregister(),
Juan Quintela <=
[Qemu-devel] [PATCH 09/26] vmstate: rename run_after_load() -> post_load(), Juan Quintela, 2009/09/09
[Qemu-devel] [PATCH 10/26] vmstate: Add pre_load() hook, Juan Quintela, 2009/09/09
[Qemu-devel] [PATCH 11/26] vmstate: Add pre/post_save() hooks, Juan Quintela, 2009/09/09
[Qemu-devel] [PATCH 12/26] vmstate: port cpu_comon, Juan Quintela, 2009/09/09
[Qemu-devel] [PATCH 14/26] vmstate: port i8259 device, Juan Quintela, 2009/09/09
[Qemu-devel] [PATCH 13/26] vmstate: port fw_cfg device, Juan Quintela, 2009/09/09
[Qemu-devel] [PATCH 15/26] vmstate: add support for uint8_t equal, Juan Quintela, 2009/09/09
[Qemu-devel] [PATCH 17/26] vmstate: add support for arrays of uint16_t, Juan Quintela, 2009/09/09
[Qemu-devel] [PATCH 16/26] vmstate: port fdc device, Juan Quintela, 2009/09/09
[Qemu-devel] [PATCH 18/26] vmstate: port dma device, Juan Quintela, 2009/09/09