Signed-off-by: Isaku Yamahata <[email protected]>
---
arch_init.c | 13 +++++++++++++
arch_init.h | 1 +
2 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/arch_init.c b/arch_init.c
index bb0cd52..9981abe 100644
--- a/arch_init.c
+++ b/arch_init.c
@@ -397,6 +397,19 @@ int ram_save_live(QEMUFile *f, int stage, void *opaque)
return (stage == 2) && (expected_time <= migrate_max_downtime());
}
+RAMBlock *ram_find_block(const char *id, uint8_t len)
+{
+ RAMBlock *block;
+
+ QLIST_FOREACH(block, &ram_list.blocks, next) {
+ if (!strncmp(id, block->idstr, len)) {
+ return block;
+ }
+ }
+
+ return NULL;
+}
+
void *ram_load_host_from_stream_offset(QEMUFile *f,
ram_addr_t offset,
int flags,
diff --git a/arch_init.h b/arch_init.h
index 507f110..7f5c77a 100644
--- a/arch_init.h
+++ b/arch_init.h
@@ -41,6 +41,7 @@ int xen_available(void);
#if defined(NEED_CPU_H) && !defined(CONFIG_USER_ONLY)
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,
ram_addr_t offset,
int flags,
--
1.7.1.1