[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 12/41] arch_init: factor out setting last_block,
From: |
Isaku Yamahata |
Subject: |
[Qemu-devel] [PATCH v2 12/41] arch_init: factor out setting last_block, last_offset |
Date: |
Mon, 4 Jun 2012 18:57:14 +0900 |
Signed-off-by: Isaku Yamahata <address@hidden>
---
arch_init.c | 13 ++++++++-----
arch_init.h | 1 +
2 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/arch_init.c b/arch_init.c
index 2617478..22d9691 100644
--- a/arch_init.c
+++ b/arch_init.c
@@ -203,6 +203,12 @@ int ram_save_page(QEMUFile *f, RAMBlock *block, ram_addr_t
offset)
static RAMBlock *last_block;
static ram_addr_t last_offset;
+void ram_save_set_last_block(RAMBlock *block, ram_addr_t offset)
+{
+ last_block = block;
+ last_offset = offset;
+}
+
int ram_save_block(QEMUFile *f)
{
RAMBlock *block = last_block;
@@ -230,9 +236,7 @@ int ram_save_block(QEMUFile *f)
}
} while (block != last_block || offset != last_offset);
- last_block = block;
- last_offset = offset;
-
+ ram_save_set_last_block(block, offset);
return bytes_sent;
}
@@ -349,8 +353,7 @@ int ram_save_live(QEMUFile *f, int stage, void *opaque)
if (stage == 1) {
bytes_transferred = 0;
last_block_sent = NULL;
- last_block = NULL;
- last_offset = 0;
+ ram_save_set_last_block(NULL, 0);
sort_ram_list();
/* Make sure all dirty bits are set */
diff --git a/arch_init.h b/arch_init.h
index 7f5c77a..15548cd 100644
--- a/arch_init.h
+++ b/arch_init.h
@@ -40,6 +40,7 @@ int xen_available(void);
#define RAM_SAVE_VERSION_ID 4 /* currently version 4 */
#if defined(NEED_CPU_H) && !defined(CONFIG_USER_ONLY)
+void ram_save_set_last_block(RAMBlock *block, ram_addr_t offset);
int ram_save_page(QEMUFile *f, RAMBlock *block, ram_addr_t offset);
RAMBlock *ram_find_block(const char *id, uint8_t len);
void *ram_load_host_from_stream_offset(QEMUFile *f,
--
1.7.1.1
- [Qemu-devel] [PATCH v2 10/41] arch_init: simplify a bit by ram_find_block(), (continued)
- [Qemu-devel] [PATCH v2 10/41] arch_init: simplify a bit by ram_find_block(), Isaku Yamahata, 2012/06/04
- [Qemu-devel] [PATCH v2 34/41] postcopy outgoing: add -p and -n option to migrate command, Isaku Yamahata, 2012/06/04
- [Qemu-devel] [PATCH v2 39/41] postcopy/outgoing: implement prefault, Isaku Yamahata, 2012/06/04
- [Qemu-devel] [PATCH v2 26/41] buffered_file: factor out buffer management logic, Isaku Yamahata, 2012/06/04
- [Qemu-devel] [PATCH v2 14/41] exec.c: export last_ram_offset(), Isaku Yamahata, 2012/06/04
- [Qemu-devel] [PATCH v2 08/41] arch_init/ram_load: refactor ram_load, Isaku Yamahata, 2012/06/04
- [Qemu-devel] [PATCH v2 28/41] buffered_file: add qemu_file to read/write to buffer in memory, Isaku Yamahata, 2012/06/04
- [Qemu-devel] [PATCH v2 33/41] postcopy: introduce -postcopy and -postcopy-flags option, Isaku Yamahata, 2012/06/04
- [Qemu-devel] [PATCH v2 12/41] arch_init: factor out setting last_block, last_offset,
Isaku Yamahata <=
- [Qemu-devel] [PATCH v2 36/41] postcopy: implement incoming part of postcopy live migration, Isaku Yamahata, 2012/06/04
- [Qemu-devel] [PATCH v2 41/41] migration/postcopy: add movebg mode, Isaku Yamahata, 2012/06/04
- [Qemu-devel] [PATCH v2 40/41] migrate: add -m (movebg) option to migrate command, Isaku Yamahata, 2012/06/04
- [Qemu-devel] [PATCH v2 37/41] postcopy: implement outgoing part of postcopy live migration, Isaku Yamahata, 2012/06/04
- [Qemu-devel] [PATCH v2 35/41] postcopy: introduce helper functions for postcopy, Isaku Yamahata, 2012/06/04