27
27
uint64_t compressed_clusters;
30
typedef struct QEMUSnapshotInfo {
31
char id_str[128]; /* unique snapshot id */
32
/* the following fields are informative. They are not needed for
33
the consistency of the snapshot */
34
char name[256]; /* user chosen name */
35
uint64_t vm_state_size; /* VM state info size */
36
uint32_t date_sec; /* UTC date of the snapshot */
38
uint64_t vm_clock_nsec; /* VM clock relative to boot */
41
30
/* Callbacks for block device models */
42
31
typedef struct BlockDevOps {
123
112
void bdrv_init(void);
124
113
void bdrv_init_with_whitelist(void);
125
BlockDriver *bdrv_find_protocol(const char *filename);
114
BlockDriver *bdrv_find_protocol(const char *filename,
115
bool allow_protocol_prefix);
126
116
BlockDriver *bdrv_find_format(const char *format_name);
127
BlockDriver *bdrv_find_whitelisted_format(const char *format_name);
117
BlockDriver *bdrv_find_whitelisted_format(const char *format_name,
128
119
int bdrv_create(BlockDriver *drv, const char* filename,
129
120
QEMUOptionParameter *options);
130
121
int bdrv_create_file(const char* filename, QEMUOptionParameter *options);
166
157
uint8_t *buf, int nb_sectors);
167
158
int bdrv_write(BlockDriverState *bs, int64_t sector_num,
168
159
const uint8_t *buf, int nb_sectors);
160
int bdrv_write_zeroes(BlockDriverState *bs, int64_t sector_num,
169
162
int bdrv_writev(BlockDriverState *bs, int64_t sector_num, QEMUIOVector *qiov);
170
163
int bdrv_pread(BlockDriverState *bs, int64_t offset,
171
164
void *buf, int count);
276
269
/* Ensure contents are flushed to disk. */
277
270
int bdrv_flush(BlockDriverState *bs);
278
271
int coroutine_fn bdrv_co_flush(BlockDriverState *bs);
279
void bdrv_flush_all(void);
272
int bdrv_flush_all(void);
280
273
void bdrv_close_all(void);
281
274
void bdrv_drain_all(void);
283
276
int bdrv_discard(BlockDriverState *bs, int64_t sector_num, int nb_sectors);
284
277
int bdrv_co_discard(BlockDriverState *bs, int64_t sector_num, int nb_sectors);
278
int bdrv_has_zero_init_1(BlockDriverState *bs);
285
279
int bdrv_has_zero_init(BlockDriverState *bs);
286
280
int bdrv_is_allocated(BlockDriverState *bs, int64_t sector_num, int nb_sectors,
328
322
char *filename, int filename_size);
329
323
void bdrv_get_full_backing_filename(BlockDriverState *bs,
330
324
char *dest, size_t sz);
331
BlockInfo *bdrv_query_info(BlockDriverState *s);
332
BlockStats *bdrv_query_stats(const BlockDriverState *bs);
333
int bdrv_can_snapshot(BlockDriverState *bs);
334
325
int bdrv_is_snapshot(BlockDriverState *bs);
335
BlockDriverState *bdrv_snapshots(void);
336
int bdrv_snapshot_create(BlockDriverState *bs,
337
QEMUSnapshotInfo *sn_info);
338
int bdrv_snapshot_goto(BlockDriverState *bs,
339
const char *snapshot_id);
340
int bdrv_snapshot_delete(BlockDriverState *bs, const char *snapshot_id);
341
int bdrv_snapshot_list(BlockDriverState *bs,
342
QEMUSnapshotInfo **psn_info);
343
int bdrv_snapshot_load_tmp(BlockDriverState *bs,
344
const char *snapshot_name);
345
char *bdrv_snapshot_dump(char *buf, int buf_size, QEMUSnapshotInfo *sn);
347
char *get_human_readable_size(char *buf, int buf_size, int64_t size);
348
327
int path_is_absolute(const char *path);
349
328
void path_combine(char *dest, int dest_size,
350
329
const char *base_path,