[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 1/9] savevm: don't rely on paths if we can store a D
From: |
Anthony Liguori |
Subject: |
[Qemu-devel] [PATCH 1/9] savevm: don't rely on paths if we can store a DeviceState object |
Date: |
Sun, 26 Aug 2012 10:51:30 -0500 |
Paths break during tear down which can result in odd behavior since we do path
based lookup during unregister (which happens at tear down).
For devices, just store the DeviceState directly and use that.
Signed-off-by: Anthony Liguori <address@hidden>
---
savevm.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/savevm.c b/savevm.c
index c7fe283..bb6494b 100644
--- a/savevm.c
+++ b/savevm.c
@@ -1177,6 +1177,7 @@ typedef struct SaveStateEntry {
CompatEntry *compat;
int no_migrate;
int is_ram;
+ DeviceState *dev;
} SaveStateEntry;
@@ -1235,6 +1236,7 @@ int register_savevm_live(DeviceState *dev,
se->opaque = opaque;
se->vmsd = NULL;
se->no_migrate = 0;
+ se->dev = dev;
/* if this is a live_savem then set is_ram */
if (ops->save_live_setup != NULL) {
se->is_ram = 1;
@@ -1298,7 +1300,8 @@ void unregister_savevm(DeviceState *dev, const char
*idstr, void *opaque)
pstrcat(id, sizeof(id), idstr);
QTAILQ_FOREACH_SAFE(se, &savevm_handlers, entry, new_se) {
- if (strcmp(se->idstr, id) == 0 && se->opaque == opaque) {
+ if ((dev && se->dev == dev) ||
+ (strcmp(se->idstr, id) == 0 && se->opaque == opaque)) {
QTAILQ_REMOVE(&savevm_handlers, se, entry);
if (se->compat) {
g_free(se->compat);
--
1.7.5.4
- [Qemu-devel] [RFC PATCH 0/9] qom: improve reference counting and hotplug, Anthony Liguori, 2012/08/26
- [Qemu-devel] [PATCH 1/9] savevm: don't rely on paths if we can store a DeviceState object,
Anthony Liguori <=
- [Qemu-devel] [PATCH 6/9] qdev: make devices created with device_add nullable so they can be deleted, Anthony Liguori, 2012/08/26
- [Qemu-devel] [PATCH 4/9] object: remove object_finalize, Anthony Liguori, 2012/08/26
- [Qemu-devel] [PATCH 7/9] qdev: add notifier for when the device loses its parent bus (eject), Anthony Liguori, 2012/08/26
- [Qemu-devel] [PATCH 2/9] object: automatically free objects based on a release function, Anthony Liguori, 2012/08/26
- [Qemu-devel] [PATCH 8/9] qdev: make qdev_set_parent_bus() just set a link property, Anthony Liguori, 2012/08/26