mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 08:13:54 -06:00
migration: introduce SaveVMHandlers.resume_prepare
This is hook function to be called when a postcopy migration wants to resume from a failure. For each module, it should provide its own recovery logic before we switch to the postcopy-active state. Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Signed-off-by: Peter Xu <peterx@redhat.com> Message-Id: <20180502104740.12123-16-peterx@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
This commit is contained in:
parent
13955b89ce
commit
d1b8eadbc4
5 changed files with 48 additions and 1 deletions
|
@ -1031,6 +1031,31 @@ void qemu_savevm_state_setup(QEMUFile *f)
|
|||
}
|
||||
}
|
||||
|
||||
int qemu_savevm_state_resume_prepare(MigrationState *s)
|
||||
{
|
||||
SaveStateEntry *se;
|
||||
int ret;
|
||||
|
||||
trace_savevm_state_resume_prepare();
|
||||
|
||||
QTAILQ_FOREACH(se, &savevm_state.handlers, entry) {
|
||||
if (!se->ops || !se->ops->resume_prepare) {
|
||||
continue;
|
||||
}
|
||||
if (se->ops && se->ops->is_active) {
|
||||
if (!se->ops->is_active(se->opaque)) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
ret = se->ops->resume_prepare(s, se->opaque);
|
||||
if (ret < 0) {
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* this function has three return values:
|
||||
* negative: there was one error, and we have -errno.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue