mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 15:23:53 -06:00
savevm: Refactor cancel operation in its own operation
Intead of abusing stage with value -1. Signed-off-by: Juan Quintela <quintela@redhat.com>
This commit is contained in:
parent
226aa6a9b1
commit
9b5bfab05f
4 changed files with 15 additions and 11 deletions
11
arch_init.c
11
arch_init.c
|
@ -296,6 +296,11 @@ static void migration_end(void)
|
|||
memory_global_dirty_log_stop();
|
||||
}
|
||||
|
||||
static void ram_migration_cancel(void *opaque)
|
||||
{
|
||||
migration_end();
|
||||
}
|
||||
|
||||
#define MAX_WAIT 50 /* ms, half buffered_file limit */
|
||||
|
||||
static int ram_save_live(QEMUFile *f, int stage, void *opaque)
|
||||
|
@ -306,11 +311,6 @@ static int ram_save_live(QEMUFile *f, int stage, void *opaque)
|
|||
int ret;
|
||||
int i;
|
||||
|
||||
if (stage < 0) {
|
||||
migration_end();
|
||||
return 0;
|
||||
}
|
||||
|
||||
memory_global_sync_dirty_bitmap(get_system_memory());
|
||||
|
||||
if (stage == 1) {
|
||||
|
@ -537,6 +537,7 @@ done:
|
|||
SaveVMHandlers savevm_ram_handlers = {
|
||||
.save_live_state = ram_save_live,
|
||||
.load_state = ram_load,
|
||||
.cancel = ram_migration_cancel,
|
||||
};
|
||||
|
||||
#ifdef HAS_AUDIO
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue