xref: /openbmc/qemu/include/migration/snapshot.h (revision 59964b4f)
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 
20 /**
21  * save_snapshot: Save an internal snapshot.
22  * @name: name of internal snapshot
23  * @overwrite: replace existing snapshot with @name
24  * @vmstate: blockdev node name to store VM state in
25  * @has_devices: whether to use explicit device list
26  * @devices: explicit device list to snapshot
27  * @errp: pointer to error object
28  * On success, return %true.
29  * On failure, store an error through @errp and return %false.
30  */
31 bool save_snapshot(const char *name, bool overwrite,
32                    const char *vmstate,
33                    bool has_devices, strList *devices,
34                    Error **errp);
35 
36 /**
37  * load_snapshot: Load an internal snapshot.
38  * @name: name of internal snapshot
39  * @vmstate: blockdev node name to load VM state from
40  * @has_devices: whether to use explicit device list
41  * @devices: explicit device list to snapshot
42  * @errp: pointer to error object
43  * On success, return %true.
44  * On failure, store an error through @errp and return %false.
45  */
46 bool load_snapshot(const char *name,
47                    const char *vmstate,
48                    bool has_devices, strList *devices,
49                    Error **errp);
50 
51 /**
52  * delete_snapshot: Delete a snapshot.
53  * @name: path to snapshot
54  * @has_devices: whether to use explicit device list
55  * @devices: explicit device list to snapshot
56  * @errp: pointer to error object
57  * On success, return %true.
58  * On failure, store an error through @errp and return %false.
59  */
60 bool delete_snapshot(const char *name,
61                     bool has_devices, strList *devices,
62                     Error **errp);
63 
64 #endif
65