[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 7/9] Add unregister_savevm()
From: |
Mark McLoughlin |
Subject: |
[Qemu-devel] [PATCH 7/9] Add unregister_savevm() |
Date: |
Wed, 15 Apr 2009 17:29:27 +0100 |
Currently there's no way to unregister a savevm callback, so
e.g. if a NIC is hot-unplugged and a savevm is issued, we'll
segfault.
Signed-off-by: Mark McLoughlin <address@hidden>
---
hw/hw.h | 2 ++
savevm.c | 16 ++++++++++++++++
2 files changed, 18 insertions(+), 0 deletions(-)
diff --git a/hw/hw.h b/hw/hw.h
index e9628d4..d0cf598 100644
--- a/hw/hw.h
+++ b/hw/hw.h
@@ -239,6 +239,8 @@ int register_savevm_live(const char *idstr,
LoadStateHandler *load_state,
void *opaque);
+void unregister_savevm(const char *idstr, void *opaque);
+
typedef void QEMUResetHandler(void *opaque);
void qemu_register_reset(QEMUResetHandler *func, void *opaque);
diff --git a/savevm.c b/savevm.c
index 70500dd..c15db9a 100644
--- a/savevm.c
+++ b/savevm.c
@@ -647,6 +647,22 @@ int register_savevm(const char *idstr,
NULL, save_state, load_state, opaque);
}
+void unregister_savevm(const char *idstr, void *opaque)
+{
+ SaveStateEntry **pse;
+
+ pse = &first_se;
+ while (*pse != NULL) {
+ if (strcmp((*pse)->idstr, idstr) == 0 && (*pse)->opaque == opaque) {
+ SaveStateEntry *next = (*pse)->next;
+ qemu_free(*pse);
+ *pse = next;
+ continue;
+ }
+ pse = &(*pse)->next;
+ }
+}
+
#define QEMU_VM_FILE_MAGIC 0x5145564d
#define QEMU_VM_FILE_VERSION_COMPAT 0x00000002
#define QEMU_VM_FILE_VERSION 0x00000003
--
1.6.0.6
- [Qemu-devel] [PATCH 0/9] Misc networking fixes, Mark McLoughlin, 2009/04/15
- [Qemu-devel] [PATCH 1/9] Remove stray GSO code from virtio_net, Mark McLoughlin, 2009/04/15
- [Qemu-devel] [PATCH 2/9] struct iovec is now universally available, Mark McLoughlin, 2009/04/15
- [Qemu-devel] [PATCH 3/9] Fix error handling in net_client_init(), Mark McLoughlin, 2009/04/15
- [Qemu-devel] [PATCH 4/9] Don't fail PCI hotplug if no NIC model is supplied, Mark McLoughlin, 2009/04/15
- [Qemu-devel] [PATCH 5/9] Remove some useless malloc() checking, Mark McLoughlin, 2009/04/15
- [Qemu-devel] [PATCH 6/9] Remove NICInfo from e1000 and mipsnet state, Mark McLoughlin, 2009/04/15
- [Qemu-devel] [PATCH 7/9] Add unregister_savevm(),
Mark McLoughlin <=
- [Qemu-devel] [PATCH 8/9] Use NICInfo::model for eepro100 savevm ID string, Mark McLoughlin, 2009/04/15
- [Qemu-devel] [PATCH 9/9] Introduce VLANClientState::cleanup(), Mark McLoughlin, 2009/04/15
- [Qemu-devel] Re: [PATCH 9/9] Introduce VLANClientState::cleanup(), Jan Kiszka, 2009/04/15
- Re: [Qemu-devel] Re: [PATCH 9/9] Introduce VLANClientState::cleanup(), Marcelo Tosatti, 2009/04/15
- Re: [Qemu-devel] Re: [PATCH 9/9] Introduce VLANClientState::cleanup(), M. Warner Losh, 2009/04/15
- Re: [Qemu-devel] Re: [PATCH 9/9] Introduce VLANClientState::cleanup(), Mark McLoughlin, 2009/04/16
- [Qemu-devel] [PATCH 09/09 v2] Introduce VLANClientState::cleanup(), Mark McLoughlin, 2009/04/16
- [Qemu-devel] [PATCH 10/09] Free VLANClientState using qemu_free(), Mark McLoughlin, 2009/04/16
- Re: [Qemu-devel] Re: [PATCH 9/9] Introduce VLANClientState::cleanup(), Marcelo Tosatti, 2009/04/16
- Re: [Qemu-devel] Re: [PATCH 9/9] Introduce VLANClientState::cleanup(), Paul Brook, 2009/04/28