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 <aligu...@us.ibm.com> --- 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