[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v5 4/6] qcow2: Save refcount order in BDRVQcowState
From: |
Max Reitz |
Subject: |
[Qemu-devel] [PATCH v5 4/6] qcow2: Save refcount order in BDRVQcowState |
Date: |
Tue, 3 Sep 2013 10:09:53 +0200 |
Save the image refcount order in BDRVQcowState. This will be relevant
for future code supporting different refcount orders than four and also
for code that needs to verify a certain refcount order for an opened
image.
Signed-off-by: Max Reitz <address@hidden>
---
block/qcow2.c | 3 ++-
block/qcow2.h | 1 +
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/block/qcow2.c b/block/qcow2.c
index aeb2ebb..28b104e 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -455,6 +455,7 @@ static int qcow2_open(BlockDriverState *bs, QDict *options,
int flags)
ret = -ENOTSUP;
goto fail;
}
+ s->refcount_order = header.refcount_order;
if (header.cluster_bits < MIN_CLUSTER_BITS ||
header.cluster_bits > MAX_CLUSTER_BITS) {
@@ -1133,7 +1134,7 @@ int qcow2_update_header(BlockDriverState *bs)
.incompatible_features = cpu_to_be64(s->incompatible_features),
.compatible_features = cpu_to_be64(s->compatible_features),
.autoclear_features = cpu_to_be64(s->autoclear_features),
- .refcount_order = cpu_to_be32(3 + REFCOUNT_SHIFT),
+ .refcount_order = cpu_to_be32(s->refcount_order),
.header_length = cpu_to_be32(header_length),
};
diff --git a/block/qcow2.h b/block/qcow2.h
index bb25213..1e28fc1 100644
--- a/block/qcow2.h
+++ b/block/qcow2.h
@@ -199,6 +199,7 @@ typedef struct BDRVQcowState {
int flags;
int qcow_version;
bool use_lazy_refcounts;
+ int refcount_order;
bool discard_passthrough[QCOW2_DISCARD_MAX];
--
1.8.3.1
- [Qemu-devel] [PATCH v5 0/6] block/qcow2: Image file option amendment, Max Reitz, 2013/09/03
- [Qemu-devel] [PATCH v5 1/6] block: Image file option amendment, Max Reitz, 2013/09/03
- [Qemu-devel] [PATCH v5 2/6] qcow2-cache: Empty cache, Max Reitz, 2013/09/03
- [Qemu-devel] [PATCH v5 3/6] qcow2-cluster: Expand zero clusters, Max Reitz, 2013/09/03
- [Qemu-devel] [PATCH v5 6/6] qemu-iotest: qcow2 image option amendment, Max Reitz, 2013/09/03
- [Qemu-devel] [PATCH v5 5/6] qcow2: Implement bdrv_amend_options, Max Reitz, 2013/09/03
- [Qemu-devel] [PATCH v5 4/6] qcow2: Save refcount order in BDRVQcowState,
Max Reitz <=
- Re: [Qemu-devel] [PATCH v5 0/6] block/qcow2: Image file option amendment, Kevin Wolf, 2013/09/03
- Re: [Qemu-devel] [PATCH v5 0/6] block/qcow2: Image file option amendment, Kevin Wolf, 2013/09/09