diff options
author | Juan Quintela <quintela@redhat.com> | 2012-07-17 17:02:24 +0200 |
---|---|---|
committer | Juan Quintela <quintela@redhat.com> | 2012-10-17 18:34:58 +0200 |
commit | 5a17077529f7feec559e1881792e89554c2ae5b6 (patch) | |
tree | 0c1ea09927e8ee151588a44bb38e379b78b72279 | |
parent | 2c52ddf1cb3057bc2c6ae256857077627f6da43a (diff) | |
download | qemu-5a17077529f7feec559e1881792e89554c2ae5b6.zip qemu-5a17077529f7feec559e1881792e89554c2ae5b6.tar.gz qemu-5a17077529f7feec559e1881792e89554c2ae5b6.tar.bz2 |
savevm: Factorize ram globals reset in its own function
Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Orit Wasserman <owasserm@redhat.com>
-rw-r--r-- | arch_init.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/arch_init.c b/arch_init.c index 3fddb38..6b9f949 100644 --- a/arch_init.c +++ b/arch_init.c @@ -481,6 +481,14 @@ static void ram_migration_cancel(void *opaque) migration_end(); } + +static void reset_ram_globals(void) +{ + last_block = NULL; + last_offset = 0; + sort_ram_list(); +} + #define MAX_WAIT 50 /* ms, half buffered_file limit */ static int ram_save_setup(QEMUFile *f, void *opaque) @@ -489,9 +497,7 @@ static int ram_save_setup(QEMUFile *f, void *opaque) RAMBlock *block; bytes_transferred = 0; - last_block = NULL; - last_offset = 0; - sort_ram_list(); + reset_ram_globals(); if (migrate_use_xbzrle()) { XBZRLE.cache = cache_init(migrate_xbzrle_cache_size() / |