]> Git Repo - qemu.git/blob - include/migration/postcopy-ram.h
migration_completion: Take current state
[qemu.git] / include / migration / postcopy-ram.h
1 /*
2  * Postcopy migration for RAM
3  *
4  * Copyright 2013 Red Hat, Inc. and/or its affiliates
5  *
6  * Authors:
7  *  Dave Gilbert  <[email protected]>
8  *
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.
11  *
12  */
13 #ifndef QEMU_POSTCOPY_RAM_H
14 #define QEMU_POSTCOPY_RAM_H
15
16 /* Return true if the host supports everything we need to do postcopy-ram */
17 bool postcopy_ram_supported_by_host(void);
18
19 /*
20  * Discard the contents of 'length' bytes from 'start'
21  * We can assume that if we've been called postcopy_ram_hosttest returned true
22  */
23 int postcopy_ram_discard_range(MigrationIncomingState *mis, uint8_t *start,
24                                size_t length);
25
26
27 /*
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
30  * bitmap.
31  * Returns a new PDS
32  */
33 PostcopyDiscardState *postcopy_discard_send_init(MigrationState *ms,
34                                                  unsigned long offset,
35                                                  const char *name);
36
37 /*
38  * Called by the bitmap code for each chunk to discard.
39  * May send a discard message, may just leave it queued to
40  * be sent later.
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)
43  */
44 void postcopy_discard_send_range(MigrationState *ms, PostcopyDiscardState *pds,
45                                  unsigned long start, unsigned long length);
46
47 /*
48  * Called at the end of each RAMBlock by the bitmap code.
49  * Sends any outstanding discard messages, frees the PDS.
50  */
51 void postcopy_discard_send_finish(MigrationState *ms,
52                                   PostcopyDiscardState *pds);
53
54 #endif
This page took 0.026449 seconds and 4 git commands to generate.