summary refs log tree commit diff stats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/exec/ram_addr.h13
-rw-r--r--include/migration/migration.h3
-rw-r--r--include/migration/postcopy-ram.h94
-rw-r--r--include/sysemu/sysemu.h5
4 files changed, 13 insertions, 102 deletions
diff --git a/include/exec/ram_addr.h b/include/exec/ram_addr.h
index dbe2f08d47..140efa840c 100644
--- a/include/exec/ram_addr.h
+++ b/include/exec/ram_addr.h
@@ -39,6 +39,14 @@ struct RAMBlock {
     QLIST_HEAD(, RAMBlockNotifier) ramblock_notifiers;
     int fd;
     size_t page_size;
+    /* dirty bitmap used during migration */
+    unsigned long *bmap;
+    /* bitmap of pages that haven't been sent even once
+     * only maintained and used in postcopy at the moment
+     * where it's used to send the dirtymap at the start
+     * of the postcopy phase
+     */
+    unsigned long *unsentmap;
 };
 
 static inline bool offset_in_ramblock(RAMBlock *b, ram_addr_t offset)
@@ -360,16 +368,15 @@ static inline void cpu_physical_memory_clear_dirty_range(ram_addr_t start,
 
 
 static inline
-uint64_t cpu_physical_memory_sync_dirty_bitmap(unsigned long *dest,
-                                               RAMBlock *rb,
+uint64_t cpu_physical_memory_sync_dirty_bitmap(RAMBlock *rb,
                                                ram_addr_t start,
                                                ram_addr_t length,
                                                uint64_t *real_dirty_pages)
 {
     ram_addr_t addr;
-    start = rb->offset + start;
     unsigned long page = BIT_WORD(start >> TARGET_PAGE_BITS);
     uint64_t num_dirty = 0;
+    unsigned long *dest = rb->bmap;
 
     /* start address is aligned at the start of a word? */
     if (((page * BITS_PER_LONG) << TARGET_PAGE_BITS) == start) {
diff --git a/include/migration/migration.h b/include/migration/migration.h
index ba1a16cbc1..e29cb0144b 100644
--- a/include/migration/migration.h
+++ b/include/migration/migration.h
@@ -266,7 +266,8 @@ uint64_t xbzrle_mig_pages_cache_miss(void);
 double xbzrle_mig_cache_miss_rate(void);
 
 void ram_handle_compressed(void *host, uint8_t ch, uint64_t size);
-void ram_debug_dump_bitmap(unsigned long *todump, bool expected);
+void ram_debug_dump_bitmap(unsigned long *todump, bool expected,
+                           unsigned long pages);
 /* For outgoing discard bitmap */
 int ram_postcopy_send_discard_bitmap(MigrationState *ms);
 /* For incoming postcopy discard */
diff --git a/include/migration/postcopy-ram.h b/include/migration/postcopy-ram.h
deleted file mode 100644
index 8e036b95a2..0000000000
--- a/include/migration/postcopy-ram.h
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * Postcopy migration for RAM
- *
- * Copyright 2013 Red Hat, Inc. and/or its affiliates
- *
- * Authors:
- *  Dave Gilbert  <dgilbert@redhat.com>
- *
- * This work is licensed under the terms of the GNU GPL, version 2 or later.
- * See the COPYING file in the top-level directory.
- *
- */
-#ifndef QEMU_POSTCOPY_RAM_H
-#define QEMU_POSTCOPY_RAM_H
-
-/* Return true if the host supports everything we need to do postcopy-ram */
-bool postcopy_ram_supported_by_host(void);
-
-/*
- * Make all of RAM sensitive to accesses to areas that haven't yet been written
- * and wire up anything necessary to deal with it.
- */
-int postcopy_ram_enable_notify(MigrationIncomingState *mis);
-
-/*
- * Initialise postcopy-ram, setting the RAM to a state where we can go into
- * postcopy later; must be called prior to any precopy.
- * called from ram.c's similarly named ram_postcopy_incoming_init
- */
-int postcopy_ram_incoming_init(MigrationIncomingState *mis, size_t ram_pages);
-
-/*
- * At the end of a migration where postcopy_ram_incoming_init was called.
- */
-int postcopy_ram_incoming_cleanup(MigrationIncomingState *mis);
-
-/*
- * Userfault requires us to mark RAM as NOHUGEPAGE prior to discard
- * however leaving it until after precopy means that most of the precopy
- * data is still THPd
- */
-int postcopy_ram_prepare_discard(MigrationIncomingState *mis);
-
-/*
- * Called at the start of each RAMBlock by the bitmap code.
- * 'offset' is the bitmap offset of the named RAMBlock in the migration
- * bitmap.
- * Returns a new PDS
- */
-PostcopyDiscardState *postcopy_discard_send_init(MigrationState *ms,
-                                                 unsigned long offset,
-                                                 const char *name);
-
-/*
- * Called by the bitmap code for each chunk to discard.
- * May send a discard message, may just leave it queued to
- * be sent later.
- * @start,@length: a range of pages in the migration bitmap in the
- *  RAM block passed to postcopy_discard_send_init() (length=1 is one page)
- */
-void postcopy_discard_send_range(MigrationState *ms, PostcopyDiscardState *pds,
-                                 unsigned long start, unsigned long length);
-
-/*
- * Called at the end of each RAMBlock by the bitmap code.
- * Sends any outstanding discard messages, frees the PDS.
- */
-void postcopy_discard_send_finish(MigrationState *ms,
-                                  PostcopyDiscardState *pds);
-
-/*
- * Place a page (from) at (host) efficiently
- *    There are restrictions on how 'from' must be mapped, in general best
- *    to use other postcopy_ routines to allocate.
- * returns 0 on success
- */
-int postcopy_place_page(MigrationIncomingState *mis, void *host, void *from,
-                        size_t pagesize);
-
-/*
- * Place a zero page at (host) atomically
- * returns 0 on success
- */
-int postcopy_place_page_zero(MigrationIncomingState *mis, void *host,
-                             size_t pagesize);
-
-/*
- * Allocate a page of memory that can be mapped at a later point in time
- * using postcopy_place_page
- * Returns: Pointer to allocated page
- */
-void *postcopy_get_tmp_page(MigrationIncomingState *mis);
-
-#endif
diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h
index 16175f7295..15656b7c36 100644
--- a/include/sysemu/sysemu.h
+++ b/include/sysemu/sysemu.h
@@ -75,11 +75,8 @@ void qemu_remove_exit_notifier(Notifier *notify);
 void qemu_add_machine_init_done_notifier(Notifier *notify);
 void qemu_remove_machine_init_done_notifier(Notifier *notify);
 
-void hmp_savevm(Monitor *mon, const QDict *qdict);
-int save_vmstate(Monitor *mon, const char *name);
+int save_vmstate(const char *name);
 int load_vmstate(const char *name);
-void hmp_delvm(Monitor *mon, const QDict *qdict);
-void hmp_info_snapshots(Monitor *mon, const QDict *qdict);
 
 void qemu_announce_self(void);