2 * Postcopy migration for RAM
4 * Copyright 2013 Red Hat, Inc. and/or its affiliates
9 * This work is licensed under the terms of the GNU GPL, version 2 or later.
10 * See the COPYING file in the top-level directory.
13 #ifndef QEMU_POSTCOPY_RAM_H
14 #define QEMU_POSTCOPY_RAM_H
16 /* Return true if the host supports everything we need to do postcopy-ram */
17 bool postcopy_ram_supported_by_host(void);
20 * Discard the contents of 'length' bytes from 'start'
21 * We can assume that if we've been called postcopy_ram_hosttest returned true
23 int postcopy_ram_discard_range(MigrationIncomingState *mis, uint8_t *start,
28 * Called at the start of each RAMBlock by the bitmap code.
29 * 'offset' is the bitmap offset of the named RAMBlock in the migration
33 PostcopyDiscardState *postcopy_discard_send_init(MigrationState *ms,
38 * Called by the bitmap code for each chunk to discard.
39 * May send a discard message, may just leave it queued to
41 * @start,@length: a range of pages in the migration bitmap in the
42 * RAM block passed to postcopy_discard_send_init() (length=1 is one page)
44 void postcopy_discard_send_range(MigrationState *ms, PostcopyDiscardState *pds,
45 unsigned long start, unsigned long length);
48 * Called at the end of each RAMBlock by the bitmap code.
49 * Sends any outstanding discard messages, frees the PDS.
51 void postcopy_discard_send_finish(MigrationState *ms,
52 PostcopyDiscardState *pds);