xref: /openbmc/qemu/include/migration/snapshot.h (revision 52ed9f45)
1 /*
2  * QEMU snapshots
3  *
4  * Copyright (c) 2004-2008 Fabrice Bellard
5  * Copyright (c) 2009-2015 Red Hat Inc
6  *
7  * Authors:
8  *  Juan Quintela <quintela@redhat.com>
9  *
10  *
11  * This work is licensed under the terms of the GNU GPL, version 2 or later.
12  * See the COPYING file in the top-level directory.
13  */
14 
15 #ifndef QEMU_MIGRATION_SNAPSHOT_H
16 #define QEMU_MIGRATION_SNAPSHOT_H
17 
18 #include "qapi/qapi-builtin-types.h"
19 #include "qapi/qapi-types-run-state.h"
20 
21 /**
22  * save_snapshot: Save an internal snapshot.
23  * @name: name of internal snapshot
24  * @overwrite: replace existing snapshot with @name
25  * @vmstate: blockdev node name to store VM state in
26  * @has_devices: whether to use explicit device list
27  * @devices: explicit device list to snapshot
28  * @errp: pointer to error object
29  * On success, return %true.
30  * On failure, store an error through @errp and return %false.
31  */
32 bool save_snapshot(const char *name, bool overwrite,
33                    const char *vmstate,
34                    bool has_devices, strList *devices,
35                    Error **errp);
36 
37 /**
38  * load_snapshot: Load an internal snapshot.
39  * @name: name of internal snapshot
40  * @vmstate: blockdev node name to load VM state from
41  * @has_devices: whether to use explicit device list
42  * @devices: explicit device list to snapshot
43  * @errp: pointer to error object
44  * On success, return %true.
45  * On failure, store an error through @errp and return %false.
46  */
47 bool load_snapshot(const char *name,
48                    const char *vmstate,
49                    bool has_devices, strList *devices,
50                    Error **errp);
51 
52 /**
53  * delete_snapshot: Delete a snapshot.
54  * @name: path to snapshot
55  * @has_devices: whether to use explicit device list
56  * @devices: explicit device list to snapshot
57  * @errp: pointer to error object
58  * On success, return %true.
59  * On failure, store an error through @errp and return %false.
60  */
61 bool delete_snapshot(const char *name,
62                     bool has_devices, strList *devices,
63                     Error **errp);
64 
65 /**
66  * load_snapshot_resume: Restore runstate after loading snapshot.
67  * @state: state to restore
68  */
69 void load_snapshot_resume(RunState state);
70 
71 #endif
72