@@ -1234,6 +1234,17 @@ void ram_handle_compressed(void *host, uint8_t ch, uint64_t size)
}
}
+/*
+ * Allocate data structures etc needed by incoming migration with postcopy-ram
+ * postcopy-ram's similarly names postcopy_ram_incoming_init does the work
+ */
+int ram_postcopy_incoming_init(MigrationIncomingState *mis)
+{
+ size_t ram_pages = last_ram_offset() >> TARGET_PAGE_BITS;
+
+ return postcopy_ram_incoming_init(mis, ram_pages);
+}
+
static int ram_load(QEMUFile *f, void *opaque, int version_id)
{
ram_addr_t addr;
@@ -194,6 +194,7 @@ int ram_postcopy_each_ram_discard(MigrationState *ms);
int ram_discard_range(MigrationIncomingState *mis, const char *block_name,
int source_target_page_bits,
uint64_t start, uint64_t end);
+int ram_postcopy_incoming_init(MigrationIncomingState *mis);
/**
* @migrate_add_blocker - prevent migration from proceeding
@@ -139,6 +139,8 @@ MigrationIncomingState *migration_incoming_state_init(QEMUFile* f)
void migration_incoming_state_destroy(MigrationIncomingState *mis)
{
+ postcopy_pmi_destroy(mis);
+
g_free(mis);
}