summaryrefslogtreecommitdiff
path: root/block/qcow2.h
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2012-02-02 14:52:08 +0100
committerKevin Wolf <kwolf@redhat.com>2012-02-09 16:17:51 +0100
commit75bab85ca01876f912caf46f5fcb4ca8d9a50584 (patch)
tree71d45135a865bd82573f25fa688abbac7c01fef4 /block/qcow2.h
parente24e49e6194626e4ec9f1aecce6d6a6847320bce (diff)
downloadqemu-75bab85ca01876f912caf46f5fcb4ca8d9a50584.tar.gz
qcow2: Keep unknown header extension when rewriting header
If we want header extensions to work as compatible extensions, we can't destroy yet unknown header extensions when rewriting the header (e.g. for changing the backing file). Save all unknown header extensions in a list of blobs and include them in a new header. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block/qcow2.h')
-rw-r--r--block/qcow2.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/block/qcow2.h b/block/qcow2.h
index aae5f894e1..fc35838175 100644
--- a/block/qcow2.h
+++ b/block/qcow2.h
@@ -87,6 +87,13 @@ typedef struct QCowSnapshot {
struct Qcow2Cache;
typedef struct Qcow2Cache Qcow2Cache;
+typedef struct Qcow2UnknownHeaderExtension {
+ uint32_t magic;
+ uint32_t len;
+ QLIST_ENTRY(Qcow2UnknownHeaderExtension) next;
+ uint8_t data[];
+} Qcow2UnknownHeaderExtension;
+
typedef struct BDRVQcowState {
int cluster_bits;
int cluster_size;
@@ -127,6 +134,7 @@ typedef struct BDRVQcowState {
QCowSnapshot *snapshots;
int flags;
+ QLIST_HEAD(, Qcow2UnknownHeaderExtension) unknown_header_ext;
} BDRVQcowState;
/* XXX: use std qcow open function ? */