024/26:[0007] [FC] 'qcow2: Add the 'extended_l2' option and the
QCOW2_INCOMPAT_EXTL2 bit'
025/26:[down] 'qcow2: Allow preallocation and backing files if extended_l2 is
set'
026/26:[down] 'iotests: Add tests for qcow2 images with extended L2 entries'
Alb
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 --g
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 b1fa7
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
>>
>> <-> <->
>> subcluste
e all-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
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/b
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
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 4d16393e61..be9854c5ea 100644
--- a/block/qcow2.c
+++ b/block/q
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
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 dele
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
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 fe2523ed66..f462e169c0 100644
--- a/block
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
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
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 c54278ab0b..2eb032aed7 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 | 14 ++
1 file changed, 10 insertions(+), 4 deletions(-)
diff --g
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| 47 ++
blo
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
tly lower performance (see test results
above). Theoretically we could offer a setting to configure this,
but I'm not convinced that this is very useful.
===
As usual, feedback is welcome,
Berto
Alberto Garcia (23):
qcow2: Add calculate_l2_meta()
qcow2: Spl
t 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 f462e169c0..70b2e32f7e 100644
--- a/block/qcow2-clus
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
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
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 a
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/b
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 | 10 +++---
1 file changed, 7 insertions
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 0b68c55c01..6d6fc57f41 100644
--- a/block/qcow2.h
+++ b/block/qcow2.h
@@ -485,6 +485,12 @@ typedef enum QCow2MetadataOverlap {
#define INV_OFFSET
-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
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
On Mon 14 Oct 2019 11:26:01 AM CEST, Kevin Wolf wrote:
>> Signed-off-by: Alberto Garcia
>
> Thanks, applied to the block branch.
I'm a bit late now, but a possible trivial optimization is to flip the
conditions, because checking the flag should be faster than checking the
a
On Mon 14 Oct 2019 12:11:52 PM CEST, Vladimir Sementsov-Ogievskiy wrote:
> 13.10.2019 23:48, Alberto Garcia wrote:
>> The BDRV_REQ_NO_FALLBACK flag means that an operation should only be
>> performed if it can be offloaded or otherwise performed efficiently.
>
> As I know, BD
+#!/usr/bin/env bash
+#
+# Test write request with required alignment larger than the cluster size
+#
+# Copyright (C) 2019 Igalia, S.L.
+# Author: Alberto Garcia
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License a
: Assertion `!(flags &
BDRV_REQ_NO_FALLBACK)' failed.
Aborted
Signed-off-by: Alberto Garcia
---
block/io.c | 6 +
tests/qemu-iotests/268 | 55 ++
tests/qemu-iotests/268.out | 7 +
tests/qemu-iotests/group | 1 +
4 files changed,
On Thu 12 Sep 2019 01:33:05 AM CEST, John Snow wrote:
>> This restriction comes from commit 095a9c58ce12afeeb90c2 from 2018.
>
> You accidentally typed a reasonably modern date. It's from *2008*!
Oh my, and I reviewed the message 3 times ... if this one gets committed
please correct the date.
Be
itten in one go:
qemu-img create -f qcow2 hd.qcow2 64M
qemu-io -c "write -z 0 64k" hd.qcow2
for f in `seq 64 64 65472`; do
qemu-io -c "write -c ${f}k 64k" hd.qcow2
done
Compared to the previous one, overwriting this image on my computer
goes from 8.35s
On Fri 06 Sep 2019 06:01:14 PM CEST, Anton Nefedov wrote:
> This adds some protection from accounting uninitialized cookie.
> That is, block_acct_failed/done without previous block_acct_start;
> in that case, cookie probably holds values from previous operation.
>
> (Note: it might also be uninitia
On Fri 16 Aug 2019 04:08:19 PM CEST, Kevin Wolf wrote:
>> And yes, the odd value on the 512KB row on that we discussed last month
>> is due to this same bug:
>>
>> https://lists.gnu.org/archive/html/qemu-block/2019-07/msg00496.html
>
> Hm... And suddently it makes sense. :-)
>
> So I assume all of
On Fri 16 Aug 2019 02:59:21 PM CEST, Kevin Wolf wrote:
> The requirement so that this bug doesn't affect the user seems to be
> that the image size is a multiple of 64k * 8k = 512 MB. Which means
> that users are probably often lucky enough in practice.
Or rather: cluster_size^2 / 8, which, if my
Cc qemu-stable
This bug means that under certain conditions it's impossible to
create a cache large enough for the image, resulting in reduced I/O
performance.
On Fri, Aug 16, 2019 at 03:17:42PM +0300, Alberto Garcia wrote:
> The size of the qcow2 L2 cache defaults to 32 MB, which can b
ver QEMU rounds the numbers down and only creates 2 cache tables
(128 KB), which is not enough for the image.
A quick test doing 4KB random writes on a 1280 MB image gives me
around 500 IOPS, while with the correct cache size I get 16K IOPS.
Signed-off-by: Alberto Garcia
---
block/qcow2.c
.
>
> Signed-off-by: Andrey Shinkevich
Reviewed-by: Alberto Garcia
Berto
On Thu 11 Jul 2019 04:32:34 PM CEST, Kevin Wolf wrote:
>> - It is possible to configure very easily the number of subclusters per
>> cluster. It is now hardcoded to 32 in qcow2_do_open() but any power of
>> 2 would work (just change the number there if you want to test
>> it). Would an optio
On Thu 27 Jun 2019 07:08:29 PM CEST, Denis Lunev wrote:
> But can we get a link to the repo with actual version of patches.
Hi,
I updated my code to increase the L2 entry size from 64 bits to 128 bits
and thanks to this we now have 32 subclusters per cluster (32 bits for
"subcluster allocated" a
oming frozen.
>
> Signed-off-by: Max Reitz
Reviewed-by: Alberto Garcia
Berto
es the exact error messages
> and just checks the error class is something that should be fixed in a
> follow-up patch.
>
> Signed-off-by: Max Reitz
Reviewed-by: Alberto Garcia
Berto
On Fri 28 Jun 2019 12:32:55 AM CEST, Max Reitz wrote:
> We recently removed the dependency of the stream job on its base node.
> That makes it OK to use a commit filter node there. Test that.
>
> Signed-off-by: Max Reitz
Reviewed-by: Alberto Garcia
Berto
On Fri 28 Jun 2019 12:32:51 AM CEST, Max Reitz wrote:
> @@ -4416,6 +4416,14 @@ int bdrv_freeze_backing_chain(BlockDriverState *bs,
> BlockDriverState *base,
> return -EPERM;
> }
>
> +for (i = bs; i != base; i = backing_bs(i)) {
> +if (i->backing && backing_bs(i)->never_
he
> commit and stream job were not allowed to overlap.
>
> Prevent such problems in the future by comparing the error description
> instead.
>
> Signed-off-by: Max Reitz
Reviewed-by: Alberto Garcia
Berto
On Thu 27 Jun 2019 07:08:29 PM CEST, Denis Lunev wrote:
> But can we get a link to the repo with actual version of patches.
It's not in a state that can be published at the moment, but I'll try to
have something available soon.
Berto
On Fri 28 Jun 2019 04:16:28 PM CEST, Kevin Wolf wrote:
>> >> >> >> I would consider 64k cluster/8k subcluster as too extreme
>> >> >> >> for me.
>> >> >>
>> >> >> I forgot to add: this 64k/8k ratio is only with my current
>> >> >> prototype.
>> >> >>
>> >> >> In practice if we go with the 128-bit
On Fri 28 Jun 2019 05:09:11 PM CEST, Kevin Wolf wrote:
> Am 28.06.2019 um 17:02 hat Alberto Garcia geschrieben:
>> On Fri 28 Jun 2019 04:57:08 PM CEST, Kevin Wolf wrote:
>> > Am 28.06.2019 um 16:43 hat Alberto Garcia geschrieben:
>> >> On Thu 27 Jun 2019 06:05
On Fri 28 Jun 2019 04:57:08 PM CEST, Kevin Wolf wrote:
> Am 28.06.2019 um 16:43 hat Alberto Garcia geschrieben:
>> On Thu 27 Jun 2019 06:05:55 PM CEST, Denis Lunev wrote:
>> > Please note, I am not talking now about your case with COW. Here the
>> > allocation is perform
On Fri 28 Jun 2019 05:03:13 PM CEST, Denis Lunev wrote:
> On 6/28/19 6:02 PM, Alberto Garcia wrote:
>>>>> Please note, I am not talking now about your case with COW. Here the
>>>>> allocation is performed on the sub-cluster basis, i.e. the abscence of
>>>
On Thu 27 Jun 2019 06:05:55 PM CEST, Denis Lunev wrote:
>>> Thus in respect to this patterns subclusters could give us benefits
>>> of fast random IO and good reclaim rate.
>> Exactly, but that fast random I/O would only happen when allocating
>> new clusters. Once the clusters are allocated it doe
I pressed "send" too early, here's the last part of my reply:
On Fri 28 Jun 2019 02:57:56 PM CEST, Alberto Garcia wrote:
>> I also ran some tests on a rotating HDD drive. Here having
>> subclusters doesn't make a big difference regardless of whether there
>>
On Fri 28 Jun 2019 12:04:22 PM CEST, Kevin Wolf wrote:
> Am 28.06.2019 um 11:53 hat Alberto Garcia geschrieben:
>> On Fri 28 Jun 2019 11:20:57 AM CEST, Kevin Wolf wrote:
>> >> >> I would consider 64k cluster/8k subcluster as too extreme for me.
>> >>
>
On Thu 27 Jun 2019 06:54:34 PM CEST, Kevin Wolf wrote:
>> |-++-|
>> | Cluster size | subclusters=on | subclusters=off |
>> |-++-|
>> | 2 MB (256 KB) | 571 IOPS | 124 IOPS |
>> | 1 MB
On Fri 28 Jun 2019 11:20:57 AM CEST, Kevin Wolf wrote:
>> >> I would consider 64k cluster/8k subcluster as too extreme for me.
>>
>> I forgot to add: this 64k/8k ratio is only with my current prototype.
>>
>> In practice if we go with the 128-bit L2 entries we would have 64
>> subclusters per clu
On Thu 27 Jun 2019 05:38:56 PM CEST, Alberto Garcia wrote:
>> I would consider 64k cluster/8k subcluster as too extreme for me.
I forgot to add: this 64k/8k ratio is only with my current prototype.
In practice if we go with the 128-bit L2 entries we would have 64
subclusters per cluster,
On Thu 27 Jun 2019 04:19:25 PM CEST, Denis Lunev wrote:
> Right now QCOW2 is not very efficient with default cluster size (64k)
> for fast performance with big disks. Nowadays ppl uses really BIG
> images and 1-2-3-8 Tb disks are really common. Unfortunately ppl want
> to get random IO fast too.
Hi all,
a couple of years ago I came to the mailing list with a proposal to
extend the qcow2 format to add subcluster allocation.
You can read the original message (and the discussion thread that came
afterwards) here:
https://lists.gnu.org/archive/html/qemu-block/2017-04/msg00178.html
The d
at
> operation; if “Creating a snapshot” creates a file, that file must be
> the snapshot, right? Well, no, it isn’t.)
>
> Let’s fix this as best as we can. Better Nate than lever.
Reviewed-by: Alberto Garcia
Berto
On Mon 27 May 2019 03:44:59 PM CEST, Anton Nefedov wrote:
>> I think in general optimizing for SSDs should probably be the
>> default. HDDs are slow anyway, so whoever uses them probably doesn’t
>> care about performance too much anyway...? Whereas people using SSDs
>> probably do. But as I said
On Mon 27 May 2019 02:16:53 PM CEST, Max Reitz wrote:
> On 26.05.19 17:08, Alberto Garcia wrote:
>> On Fri 24 May 2019 07:28:10 PM CEST, Max Reitz wrote:
>>> +##
>>> +# @ImageRotationalInfo:
>>> +#
>>> +# Indicates whether an image is stored on a rot
On Fri 24 May 2019 07:28:10 PM CEST, Max Reitz wrote:
> +##
> +# @ImageRotationalInfo:
> +#
> +# Indicates whether an image is stored on a rotating disk or not.
> +#
> +# @solid-state: Image is stored on a solid-state drive
> +#
> +# @rotating:Image is stored on a rotating disk
What happens w
On Fri 24 May 2019 03:56:21 PM CEST, Max Reitz wrote:
>> +---+---+--+---+--+--+
>> | file|before| after| gain |
>> +---+---+--+---+--+--+
>> |ssd| 61.153 | 36.313 | 41% |
>> |
On Mon 13 May 2019 03:46:17 PM CEST, Alberto Garcia wrote:
> Now bdrv_close() unrefs all children (before this patch it was only
> bs->file and bs->backing). As a result, none of the callers of
> brvd_attach_child() should remove their reference to child_bs (because
> this fu
perform_cow().
>
> iotest 060:
> write to the discarded cluster does not trigger COW anymore.
> Use a backing image instead.
>
> Signed-off-by: Anton Nefedov
Reviewed-by: Alberto Garcia
Berto
On Mon 20 May 2019 08:20:23 AM CEST, Denis Plotnikov wrote:
> +/* Compression type extension */
> +if (s->compression_type != 0) {
> +Qcow2CompressionTypeExt comp_header = {
> +.compression_type = cpu_to_be32(s->compression_type),
> +};
Shouldn't we have an enum
rate limiting) for the
> active commit job, because It never completes without an explicit
> block-job-complete anyway.
>
> Signed-off-by: Max Reitz
Reviewed-by: Alberto Garcia
Berto
On Wed 15 May 2019 10:15:02 PM CEST, Max Reitz wrote:
> log() is in the current module, there is no need to prefix it. In fact,
> doing so may make VM.run_job() unusable in tests that never use
> iotests.log() themselves.
>
> Signed-off-by: Max Reitz
Reviewed-by: Alberto Garcia
Berto
f-by: Max Reitz
Reviewed-by: Alberto Garcia
Berto
On Wed 15 May 2019 10:15:00 PM CEST, Max Reitz wrote:
> This message does not make any sense when it appears as the response to
> making an R/W node read-only. We should detect that case and emit a
> different message, then.
>
> Signed-off-by: Max Reitz
Reviewed-by: Alberto Garcia
Berto
There are a few places in which we turn a number of bytes into sectors
in order to compare the result against BDRV_REQUEST_MAX_SECTORS
instead of using BDRV_REQUEST_MAX_BYTES directly.
Signed-off-by: Alberto Garcia
---
block/io.c | 6 +++---
qemu-io-cmds.c | 7 +++
2 files changed, 6
On Tue 14 May 2019 03:02:33 PM CEST, Max Reitz wrote:
>> Why would both be fine? backing_file refers to the backing file
>> currently attached, and auto_backing_file refers to the one written
>> on the image metadata, or am I wrong?
>
> After my series, backing_file refers to the image metadata.
I
On Sat 13 Apr 2019 02:53:42 AM CEST, Max Reitz wrote:
>> Calling x-blockdev-reopen without 'backing' should only fail if
>>
>> a) the image has a backing file attached to it.
>> In this case it doesn't: we just detached it in the previous line.
>>
>> b) there's a default backing file writte
On Mon 13 May 2019 04:31:16 PM CEST, Max Reitz wrote:
>> @@ -2569,10 +2582,6 @@ BdrvChild *bdrv_open_child(const char *filename,
>> }
>>
>> c = bdrv_attach_child(parent, bs, bdref_key, child_role, errp);
>> -if (!c) {
>> -bdrv_unref(bs);
>> -return NULL;
>> -}
>>
-by: Alberto Garcia
---
block.c | 25 +
block/block-backend.c | 3 +--
block/quorum.c| 1 -
blockjob.c| 2 +-
4 files changed, 19 insertions(+), 12 deletions(-)
diff --git a/block.c b/block.c
index 3c3bd0f8d2..df727314ff 100644
--- a
/archive/html/qemu-block/2019-03/msg01040.html
Alberto Garcia (2):
block: Use bdrv_unref_child() for all children in bdrv_close()
block: Make bdrv_root_attach_child() unref child_bs on failure
block.c | 41 -
block/block-backend.c
>backing). As a result, none of the callers of
brvd_attach_child() should remove their reference to child_bs (because
this function effectively steals that reference). This patch updates a
couple of tests that where doing their own bdrv_unref().
Signed-off-by: Alberto Garcia
---
b
On Mon 13 May 2019 03:14:40 PM CEST, Stefano Garzarella wrote:
>> Since the maximum allowed cluster size is 2MB, the value of the
>> 'size' variable can never be larger than 4MB, which fits comfortably
>> on a 32-bit integer. We would need to support 512MB clusters in order
>> to have problems with
On Mon 13 May 2019 01:28:46 PM CEST, Stefano Garzarella wrote:
>> +int size = QCOW2_COMPRESSED_SECTOR_SIZE *
>> +(((l2_entry >> s->csize_shift) & s->csize_mask) + 1);
>
> What about using int64_t type for the 'size' variable?
> (because the qcow2_free_clusters() 'size' p
-off-by: Alberto Garcia
---
block/qcow2-cluster.c | 5 +++--
block/qcow2-refcount.c | 25 ++---
block/qcow2.c | 3 ++-
block/qcow2.h | 4
4 files changed, 23 insertions(+), 14 deletions(-)
diff --git a/block/qcow2-cluster.c b/block/qcow2-cluster.c
s locking, so reduce locking to it.
>
> Signed-off-by: Vladimir Sementsov-Ogievskiy
Reviewed-by: Alberto Garcia
Berto
son not to use bdrv_unref_child() in
bdrv_close() anymore.
After this there's also no need to remove bs->backing and bs->file
separately from the rest of the children, so bdrv_close() can be
simplified.
This patch also updates a couple of tests that were doing their own
bdrv_unref().
Sign
t
and size of the compressed data) and the situation with them is
similar. In this case the masks are not constant but are stored in the
csize_mask and cluster_offset_mask fields of BDRVQcow2State.
Signed-off-by: Alberto Garcia
---
block/qcow2-cluster.c | 14 --
1 file changed, 12 inser
The last user of this field disappeared when we replace the
sector-based bdrv_write() with the byte-based bdrv_pwrite().
Signed-off-by: Alberto Garcia
---
block/qcow2.c | 1 -
block/qcow2.h | 1 -
2 files changed, 2 deletions(-)
diff --git a/block/qcow2.c b/block/qcow2.c
index a520d116ef
No one is using these functions anymore, all callers have switched to
the byte-based bdrv_pread() and bdrv_pwrite()
Signed-off-by: Alberto Garcia
---
block/io.c| 43 +++
include/block/block.h | 4
2 files changed, 7 insertions(+), 40
There's only one bdrv_write() call left in the qcow2 code, and it can
be trivially replaced with the byte-based bdrv_pwrite().
Signed-off-by: Alberto Garcia
---
block/qcow2-refcount.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/block/qcow2-refcount.c b/block/
v_pwrite()'
002/5:[0006] [FC] 'vdi: Replace bdrv_{read,write}() with bdrv_{pread,pwrite}()'
003/5:[0004] [FC] 'vvfat: Replace bdrv_{read,write}() with
bdrv_{pread,pwrite}()'
004/5:[0007] [FC] 'block: Remove bdrv_read() and bdrv_write()'
005/5:[] [--] 'qcow2:
There's only a couple of bdrv_read() and bdrv_write() calls left in
the vdi code, and they can be trivially replaced with the byte-based
bdrv_pread() and bdrv_pwrite().
Signed-off-by: Alberto Garcia
---
block/vdi.c | 15 +--
1 file changed, 9 insertions(+), 6 deletions(-)
There's only a couple of bdrv_read() and bdrv_write() calls left in
the vvfat code, and they can be trivially replaced with the byte-based
bdrv_pread() and bdrv_pwrite().
Signed-off-by: Alberto Garcia
---
block/vvfat.c | 12 +++-
1 file changed, 7 insertions(+), 5 deletions(-)
from errno.h.
c) Both qcow2_compress() and qcow2_co_do_compress() return a negative
value on failure, but qcow2_co_pwritev_compressed() stores the
value in an unsigned data type.
Signed-off-by: Alberto Garcia
---
block/qcow2.c | 18 +-
1 file changed, 9 insertions(+), 9
There's only a couple of bdrv_read() and bdrv_write() calls left in
the vdi code, and they can be trivially replaced with the byte-based
bdrv_pread() and bdrv_pwrite().
Signed-off-by: Alberto Garcia
---
block/vdi.c | 11 ++-
1 file changed, 6 insertions(+), 5 deletions(-)
diff --
The last user of this field disappeared when we replace the
sector-based bdrv_write() with the byte-based bdrv_pwrite().
Signed-off-by: Alberto Garcia
---
block/qcow2.c | 1 -
block/qcow2.h | 1 -
2 files changed, 2 deletions(-)
diff --git a/block/qcow2.c b/block/qcow2.c
index 3ace3b2209
Hi,
this API only had a few users left so it can be easily removed.
Regards,
Berto
Alberto Garcia (5):
qcow2: Replace bdrv_write() with bdrv_pwrite()
vdi: Replace bdrv_{read,write}() with bdrv_{pread,pwrite}()
vvfat: Replace bdrv_{read,write}() with bdrv_{pread,pwrite}()
block: Remove
There's only one bdrv_write() call left in the qcow2 code, and it can
be trivially replaced with the byte-based bdrv_pwrite().
Signed-off-by: Alberto Garcia
---
block/qcow2-refcount.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/block/qcow2-refcount.c b/block/
801 - 900 of 3247 matches
Mail list logo