summaryrefslogtreecommitdiffstats
path: root/block/qcow2.h
diff options
context:
space:
mode:
Diffstat (limited to 'block/qcow2.h')
-rw-r--r--block/qcow2.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/block/qcow2.h b/block/qcow2.h
index 2285f18a73..ac30e48ee6 100644
--- a/block/qcow2.h
+++ b/block/qcow2.h
@@ -793,6 +793,24 @@ QCow2SubclusterType qcow2_get_subcluster_type(BlockDriverState *bs,
}
}
+#ifdef CONFIG_BDRV_CLUSTER_INFO
+static inline const char *qcow2_get_subcluster_name(
+ const QCow2SubclusterType type)
+{
+ static const char *subcluster_names[] = {
+ "QCOW2_SUBCLUSTER_UNALLOCATED_PLAIN",
+ "QCOW2_SUBCLUSTER_UNALLOCATED_ALLOC",
+ "QCOW2_SUBCLUSTER_ZERO_PLAIN",
+ "QCOW2_SUBCLUSTER_ZERO_ALLOC",
+ "QCOW2_SUBCLUSTER_NORMAL",
+ "QCOW2_SUBCLUSTER_COMPRESSED",
+ "QCOW2_SUBCLUSTER_INVALID"
+ };
+
+ return subcluster_names[type];
+}
+#endif
+
static inline bool qcow2_cluster_is_allocated(QCow2ClusterType type)
{
return (type == QCOW2_CLUSTER_COMPRESSED || type == QCOW2_CLUSTER_NORMAL ||
@@ -840,6 +858,10 @@ void qcow2_signal_corruption(BlockDriverState *bs, bool fatal, int64_t offset,
int64_t size, const char *message_format, ...)
G_GNUC_PRINTF(5, 6);
+#ifdef CONFIG_BDRV_CLUSTER_INFO
+int qcow2_get_cluster_info(BlockDriverState *bs, uint64_t offset);
+#endif
+
int qcow2_validate_table(BlockDriverState *bs, uint64_t offset,
uint64_t entries, size_t entry_len,
int64_t max_size_bytes, const char *table_name,