The L1 table is read from disk using the byte-based bdrv_pread() and
is never accessed beyond its last element, so there's no need to
allocate more memory than that.
Signed-off-by: Alberto Garcia
---
block/qcow2-cluster.c | 5 ++---
block/qcow2-refcount.c | 2 +-
block/qcow2-snapshot.c | 3
no good use case that would require us to try to handle them
so let's just treat them as unsupported.
Signed-off-by: Alberto Garcia
---
block/qcow2.c | 7 +++
docs/interop/qcow2.txt | 3 ++-
tests/qemu-iotests/080 | 7 +++
tests/qemu-iotests/080.out | 4
4 files
This small series gets rid of all the remaining instances of hardcoded
sector sizes in the qcow2 code and adds a check for images whose
virtual size is not a multiple of the sector size.
See the individual patches for details.
Berto
Alberto Garcia (3):
qcow2: Require that the virtual size
This replaces all remaining instances in the qcow2 code.
Signed-off-by: Alberto Garcia
---
block/qcow2-cluster.c | 2 +-
block/qcow2.c | 16 +---
2 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/block/qcow2-cluster.c b/block/qcow2-cluster.c
index 932fc48919
of QCow2ClusterType with their QCow2SubclusterType
equivalents (as returned by qcow2_cluster_to_subcluster_type()).
This patch only changes the data types, there are no semantic changes.
Signed-off-by: Alberto Garcia
---
block/qcow2-cluster.c | 19 +-
block/qcow2.c | 82
Extended L2 entries are bigger than normal L2 entries so this has an
impact on the amount of metadata needed for a qcow2 file.
Signed-off-by: Alberto Garcia
---
block/qcow2.c | 19 ---
1 file changed, 12 insertions(+), 7 deletions(-)
diff --git a/block/qcow2.c b/block/qcow2.c
Now that the implementation of subclusters is complete we can finally
add the necessary options to create and read images with this feature,
which we call "extended L2 entries".
Signed-off-by: Alberto Garcia
---
block/qcow2.c| 65 ++--
blo
with zeroes the other
subclusters if we can guarantee that we are not overwriting existing
data. However this would waste more disk space, so we should first
evaluate if it's really worth doing.
Signed-off-by: Alberto Garcia
---
block/qcow2.c | 9 +
1 file changed, 5 insertions(+), 4 deletions
The L2 bitmap needs to be updated after each write to indicate what
new subclusters are now allocated.
This needs to happen even if the cluster was already allocated and the
L2 entry was otherwise valid.
Signed-off-by: Alberto Garcia
---
block/qcow2-cluster.c | 17 +
1 file
value.
Signed-off-by: Alberto Garcia
---
block/qcow2.h | 6 ++
1 file changed, 6 insertions(+)
diff --git a/block/qcow2.h b/block/qcow2.h
index 6823d3f68f..1db3fc5dbc 100644
--- a/block/qcow2.h
+++ b/block/qcow2.h
@@ -495,6 +495,12 @@ typedef enum QCow2MetadataOverlap {
#define INV_OFFSET
Setting the QCOW_OFLAG_ZERO bit of the L2 entry is forbidden if an
image has subclusters. Instead, the individual 'all zeroes' bits must
be used.
Signed-off-by: Alberto Garcia
---
block/qcow2-cluster.c | 14 ++
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/block
the get/set_l2_bitmap() functions that are
used to access the bitmaps. For convenience we allow calling
get_l2_bitmap() on images without subclusters, although the caller
does not need and should ignore the returned value.
Signed-off-by: Alberto Garcia
---
block/qcow2.h | 22
Setting the QCOW_OFLAG_ZERO bit of the L2 entry is forbidden if an
image has subclusters. Instead, the individual 'all zeroes' bits must
be used.
Signed-off-by: Alberto Garcia
---
block/qcow2-refcount.c | 9 +++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/block/qcow2
. This function returns the proper value for the image.
Signed-off-by: Alberto Garcia
---
block/qcow2-cluster.c | 12 ++--
block/qcow2-refcount.c | 14 --
block/qcow2.c | 8
block/qcow2.h | 9 +
4 files changed, 27 insertions(+), 16 deletions(-)
diff
-zeroes bit set then we need
copy-on-write on subcluster #3.
- If we are overwriting an old cluster and subcluster #3 was
allocated then there is no need to copy-on-write.
Signed-off-by: Alberto Garcia
---
block/qcow2-cluster.c | 140 +-
1 file
-off-by: Alberto Garcia
---
docs/interop/qcow2.txt | 68 --
docs/qcow2-cache.txt | 19 +++-
2 files changed, 83 insertions(+), 4 deletions(-)
diff --git a/docs/interop/qcow2.txt b/docs/interop/qcow2.txt
index af5711e533..d34261f955 100644
--- a/docs
l2meta_cow_start() and l2meta_cow_end() are not necessarily
cluster-aligned if the image has subclusters, so update the
calculation of old_start and old_end to guarantee that no two requests
try to write on the same cluster.
Signed-off-by: Alberto Garcia
---
block/qcow2-cluster.c | 4 ++--
1
The logic of this function remains pretty much the same, except that
it uses count_contiguous_subclusters(), which combines the logic of
count_contiguous_clusters() / count_contiguous_clusters_unallocated()
and checks individual subclusters.
Signed-off-by: Alberto Garcia
---
block/qcow2
for subclusters.
Signed-off-by: Alberto Garcia
---
block/qcow2-cluster.c | 226 +++---
1 file changed, 126 insertions(+), 100 deletions(-)
diff --git a/block/qcow2-cluster.c b/block/qcow2-cluster.c
index e078bddcc2..9387f15866 100644
--- a/block/qcow2-cluster.c
Signed-off-by: Alberto Garcia
---
tests/qemu-iotests/271 | 256 +
tests/qemu-iotests/271.out | 208 ++
tests/qemu-iotests/group | 1 +
3 files changed, 465 insertions(+)
create mode 100755 tests/qemu-iotests/271
create
to
get_l2_entry() and set_l2_entry().
Signed-off-by: Alberto Garcia
---
block/qcow2-cluster.c | 65 ++
block/qcow2-refcount.c | 17 +--
block/qcow2.h | 12
3 files changed, 55 insertions(+), 39 deletions(-)
diff --git a/block/qcow2-cluster.c
/27:[down] 'qcow2: Add subcluster support to qcow2_measure()'
027/27:[0046] [FC] 'iotests: Add tests for qcow2 images with extended L2
entries'
Alberto Garcia (27):
qcow2: Add calculate_l2_meta()
qcow2: Split cluster_needs_cow() out of count_cow_clusters()
qcow2: Process
Two changes are needed in order to add subcluster support to this
function: deallocated clusters must have their bitmaps cleared, and
expanded clusters must have all the "subcluster allocated" bits set.
Signed-off-by: Alberto Garcia
---
block/qcow2-cluster.c | 6 ++
1 file
We are going to need it in other places.
Signed-off-by: Alberto Garcia
Reviewed-by: Vladimir Sementsov-Ogievskiy
---
block/qcow2-cluster.c | 34 +++---
1 file changed, 19 insertions(+), 15 deletions(-)
diff --git a/block/qcow2-cluster.c b/block/qcow2-cluster.c
For a given offset, return the subcluster number within its cluster
(i.e. with 32 subclusters per cluster it returns a number between 0
and 31).
Signed-off-by: Alberto Garcia
---
block/qcow2.h | 5 +
1 file changed, 5 insertions(+)
diff --git a/block/qcow2.h b/block/qcow2.h
index
Compressed clusters always have the bitmap part of the extended L2
entry set to 0.
Signed-off-by: Alberto Garcia
---
block/qcow2-cluster.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/block/qcow2-cluster.c b/block/qcow2-cluster.c
index ed291a4042..af0f01621c 100644
--- a/block/qcow2
When dealing with subcluster types there is a new value called
QCOW2_SUBCLUSTER_UNALLOCATED_ALLOC that has no equivalent in
QCow2ClusterType.
This patch handles that value in all places where subcluster types
are processed.
Signed-off-by: Alberto Garcia
---
block/qcow2.c | 12 +---
1
patch.
Signed-off-by: Alberto Garcia
---
block/qcow2.h | 92 +++
1 file changed, 92 insertions(+)
diff --git a/block/qcow2.h b/block/qcow2.h
index 64b0a814f4..321ba9550f 100644
--- a/block/qcow2.h
+++ b/block/qcow2.h
@@ -80,6 +80,15 @@
#define
reated as if they had exactly one,
with subcluster_size = cluster_size.
Signed-off-by: Alberto Garcia
---
block/qcow2.c | 5 +
block/qcow2.h | 5 +
2 files changed, 10 insertions(+)
diff --git a/block/qcow2.c b/block/qcow2.c
index 3866b47946..cbd857e9c7 100644
--- a/block/qcow2.c
+++ b/block/q
handle_alloc() creates a QCowL2Meta structure in order to update the
image metadata and perform the necessary copy-on-write operations.
This patch moves that code to a separate function so it can be used
from other places.
Signed-off-by: Alberto Garcia
---
block/qcow2-cluster.c | 77
Ideally it should be possible to zero individual subclusters using
this function, but this is currently not implemented.
Signed-off-by: Alberto Garcia
---
block/qcow2.c | 6 ++
1 file changed, 6 insertions(+)
diff --git a/block/qcow2.c b/block/qcow2.c
index 242001afa2..0267722065 100644
Setting the QCOW_OFLAG_ZERO bit of the L2 entry is forbidden if an
image has subclusters. Instead, the individual 'all zeroes' bits must
be used.
Signed-off-by: Alberto Garcia
---
block/qcow2-cluster.c | 6 +-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/block/qcow2
There's a couple of places left in the qcow2 code that still do the
calculation manually, so let's replace them.
Signed-off-by: Alberto Garcia
---
block/qcow2.c | 8 +++-
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/block/qcow2.c b/block/qcow2.c
index 7c18721741..3866b47946
FMT.mid
>
> Signed-off-by: Stefan Hajnoczi
Reviewed-by: Alberto Garcia
Berto
On Mon 11 Nov 2019 05:01:55 PM CET, Max Reitz wrote:
> @@ -3177,11 +3177,6 @@ void qmp_block_resize(bool has_device, const char
> *device,
> aio_context = bdrv_get_aio_context(bs);
> aio_context_acquire(aio_context);
>
> -if (!bdrv_is_first_non_filter(bs)) {
> -
quot;: "Invalid parameter 'speed'"}}
>
> Make it use QERR_INVALID_PARAMETER_VALUE instead:
>
> {"error": {"class": "GenericError", "desc": "Parameter 'speed' expects a
> non-negative value"}}
>
> Signed-off-by: Kevin Wolf
Reviewed-by: Alberto Garcia
Berto
On Tue 26 Nov 2019 09:17:02 AM CET, pannengy...@huawei.com wrote:
> --- a/block/throttle-groups.c
> +++ b/block/throttle-groups.c
> @@ -912,6 +912,7 @@ static void throttle_group_set_limits(Object *obj,
> Visitor *v,
> unlock:
> qemu_mutex_unlock(>lock);
> ret:
> +
On Fri 22 Nov 2019 05:05:05 PM CET, Kevin Wolf wrote:
> @@ -3405,6 +3412,7 @@ typedef struct TruncateCo {
> int64_t offset;
> bool exact;
> PreallocMode prealloc;
> +bool no_fallback;
> Error **errp;
> int ret;
> } TruncateCo;
You add the 'no_fallback' field here...
is passed down to the block driver of the external data file. We
> are forwarding the BDRV_REQ_NO_FALLBACK flag there, though, so this is
> fine, too.
>
> Declare the flag supported therefore.
>
> Signed-off-by: Kevin Wolf
Reviewed-by: Alberto Garcia
Berto
t;
> After commit top.qcow2 to mid.qcow2, the following happens:
>
> mid.qcow2: CB-C00C0 (correct result)
> mid.qcow2: CB-C--C- (before this fix)
>
> Without the fix, blocks that previously read as zeros on top.qcow2
> suddenly turn into A.
>
> Signed-off-by: Kevin Wolf
Reviewed-by: Alberto Garcia
Berto
On Thu 21 Nov 2019 03:33:31 PM CET, Kevin Wolf wrote:
> For commit it's an image corruptor. For resize, I'll admit that it's
> just wrong behaviour that is probably harmless in most cases, but it's
> still wrong behaviour. It would be a corruptor in the same way as
> commit if it allowed resizing
Blake
> Reviewed-by: Vladimir Sementsov-Ogievskiy
Reviewed-by: Alberto Garcia
Berto
On Wed 20 Nov 2019 07:44:58 PM CET, Kevin Wolf wrote:
> Add a function that runs qemu-io and logs the output with the
> appropriate filters applied.
>
> Signed-off-by: Kevin Wolf
> Reviewed-by: Eric Blake
> Reviewed-by: Vladimir Sementsov-Ogievskiy
Reviewed-by: Alberto Garcia
Berto
y: Vladimir Sementsov-Ogievskiy
Reviewed-by: Alberto Garcia
Berto
On Wed 20 Nov 2019 04:58:38 PM CET, Vladimir Sementsov-Ogievskiy wrote:
>> But then PREALLOC_MODE_OFF implies that the L2 metadata should be
>> preallocated (all clusters should be QCOW2_CLUSTER_ZERO_PLAIN), at
>> least when there is a backing file.
>
> Kevin proposed a fix that alters
> Signed-off-by: Kevin Wolf
Reviewed-by: Alberto Garcia
Berto
On Wed 20 Nov 2019 01:27:53 PM CET, Vladimir Semeeausntsov-Ogievskiy wrote:
> 3. Also, the latter way is inconsistent with discard. Discarded
> regions returns zeroes, not clusters from backing. I think discard and
> truncate should behave in the same safe zero way.
But then PREALLOC_MODE_OFF
Hi,
as we discussed yesterday on IRC there's an inconsistency in the way
qcow2 preallocation works.
Let's create an image and fill it with data:
$ qemu-img create -f raw base.img 1M
$ qemu-io -f raw -c 'write -P 0xFF 0 1M' base.img
Now QEMU won't let us create a new image backed by
On Tue 05 Nov 2019 01:47:58 PM CET, Max Reitz wrote:
>> @@ -1347,6 +1347,12 @@ static int coroutine_fn
>> qcow2_do_open(BlockDriverState *bs, QDict *options,
>> s->subcluster_size = s->cluster_size / s->subclusters_per_cluster;
>> s->subcluster_bits = ctz32(s->subcluster_size);
>>
>>
On Tue 05 Nov 2019 12:43:16 PM CET, Max Reitz wrote:
> Speaking of handle_copied(); both elements of Qcow2COWRegion are of
> type unsigned. handle_copied() doesn’t look like it takes any
> precautions to limit the range to even UINT_MAX (and it should
> probably limit it to INT_MAX).
Or rather,
On Tue 05 Nov 2019 12:05:02 PM CET, Max Reitz wrote:
>> @@ -2102,6 +2103,7 @@ static int expand_zero_clusters_in_l1(BlockDriverState
>> *bs, uint64_t *l1_table,
>> } else {
>> set_l2_entry(s, l2_slice, j, offset);
>> }
>> +
On Mon 04 Nov 2019 04:07:35 PM CET, Max Reitz wrote:
>> /* First remove L2 entries */
>> qcow2_cache_entry_mark_dirty(s->l2_table_cache, l2_slice);
>> -if (!full_discard && s->qcow_version >= 3) {
>> +if (has_subclusters(s)) {
>> +set_l2_entry(s,
On Mon 04 Nov 2019 04:10:58 PM CET, Max Reitz wrote:
>>> qcow2_cache_entry_mark_dirty(s->l2_table_cache, l2_slice);
>>> if (cluster_type == QCOW2_CLUSTER_COMPRESSED || unmap) {
>>> -set_l2_entry(s, l2_slice, l2_index + i, QCOW_OFLAG_ZERO);
>>>
On Wed 30 Oct 2019 05:55:04 PM CET, Max Reitz wrote:
>> This patch also adds the get/set_l2_bitmap() functions that are used
>> to access the bitmaps. For convenience, these functions are no-ops
>> when used in traditional qcow2 images.
>
> Granted, I haven’t seen the following patches yet, but if
On Wed 30 Oct 2019 03:24:08 PM CET, Max Reitz wrote:
>> static void calculate_l2_meta(BlockDriverState *bs, uint64_t host_offset,
>>uint64_t guest_offset, uint64_t bytes,
>> - QCowL2Meta **m, bool keep_old)
>> +
On Mon 04 Nov 2019 03:58:57 PM CET, Max Reitz wrote:
> OTOH, what I don’t like so far about this series is that the “cluster
> logic” is still everywhere when I think it should just be about
> subclusters now. (Except in few places where it must be about
> clusters as in something that can have a
On Mon 04 Nov 2019 03:21:41 PM CET, Max Reitz wrote:
>> If an image has subclusters then there are more copy-on-write
>> scenarios that we need to consider. Let's say we have a write request
>> from the middle of subcluster #3 until the end of the cluster:
>>
>>- If the cluster is new, then
d() to remove the 'backing' option from
> bs->options and bs->explicit_options even for the case where it
> specifies that no backing file is wanted.
>
> Reported-by: Peter Krempa
> Signed-off-by: Kevin Wolf
Reviewed-by: Alberto Garcia
Berto
On Fri 08 Nov 2019 09:53:12 AM CET, Kevin Wolf wrote:
> +# Test large write to a qcow2 image
This doesn't belong here I guess :)
I wonder if this test could go in 245 instead.
Berto
On Mon 04 Nov 2019 02:10:37 PM CET, Max Reitz wrote:
[QCOW2_CLUSTER_UNALLOCATED_SUBCLUSTER]
> I still don’t know what you’re doing in the later patches, but to me
> it looks a bit like you don’t dare breaking up the existing structure
> that just deals with clusters.
Yeah, I decided to extend
On Mon 04 Nov 2019 04:14:56 PM CET, Max Reitz wrote:
>>> No, what I meant was that the original problem that led to
>>> c8bb23cbdbe would go away.
>>
>> Ah, right. Not quite, according to my numbers:
>>
>> |--++-+-|
>> | Cluster size |
On Mon 04 Nov 2019 03:25:12 PM CET, Max Reitz wrote:
> So, it's obvious that c8bb23cbdbe32f5c326 is significant for 1M
> cluster-size, even on rotational disk, which means that previous
> assumption about calling handle_alloc_space() only for ssd is wrong,
> we need smarter
On Fri 25 Oct 2019 04:19:30 PM CEST, Max Reitz wrote:
>>> So, it's obvious that c8bb23cbdbe32f5c326 is significant for 1M
>>> cluster-size, even on rotational disk, which means that previous
>>> assumption about calling handle_alloc_space() only for ssd is wrong,
>>> we need smarter heuristics..
On Mon 04 Nov 2019 01:57:42 PM CET, Max Reitz wrote:
> On 26.10.19 23:25, Alberto Garcia wrote:
>> In the previous patch we added a new QCow2ClusterType named
>> QCOW2_CLUSTER_UNALLOCATED_SUBCLUSTER. There is a couple of places
>> where this new value needs to be hand
On Wed 30 Oct 2019 05:23:30 PM CET, Max Reitz wrote:
>> +Subcluster Allocation Bitmap (for standard clusters):
>> +
>> +Bit 0 - 31: Allocation status (one bit per subcluster)
>> +
>> +1: the subcluster is allocated. In this case the
>> + host
On Wed 30 Oct 2019 01:04:02 PM CET, Max Reitz wrote:
> (I intended not to comment on such things on an RFC, but here I am...)
No problem with that :-)
> I’d call it host_cluster_offset to make clear that it points to a
> cluster and isn’t the host offset for @guest_offset.
Sure, why not. We can
On Mon 28 Oct 2019 01:50:54 PM CET, Vladimir Sementsov-Ogievskiy wrote:
>> -.cow_end = {
>> -.offset = nb_bytes,
>
> hmm this logic is changed.. after the patch, it would be not nb_bytes, but
>
> offset_into_cluster(s, guest_offset) + MIN(*bytes, nb_bytes -
>
On Mon 28 Oct 2019 05:18:39 PM CET, Max Reitz wrote:
> This fixes a bug reported on
> https://bugs.launchpad.net/qemu/+bug/185. The problem is that
> QCOW2_COMPRESSED_SECTOR_MASK is a 32-bit mask when it really needs to be
> a 64-bit mask.
Ouch!
Reviewed-by: Alberto Garcia
Berto
The L2 bitmap needs to be updated after each write to indicate what
new subclusters are now allocated.
This needs to happen even if the cluster was already allocated and the
L2 entry was otherwise valid.
Signed-off-by: Alberto Garcia
---
block/qcow2-cluster.c | 16
1 file
to
get_l2_entry() and set_l2_entry().
Signed-off-by: Alberto Garcia
---
block/qcow2-cluster.c | 65 ++
block/qcow2-refcount.c | 17 +--
block/qcow2.h | 12
3 files changed, 55 insertions(+), 39 deletions(-)
diff --git a/block/qcow2-cluster.c
Ideally it should be possible to zero individual subclusters using
this function, but this is currently not implemented.
Signed-off-by: Alberto Garcia
---
block/qcow2.c | 6 ++
1 file changed, 6 insertions(+)
diff --git a/block/qcow2.c b/block/qcow2.c
index 01322ca449..537569ce88 100644
handle_alloc() creates a QCowL2Meta structure in order to update the
image metadata and perform the necessary copy-on-write operations.
This patch moves that code to a separate function so it can be used
from other places.
Signed-off-by: Alberto Garcia
---
block/qcow2-cluster.c | 76
the get/set_l2_bitmap() functions that are used
to access the bitmaps. For convenience, these functions are no-ops
when used in traditional qcow2 images.
Signed-off-by: Alberto Garcia
---
block/qcow2.h | 22 ++
1 file changed, 22 insertions(+)
diff --git a/block/qcow2.h b
Setting the QCOW_OFLAG_ZERO bit of the L2 entry is forbidden if an
image has subclusters. Instead, the individual 'all zeroes' bits must
be used.
Signed-off-by: Alberto Garcia
---
block/qcow2-cluster.c | 6 +-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/block/qcow2
Setting the QCOW_OFLAG_ZERO bit of the L2 entry is forbidden if an
image has subclusters. Instead, the individual 'all zeroes' bits must
be used.
Signed-off-by: Alberto Garcia
---
block/qcow2-refcount.c | 9 +++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/block/qcow2
l2meta_cow_start() and l2meta_cow_end() are not necessarily
cluster-aligned if the image has subclusters, so update the
calculation of old_start and old_end to guarantee that no two requests
try to write on the same cluster.
Signed-off-by: Alberto Garcia
---
block/qcow2-cluster.c | 4 ++--
1
. This function returns the proper value for the image.
Signed-off-by: Alberto Garcia
---
block/qcow2-cluster.c | 12 ++--
block/qcow2-refcount.c | 14 --
block/qcow2.c | 6 +++---
block/qcow2.h | 5 +
4 files changed, 22 insertions(+), 15 deletions(-)
diff --git
Two changes are needed in order to add subcluster support to this
function: deallocated clusters must have their bitmaps cleared, and
expanded clusters must have all the "subcluster allocated" bits set.
Signed-off-by: Alberto Garcia
---
block/qcow2-cluster.c | 2 ++
1 file changed, 2
The logic of this function remains pretty much the same, except that
it uses count_contiguous_subclusters(), which combines the logic of
count_contiguous_clusters() / count_contiguous_clusters_unallocated()
and checks individual subclusters.
Signed-off-by: Alberto Garcia
---
block/qcow2
with zeroes the other
subclusters if we can guarantee that we are not overwriting existing
data. However this would waste more disk space, so we should first
evaluate if it's really worth doing.
Signed-off-by: Alberto Garcia
---
block/qcow2.c | 9 +
1 file changed, 5 insertions(+), 4 deletions
value.
Signed-off-by: Alberto Garcia
---
block/qcow2.h | 6 ++
1 file changed, 6 insertions(+)
diff --git a/block/qcow2.h b/block/qcow2.h
index 940cd4c236..b3826b37c1 100644
--- a/block/qcow2.h
+++ b/block/qcow2.h
@@ -488,6 +488,12 @@ typedef enum QCow2MetadataOverlap {
#define INV_OFFSET
Compressed clusters always have the bitmap part of the extended L2
entry set to 0.
Signed-off-by: Alberto Garcia
---
block/qcow2-cluster.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/block/qcow2-cluster.c b/block/qcow2-cluster.c
index acb7226e03..3ba8a98073 100644
--- a/block/qcow2
-zeroes bit set then we need
copy-on-write on subcluster #3.
- If we are overwriting an old cluster and subcluster #3 was
allocated then there is no need to copy-on-write.
Signed-off-by: Alberto Garcia
---
block/qcow2-cluster.c | 136 +-
1 file
Now that the implementation of subclusters is complete we can finally
add the necessary options to create and read images with this feature,
which we call "extended L2 entries".
Signed-off-by: Alberto Garcia
---
block/qcow2.c| 46 ++
blo
Signed-off-by: Alberto Garcia
---
tests/qemu-iotests/271 | 235 +
tests/qemu-iotests/271.out | 183 +
tests/qemu-iotests/group | 1 +
3 files changed, 419 insertions(+)
create mode 100755 tests/qemu-iotests/271
create mode
On Wed 23 Oct 2019 12:39:14 PM CEST, Vladimir Sementsov-Ogievskiy wrote:
> Hi!
>
> This is very interesting! Could you please export a branch to look at,
> as patches can't be applied on master now :(
I just sent a new version with some updates and rebased on top of the
current master.
Berto
for subclusters.
Signed-off-by: Alberto Garcia
---
block/qcow2-cluster.c | 177 +++---
1 file changed, 96 insertions(+), 81 deletions(-)
diff --git a/block/qcow2-cluster.c b/block/qcow2-cluster.c
index aa1010a515..ee6b46f917 100644
--- a/block/qcow2-cluster.c
We are going to need it in other places.
Signed-off-by: Alberto Garcia
---
block/qcow2-cluster.c | 34 +++---
1 file changed, 19 insertions(+), 15 deletions(-)
diff --git a/block/qcow2-cluster.c b/block/qcow2-cluster.c
index 6c1dcdc781..aa1010a515 100644
--- a/block
returned for images with extended L2
entries.
Signed-off-by: Alberto Garcia
---
block/qcow2.h | 62 +++
1 file changed, 62 insertions(+)
diff --git a/block/qcow2.h b/block/qcow2.h
index 741c41c80f..23a2532ff2 100644
--- a/block/qcow2.h
+++ b/block
L2 entries'
Alberto Garcia (26):
qcow2: Add calculate_l2_meta()
qcow2: Split cluster_needs_cow() out of count_cow_clusters()
qcow2: Process QCOW2_CLUSTER_ZERO_ALLOC clusters in handle_copied()
qcow2: Add get_l2_entry() and set_l2_entry()
qcow2: Document the Extended L2 Entries feature
Setting the QCOW_OFLAG_ZERO bit of the L2 entry is forbidden if an
image has subclusters. Instead, the individual 'all zeroes' bits must
be used.
Signed-off-by: Alberto Garcia
---
block/qcow2-cluster.c | 14 ++
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/block
reated as if they had exactly one,
with subcluster_size = cluster_size.
Signed-off-by: Alberto Garcia
---
block/qcow2.c | 5 +
block/qcow2.h | 5 +
2 files changed, 10 insertions(+)
diff --git a/block/qcow2.c b/block/qcow2.c
index 0bc69e6996..ed8b81c7b7 100644
--- a/block/qcow2.c
+++ b/block/q
-off-by: Alberto Garcia
---
docs/interop/qcow2.txt | 68 --
docs/qcow2-cache.txt | 19 +++-
2 files changed, 83 insertions(+), 4 deletions(-)
diff --git a/docs/interop/qcow2.txt b/docs/interop/qcow2.txt
index af5711e533..d34261f955 100644
--- a/docs
In the previous patch we added a new QCow2ClusterType named
QCOW2_CLUSTER_UNALLOCATED_SUBCLUSTER. There is a couple of places
where this new value needs to be handled, and that is what this patch
does.
Signed-off-by: Alberto Garcia
---
block/qcow2.c | 13 +
1 file changed, 9
it is perfectly possible to have an
allocated cluster with all its subclusters unallocated.
Signed-off-by: Alberto Garcia
---
block/qcow2.c | 7 ---
tests/qemu-iotests/206.out | 2 +-
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/block/qcow2.c b/block/qcow2.c
index b1fa7ab5da
For a given offset, return the subcluster number within its cluster
(i.e. with 32 subclusters per cluster it returns a number between 0
and 31).
Signed-off-by: Alberto Garcia
---
block/qcow2.h | 5 +
1 file changed, 5 insertions(+)
diff --git a/block/qcow2.h b/block/qcow2.h
index
On Tue 15 Oct 2019 06:05:23 PM CEST, Eric Blake wrote:
>> 6356 5548 4740 3932 3124 2316 15 8 7 0
>>
>> <-> <->
>>
-zeroes bit set then we need
copy-on-write on subcluster #3.
- If we are overwriting an old cluster and subcluster #3 was
allocated then there is no need to copy-on-write.
Signed-off-by: Alberto Garcia
---
block/qcow2-cluster.c | 136 +-
1 file
Setting the QCOW_OFLAG_ZERO bit of the L2 entry is forbidden if an
image has subclusters. Instead, the individual 'all zeroes' bits must
be used.
Signed-off-by: Alberto Garcia
---
block/qcow2-refcount.c | 9 +++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/block/qcow2
returned for images with extended L2
entries.
Signed-off-by: Alberto Garcia
---
block/qcow2.h | 62 +++
1 file changed, 62 insertions(+)
diff --git a/block/qcow2.h b/block/qcow2.h
index d9fe883fe0..60e4bf963e 100644
--- a/block/qcow2.h
+++ b/block
701 - 800 of 2993 matches
Mail list logo