Statistics
| Branch: | Revision:

root / include / block / snapshot.h @ 6a1751b7

History | View | Annotate | Download (2.3 kB)

1 de08c606 Wenchao Xia
/*
2 de08c606 Wenchao Xia
 * Block layer snapshot related functions
3 de08c606 Wenchao Xia
 *
4 de08c606 Wenchao Xia
 * Copyright (c) 2003-2008 Fabrice Bellard
5 de08c606 Wenchao Xia
 *
6 de08c606 Wenchao Xia
 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 de08c606 Wenchao Xia
 * of this software and associated documentation files (the "Software"), to deal
8 de08c606 Wenchao Xia
 * in the Software without restriction, including without limitation the rights
9 de08c606 Wenchao Xia
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 de08c606 Wenchao Xia
 * copies of the Software, and to permit persons to whom the Software is
11 de08c606 Wenchao Xia
 * furnished to do so, subject to the following conditions:
12 de08c606 Wenchao Xia
 *
13 de08c606 Wenchao Xia
 * The above copyright notice and this permission notice shall be included in
14 de08c606 Wenchao Xia
 * all copies or substantial portions of the Software.
15 de08c606 Wenchao Xia
 *
16 de08c606 Wenchao Xia
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 de08c606 Wenchao Xia
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 de08c606 Wenchao Xia
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 de08c606 Wenchao Xia
 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 de08c606 Wenchao Xia
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 de08c606 Wenchao Xia
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 de08c606 Wenchao Xia
 * THE SOFTWARE.
23 de08c606 Wenchao Xia
 */
24 de08c606 Wenchao Xia
25 de08c606 Wenchao Xia
#ifndef SNAPSHOT_H
26 de08c606 Wenchao Xia
#define SNAPSHOT_H
27 de08c606 Wenchao Xia
28 de08c606 Wenchao Xia
#include "qemu-common.h"
29 de08c606 Wenchao Xia
30 de08c606 Wenchao Xia
typedef struct QEMUSnapshotInfo {
31 de08c606 Wenchao Xia
    char id_str[128]; /* unique snapshot id */
32 de08c606 Wenchao Xia
    /* the following fields are informative. They are not needed for
33 de08c606 Wenchao Xia
       the consistency of the snapshot */
34 de08c606 Wenchao Xia
    char name[256]; /* user chosen name */
35 de08c606 Wenchao Xia
    uint64_t vm_state_size; /* VM state info size */
36 de08c606 Wenchao Xia
    uint32_t date_sec; /* UTC date of the snapshot */
37 de08c606 Wenchao Xia
    uint32_t date_nsec;
38 de08c606 Wenchao Xia
    uint64_t vm_clock_nsec; /* VM clock relative to boot */
39 de08c606 Wenchao Xia
} QEMUSnapshotInfo;
40 de08c606 Wenchao Xia
41 de08c606 Wenchao Xia
int bdrv_snapshot_find(BlockDriverState *bs, QEMUSnapshotInfo *sn_info,
42 de08c606 Wenchao Xia
                       const char *name);
43 de08c606 Wenchao Xia
int bdrv_can_snapshot(BlockDriverState *bs);
44 de08c606 Wenchao Xia
int bdrv_snapshot_create(BlockDriverState *bs,
45 de08c606 Wenchao Xia
                         QEMUSnapshotInfo *sn_info);
46 de08c606 Wenchao Xia
int bdrv_snapshot_goto(BlockDriverState *bs,
47 de08c606 Wenchao Xia
                       const char *snapshot_id);
48 de08c606 Wenchao Xia
int bdrv_snapshot_delete(BlockDriverState *bs, const char *snapshot_id);
49 de08c606 Wenchao Xia
int bdrv_snapshot_list(BlockDriverState *bs,
50 de08c606 Wenchao Xia
                       QEMUSnapshotInfo **psn_info);
51 de08c606 Wenchao Xia
int bdrv_snapshot_load_tmp(BlockDriverState *bs,
52 de08c606 Wenchao Xia
                           const char *snapshot_name);
53 de08c606 Wenchao Xia
#endif