mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 00:33:55 -06:00
savevm: split save_live into stage2 and stage3
We split it into 2 functions, foo_live_iterate, and foo_live_complete. At this point, we only remove the bits that are for the other stage, functionally this is equivalent to previous code. Signed-off-by: Juan Quintela <quintela@redhat.com>
This commit is contained in:
parent
d1315aac6e
commit
16310a3cca
4 changed files with 128 additions and 68 deletions
10
savevm.c
10
savevm.c
|
@ -1236,7 +1236,7 @@ int register_savevm_live(DeviceState *dev,
|
|||
se->vmsd = NULL;
|
||||
se->no_migrate = 0;
|
||||
/* if this is a live_savem then set is_ram */
|
||||
if (ops->save_live_state != NULL) {
|
||||
if (ops->save_live_setup != NULL) {
|
||||
se->is_ram = 1;
|
||||
}
|
||||
|
||||
|
@ -1620,7 +1620,7 @@ int qemu_savevm_state_iterate(QEMUFile *f)
|
|||
int ret = 1;
|
||||
|
||||
QTAILQ_FOREACH(se, &savevm_handlers, entry) {
|
||||
if (!se->ops || !se->ops->save_live_state) {
|
||||
if (!se->ops || !se->ops->save_live_iterate) {
|
||||
continue;
|
||||
}
|
||||
if (se->ops && se->ops->is_active) {
|
||||
|
@ -1636,7 +1636,7 @@ int qemu_savevm_state_iterate(QEMUFile *f)
|
|||
qemu_put_byte(f, QEMU_VM_SECTION_PART);
|
||||
qemu_put_be32(f, se->section_id);
|
||||
|
||||
ret = se->ops->save_live_state(f, QEMU_VM_SECTION_PART, se->opaque);
|
||||
ret = se->ops->save_live_iterate(f, se->opaque);
|
||||
trace_savevm_section_end(se->section_id);
|
||||
|
||||
if (ret <= 0) {
|
||||
|
@ -1665,7 +1665,7 @@ int qemu_savevm_state_complete(QEMUFile *f)
|
|||
cpu_synchronize_all_states();
|
||||
|
||||
QTAILQ_FOREACH(se, &savevm_handlers, entry) {
|
||||
if (!se->ops || !se->ops->save_live_state) {
|
||||
if (!se->ops || !se->ops->save_live_complete) {
|
||||
continue;
|
||||
}
|
||||
if (se->ops && se->ops->is_active) {
|
||||
|
@ -1678,7 +1678,7 @@ int qemu_savevm_state_complete(QEMUFile *f)
|
|||
qemu_put_byte(f, QEMU_VM_SECTION_END);
|
||||
qemu_put_be32(f, se->section_id);
|
||||
|
||||
ret = se->ops->save_live_state(f, QEMU_VM_SECTION_END, se->opaque);
|
||||
ret = se->ops->save_live_complete(f, se->opaque);
|
||||
trace_savevm_section_end(se->section_id);
|
||||
if (ret < 0) {
|
||||
return ret;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue