summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2009-05-28 16:07:06 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2009-06-16 15:18:36 -0500
commitc142442b06c51df60d000145d18af60ae5f0ac1c (patch)
tree0d23258a73f4e8a46cb6fa3c0c7c3469649b4d41 /block/qcow2.h
parentqcow2: Split out guest cluster functions (diff)
downloadqemu-kvm-c142442b06c51df60d000145d18af60ae5f0ac1c.tar.gz
qemu-kvm-c142442b06c51df60d000145d18af60ae5f0ac1c.tar.bz2
qemu-kvm-c142442b06c51df60d000145d18af60ae5f0ac1c.zip
qcow2: Split out snapshot functions
qcow2-snapshot.c contains the code related to snapshotting. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'block/qcow2.h')
-rw-r--r--block/qcow2.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/block/qcow2.h b/block/qcow2.h
index 367d9bdbb..397f21d3b 100644
--- a/block/qcow2.h
+++ b/block/qcow2.h
@@ -138,6 +138,13 @@ static inline int size_to_clusters(BDRVQcowState *s, int64_t size)
return (size + (s->cluster_size - 1)) >> s->cluster_bits;
}
+static inline int64_t align_offset(int64_t offset, int n)
+{
+ offset = (offset + n - 1) & ~(n - 1);
+ return offset;
+}
+
+
// FIXME Need qcow2_ prefix to global functions
/* qcow2.c functions */
@@ -184,4 +191,13 @@ uint64_t alloc_compressed_cluster_offset(BlockDriverState *bs,
int alloc_cluster_link_l2(BlockDriverState *bs, uint64_t cluster_offset,
QCowL2Meta *m);
+/* qcow2-snapshot.c functions */
+int qcow_snapshot_create(BlockDriverState *bs, QEMUSnapshotInfo *sn_info);
+int qcow_snapshot_goto(BlockDriverState *bs, const char *snapshot_id);
+int qcow_snapshot_delete(BlockDriverState *bs, const char *snapshot_id);
+int qcow_snapshot_list(BlockDriverState *bs, QEMUSnapshotInfo **psn_tab);
+
+void qcow_free_snapshots(BlockDriverState *bs);
+int qcow_read_snapshots(BlockDriverState *bs);
+
#endif