05.05.2020 14:06, Max Reitz wrote:
On 29.04.20 15:08, Vladimir Sementsov-Ogievskiy wrote:
Hi all!
v4
01: add Max's r-b
04: move variable definition to the top of the block, add Max's r-b
05: - change error-codes in block_copy_task_run(), document them
and be more accurate about error
01.05.2020 6:04, Andrey Shinkevich wrote:
Sounds good to me generally.
Also, we need to identify the filter by its node name when the file names of a
node and of the filter above it are the same. And what about automatically
generated node name for the filter? We will want to pass it to the
On 2020/5/1 下午12:01, Yuri Benditovich wrote:
Michael/Jason,
As Linux headers was updated in qemu and now include RSC/RSS/Hash
definitions, please let me know what you prefer:
1. You apply this series as is, then I submit clean-up series that
will remove all the redundant defines from
Hi Andreas,
so the only upgrade you did to trigger this for you was to bump the kernel from
5.4.0-28.33 to 5.4.0-29.34 - nothing else? I have not (yet?) heard other
similar reports, but it might be just too early?
At least on my system for now things still work with the new kernel like before.
Thank you for your reply. I think the code should add the handling for
packed ring size to follow the spec.
-Original Message-
From: boun...@canonical.com On Behalf Of Yonggang Luo
Sent: Wednesday, May 6, 2020 12:32 PM
To: Ding, Xuan
Subject: Re: [Bug 1877015] [NEW] virtio only support
Thank you for your reply. I think the code should add the handling for
packed ring size to follow the spec.
--
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1877015
Title:
virtio only support packed
Maybe the virtio need to be revised?
On Wed, May 6, 2020 at 10:51 AM xuan <1877...@bugs.launchpad.net> wrote:
> Public bug reported:
>
> Issue discription:
> When QEMU starts with "-device
>
[Expired for QEMU because there has been no activity for 60 days.]
** Changed in: qemu
Status: Incomplete => Expired
--
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1860056
Title:
mips
Fix two memleaks in multifd_send_thread/multifd_new_send_channel_async when
error happen.
Pan Nengyuan (2):
migration/multifd: fix memleaks in multifd_new_send_channel_async
migration/multifd: Do error_free after migrate_set_error to avoid
memleaks
migration/multifd.c | 5 +
1 file
When error happen in multifd_send_thread, it use error_copy to set migrate
error in
multifd_send_terminate_threads(). We should call error_free after it.
Similarly, fix another two places in multifd_recv_thread/multifd_save_cleanup.
The leak stack:
Direct leak of 48 byte(s) in 1 object(s)
When error happen in multifd_new_send_channel_async, 'sioc' will not be used
to create the multifd_send_thread. Let's free it to avoid a memleak. And also
do error_free after migrate_set_error() to avoid another leak in the same place.
The leak stack:
Direct leak of 2880 byte(s) in 8 object(s)
** Summary changed:
- virtio only support packed ring size power of 2 between 256 and 1024
+ virtio only support packed ring size power of 2
--
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1877015
Public bug reported:
Issue discription:
When QEMU starts with "-device
virtio-net-pci,netdev=netdev0,mac=52:54:00:00:00:01,disable-modern=false,mrg_rxbuf=on,rx_queue_size=1025,tx_queue_size=1025,mq=on,vectors=15,packed=on"
It raises error: Invalid rx_queue_size (= 1025), must be a power of 2
On Tue, May 05, 2020 at 02:38:17PM -0400, Daniele Buono wrote:
> Starting with Clang v9, -Wtype-limits is implemented and triggers a
> few "result of comparison is always true" errors when compiling PPC32
> targets.
>
> The comparisons seem to be necessary only on PPC64, since the
> else branch
Hi, Aleksandar,
On Tue, May 5, 2020 at 6:12 PM Aleksandar Markovic
wrote:
>
>
>
> уторак, 05. мај 2020., chen huacai је написао/ла:
>>
>> Hi, Aleksandar,
>>
>> On Sun, May 3, 2020 at 6:50 PM Aleksandar Markovic
>> wrote:
>> >
>> > нед, 3. мај 2020. у 12:21 Huacai Chen је
>> > написао/ла:
>>
Hi Alistair,
On Wed, May 6, 2020 at 6:37 AM Alistair Francis wrote:
>
> On Tue, May 5, 2020 at 1:34 PM Alistair Francis wrote:
> >
> > On Fri, May 1, 2020 at 5:21 AM Bin Meng wrote:
> > >
> > > From: Bin Meng
> > >
> > > Per QEMU deprecated doc, QEMU 4.1 introduced support for the -bios
> > >
Patchew URL: https://patchew.org/QEMU/20200505152926.18877-1-arm...@redhat.com/
Hi,
This series seems to have some coding style problems. See output below for
more information:
Message-id: 20200505152926.18877-1-arm...@redhat.com
Subject: [PATCH v2 00/18] qom: Spring cleaning
Type: series
The RISC-V ISA spec version 1.09.1 has been deprecated in QEMU since
4.1. It's not commonly used so let's remove support for it.
Signed-off-by: Alistair Francis
---
target/riscv/cpu.c| 30 ---
target/riscv/cpu.h| 8 --
The ISA specific Spike machines have been deprecated in QEMU since 4.1,
let's finally remove them.
Signed-off-by: Alistair Francis
---
hw/riscv/spike.c | 217 ---
include/hw/riscv/spike.h | 6 +-
2 files changed, 2 insertions(+), 221 deletions(-)
Alistair Francis (2):
hw/riscv: spike: Remove deprecated ISA specific machines
target/riscv: Drop support for ISA spec version 1.09.1
hw/riscv/spike.c | 217 --
include/hw/riscv/spike.h | 6 +-
target/riscv/cpu.c
Patchew URL: https://patchew.org/QEMU/20200505152926.18877-1-arm...@redhat.com/
Hi,
This series seems to have some coding style problems. See output below for
more information:
Message-id: 20200505152926.18877-1-arm...@redhat.com
Subject: [PATCH v2 00/18] qom: Spring cleaning
Type: series
fyi, I backported that fix also to focal/groovy and eoan, and with those
builds. On my test systems the hang reliable occurs within 20
iterations. After the fix, they have survived > 500 iterations thus far.
I'll leave running overnight just to be sure.
--
You received this bug notification
Patchew URL: https://patchew.org/QEMU/20200505152926.18877-1-arm...@redhat.com/
Hi,
This series seems to have some coding style problems. See output below for
more information:
Message-id: 20200505152926.18877-1-arm...@redhat.com
Subject: [PATCH v2 00/18] qom: Spring cleaning
Type: series
-20200505
for you to fetch changes up to f08085f49fb66a5cdc86653bd896d0e728bcee50:
hw/core/register: Add register_init_block8 helper. (2020-05-05 13:37:51 -0700)
Pull request for RegisterAPI
This is a single patch to add support
From: Joaquin de Andres
There was no support for 8 bits block registers. Changed
register_init_block32 to be generic and static, adding register
size in bits as parameter. Created one helper for each size.
Signed-off-by: Joaquin de Andres
Message-Id:
On Tue, May 5, 2020 at 1:34 PM Alistair Francis wrote:
>
> On Fri, May 1, 2020 at 5:21 AM Bin Meng wrote:
> >
> > From: Bin Meng
> >
> > Per QEMU deprecated doc, QEMU 4.1 introduced support for the -bios
> > option in QEMU for RISC-V for the virt machine and sifive_u machine.
> > The default
Hi Seiger,
I am not an expert on libvirt. I mostly use qemu command line for my test. I
was able to achieve the 3960X configuration with the following command line.
# qemu-system-x86_64 -name rhel7 -m 16384 -smp
24,cores=12,threads=2,sockets=1 -hda vdisk.qcow2 -enable-kvm -net nic
-net
On 5/5/20 12:38 PM, Alberto Garcia 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:
1) If we are writing to a newly allocated cluster then we
I’m looking at a testcase failure when my target uses 64bit time in msg.h
(struct msqid_ds). I’ve been able to get around this but changing
target_msqid_ds like so:
@@ -3900,18 +3901,9 @@ static inline abi_long do_semop(int semid, abi_long ptr,
unsigned nsops)
struct target_msqid_ds
{
Patchew URL: https://patchew.org/QEMU/20200505152926.18877-1-arm...@redhat.com/
Hi,
This series seems to have some coding style problems. See output below for
more information:
Message-id: 20200505152926.18877-1-arm...@redhat.com
Subject: [PATCH v2 00/18] qom: Spring cleaning
Type: series
On 5/4/20 8:05 AM, Max Reitz wrote:
On 21.04.20 23:20, Eric Blake wrote:
Add a new test covering the 'qemu-img bitmap' subcommand, as well as
'qemu-img convert --bitmaps', both added in recent patches.
Signed-off-by: Eric Blake
+echo
+echo "=== Bitmap preservation not possible to non-qcow2
On 5/5/20 12:38 PM, Alberto Garcia wrote:
This helper function tells us if a cluster is allocated (that is,
there is an associated host offset for it).
Signed-off-by: Alberto Garcia
---
block/qcow2.h | 6 ++
1 file changed, 6 insertions(+)
Reviewed-by: Eric Blake
diff --git
On 5/5/20 12:38 PM, Alberto Garcia wrote:
This patch adds QCow2SubclusterType, which is the subcluster-level
version of QCow2ClusterType. All QCOW2_SUBCLUSTER_* values have the
the same meaning as their QCOW2_CLUSTER_* equivalents (when they
exist). See below for details and caveats.
In images
Patchew URL: https://patchew.org/QEMU/20200505200819.5662-1-mlevi...@redhat.com/
Hi,
This series seems to have some coding style problems. See output below for
more information:
Message-id: 20200505200819.5662-1-mlevi...@redhat.com
Subject: [PATCH v4 00/14] LUKS: encryption slot management
On May 5 07:48, Klaus Jensen wrote:
> From: Klaus Jensen
>
> The num_queues device paramater has a slightly confusing meaning because
> it accounts for the admin queue pair which is not really optional.
> Secondly, it is really a maximum value of queues allowed.
>
> Add a new max_ioqpairs
On Fri, May 1, 2020 at 11:51 AM Jose Martins wrote:
>
> The spec states that on sv39x4 guest physical "address bits 63:41 must
> all be zeros, or else a guest-page-fault exception occurs.". However,
> the check performed for these top bits of the virtual address on the
> second stage is the
On Fri, May 1, 2020 at 5:21 AM Bin Meng wrote:
>
> From: Bin Meng
>
> Per QEMU deprecated doc, QEMU 4.1 introduced support for the -bios
> option in QEMU for RISC-V for the virt machine and sifive_u machine.
> The default behavior has been that QEMU does not automatically load
> any firmware if
From: Klaus Jensen
First, since the device only supports MSI-X or pin-based interrupt, if
MSI-X is not enabled, it should not accept interrupt vectors different
from 0 when creating completion queues.
Secondly, the irq_status NvmeCtrl member is meant to be compared to the
INTMS register, so it
From: Klaus Jensen
Klaus Jensen (2):
hw/block/nvme: fix pin-based interrupt behavior
hw/block/nvme: allow use of any valid msix vector
hw/block/nvme.c | 14 +-
hw/block/nvme.h | 2 +-
2 files changed, 10 insertions(+), 6 deletions(-)
--
2.26.2
From: Klaus Jensen
If the device uses MSI-X, any of the 2048 MSI-X interrupt vectors are
valid. If the device is not using MSI-X, vector will and can only be
zero at this point.
Signed-off-by: Klaus Jensen
---
hw/block/nvme.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git
Patchew URL: https://patchew.org/QEMU/20200505152926.18877-1-arm...@redhat.com/
Hi,
This series seems to have some coding style problems. See output below for
more information:
Message-id: 20200505152926.18877-1-arm...@redhat.com
Subject: [PATCH v2 00/18] qom: Spring cleaning
Type: series
Signed-off-by: Maxim Levitsky
Reviewed-by: Daniel P. Berrangé
---
block/crypto.c | 72
qapi/block-core.json | 14 -
2 files changed, 66 insertions(+), 20 deletions(-)
diff --git a/block/crypto.c b/block/crypto.c
index
blockdev-amend will be used similiar to blockdev-create
to allow on the fly changes of the structure of the format based block devices.
Current plan is to first support encryption keyslot management for luks
based formats (raw and embedded in qcow2)
Signed-off-by: Maxim Levitsky
Reviewed-by:
Currently the implementation only supports amending the encryption
options, unlike the qemu-img version
Signed-off-by: Maxim Levitsky
Reviewed-by: Daniel P. Berrangé
---
block/qcow2.c| 39 +++
qapi/block-core.json | 16 +++-
2 files
Now that we have all the infrastructure in place,
wire it in the qcow2 driver and expose this to the user.
Signed-off-by: Maxim Levitsky
Reviewed-by: Daniel P. Berrangé
---
block/qcow2.c | 72 +-
tests/qemu-iotests/082.out | 45
This allows more tests to be able to have same output on both qcow2 luks
encrypted images
and raw luks images
Signed-off-by: Maxim Levitsky
Reviewed-by: Daniel P. Berrangé
---
tests/qemu-iotests/087.out | 6 ++---
tests/qemu-iotests/134.out | 2 +-
tests/qemu-iotests/158.out
This commit adds two tests that cover the
new blockdev-amend functionality of luks and qcow2 driver
Signed-off-by: Maxim Levitsky
Reviewed-by: Daniel P. Berrangé
---
tests/qemu-iotests/302 | 278 +
tests/qemu-iotests/302.out | 40 ++
This commit adds two tests, which test the new amend interface
of both luks raw images and qcow2 luks encrypted images.
Signed-off-by: Maxim Levitsky
Reviewed-by: Daniel P. Berrangé
---
tests/qemu-iotests/300 | 207 +
tests/qemu-iotests/300.out | 99
rename the write_func to create_write_func, and init_func to create_init_func.
This is preparation for other write_func that will be used to update the
encryption keys.
No functional changes
Signed-off-by: Maxim Levitsky
Reviewed-by: Daniel P. Berrangé
---
block/crypto.c | 25
This implements the encryption key management using the generic code in
qcrypto layer and exposes it to the user via qemu-img
This code adds another 'write_func' because the initialization
write_func works directly on the underlying file, and amend
works on instance of luks device.
This commit
Some options are only useful for creation
(or hard to be amended, like cluster size for qcow2), while some other
options are only useful for amend, like upcoming keyslot management
options for luks
Since currently only qcow2 supports amend, move all its options
to a common macro and then include
Some qcow2 create options can't be used for amend.
Remove them from the qcow2 create options and add generic logic to detect
such options in qemu-img
Signed-off-by: Maxim Levitsky
Reviewed-by: Daniel P. Berrangé
---
block/qcow2.c | 108 ++---
qemu-img.c
This will be used first to implement luks keyslot management.
block_crypto_amend_opts_init will be used to convert
qemu-img cmdline to QCryptoBlockAmendOptions
Signed-off-by: Maxim Levitsky
Reviewed-by: Daniel P. Berrangé
---
block/crypto.c | 17 +
block/crypto.h
Next few patches will expose that functionality
to the user.
Signed-off-by: Maxim Levitsky
---
crypto/block-luks.c | 395 +++-
qapi/crypto.json| 61 ++-
2 files changed, 452 insertions(+), 4 deletions(-)
diff --git a/crypto/block-luks.c
On Thu, Apr 30, 2020 at 9:31 AM Edgar E. Iglesias
wrote:
>
> From: "Edgar E. Iglesias"
>
> Add support for stream fragments.
>
> Signed-off-by: Edgar E. Iglesias
Reviewed-by: Alistair Francis
Alistair
> ---
> hw/dma/xilinx_axidma.c | 14 +++---
> 1 file changed, 7 insertions(+), 7
'force' option will be used for some unsafe amend operations.
This includes things like erasing last keyslot in luks based formats
(which destroys the data, unless the master key is backed up
by external means), but that _might_ be desired result.
Signed-off-by: Maxim Levitsky
Reviewed-by:
Hi!
Here is the updated series of my patches, incorporating all the feedback I
received.
This implements the API interface that we agreed upon except that I merged the
LUKSKeyslotActive/LUKSKeyslotInactive union into a struct because otherwise
I need nested unions which are not supported
On Thu, Apr 30, 2020 at 9:31 AM Edgar E. Iglesias
wrote:
>
> From: "Edgar E. Iglesias"
>
> Stream descriptor by descriptor from memory instead of
> buffering entire packets before pushing. This enables
> non-packet streaming clients to work and also lifts the
> limitation that our internal DMA
On Thu, Apr 30, 2020 at 9:34 AM Edgar E. Iglesias
wrote:
>
> From: "Edgar E. Iglesias"
>
> Since we're missing a maintainer, add myself.
>
> Signed-off-by: Edgar E. Iglesias
Reviewed-by: Alistair Francis
Alistair
> ---
> MAINTAINERS | 6 ++
> 1 file changed, 6 insertions(+)
>
> diff
On 5/5/20 12:38 PM, Alberto Garcia wrote:
Extended L2 entries are 128-bit wide: 64 bits for the entry itself and
64 bits for the subcluster allocation bitmap.
In order to support them correctly get/set_l2_entry() need to be
updated so they take the entry width into account in order to
calculate
On Fri, May 1, 2020 at 11:57 AM Jose Martins wrote:
>
> Reached out to Andrew Waterman. This was his response:
>
> "I think the encoding of the privileged modes is a red herring. HS is
> inherently more privileged than VS, since it controls memory
> protection and interrupt delegation for VS.
>
On 5/5/20 12:38 PM, Alberto Garcia wrote:
Like offset_into_cluster() and size_to_clusters(), but for
subclusters.
Signed-off-by: Alberto Garcia
---
block/qcow2.h | 10 ++
1 file changed, 10 insertions(+)
diff --git a/block/qcow2.h b/block/qcow2.h
index e68febb15b..8b1ed1cbcf 100644
On 5/5/20 12:38 PM, Alberto Garcia wrote:
Subcluster allocation in qcow2 is implemented by extending the
existing L2 table entries and adding additional information to
indicate the allocation status of each subcluster.
This patch documents the changes to the qcow2 format and how they
affect the
On 5/5/20 12:38 PM, Alberto Garcia wrote:
When writing to a qcow2 file there are two functions that take a
virtual offset and return a host offset, possibly allocating new
clusters if necessary:
- handle_copied() looks for normal data clusters that are already
allocated and have a
Hello Ike,
Please, let me know if you want me to go after the needed SRUs for this
fix or if you will.
I'll wait for the final feedback from tests with your PPA.
Cheers!
--
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
This patch fixes a compilation error with Clang v9 and higher in
target/ppc/translate.c, on a comparison that is always true in PPC32
because of type sizes.
More information about the issue are in the first version of the patch.
v2, changed to avoid the nested ifdef/conditional solution of v1,
Starting with Clang v9, -Wtype-limits is implemented and triggers a
few "result of comparison is always true" errors when compiling PPC32
targets.
The comparisons seem to be necessary only on PPC64, since the
else branch in PPC32 only has a "g_assert_not_reached();" in all cases.
This patch
Patchew URL: https://patchew.org/QEMU/20200505152926.18877-1-arm...@redhat.com/
Hi,
This series seems to have some coding style problems. See output below for
more information:
Message-id: 20200505152926.18877-1-arm...@redhat.com
Subject: [PATCH v2 00/18] qom: Spring cleaning
Type: series
On 5/4/20 4:36 PM, Joseph Myers wrote:
> Joseph Myers (4):
> softfloat: silence sNaN for conversions to/from floatx80
> softfloat: fix floatx80 pseudo-denormal addition / subtraction
> softfloat: fix floatx80 pseudo-denormal comparisons
> softfloat: fix floatx80 pseudo-denormal round to
* Florian Schmidt (flo...@nutanix.com) wrote:
> Hi,
Hi Florian,
> with precopy live migration, change in page size on source and
> destination is possible: using hugetlbfs memory backing for the VM on
> the source and anonymous memory on the destination, and vice versa. For
> postcopy
Patchew URL:
https://patchew.org/QEMU/20200505151055.5ead73a0...@moya.office.hostfission.com/
Hi,
This series seems to have some coding style problems. See output below for
more information:
Message-id: 20200505151055.5ead73a0...@moya.office.hostfission.com
Subject: [PATCH v6] audio/jack:
This commit adds a new audiodev backend to allow QEMU to use JACK as
both an audio sink and source.
Signed-off-by: Geoffrey McRae
---
audio/Makefile.objs| 5 +
audio/audio.c | 1 +
audio/audio_template.h | 2 +
audio/jackaudio.c | 677
This function returns an integer that can be either an error code or a
cluster type (a value from the QCow2ClusterType enum).
We are going to start using subcluster types instead of cluster types
in some functions so it's better to use the exact data types instead
of integers for clarity and in
Compressed clusters always have the bitmap part of the extended L2
entry set to 0.
Signed-off-by: Alberto Garcia
Reviewed-by: Max Reitz
---
block/qcow2-cluster.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/block/qcow2-cluster.c b/block/qcow2-cluster.c
index 4544a40aa0..0a295076a3
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
Reviewed-by: Max Reitz
Reviewed-by: Vladimir Sementsov-Ogievskiy
---
block/qcow2-refcount.c | 9 +++--
1 file
The bdrv_co_pwrite_zeroes() call here fills complete clusters with
zeroes, but it can happen that some subclusters are not part of the
write request or the copy-on-write. This patch makes sure that only
the affected subclusters are overwritten.
A potential improvement would be to also fill with
Hi,
here's the new version of the patches to add subcluster allocation
support to qcow2.
Please refer to the cover letter of the first version for a full
description of the patches:
https://lists.gnu.org/archive/html/qemu-block/2019-10/msg00983.html
Important changes here:
- I fixed
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:
1) If we are writing to a newly allocated cluster then we need
copy-on-write. The previous contents
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
Reviewed-by: Max Reitz
---
block/qcow2.c | 19 ---
1 file changed, 12 insertions(+), 7 deletions(-)
diff --git
Signed-off-by: Alberto Garcia
---
tests/qemu-iotests/271 | 664 +
tests/qemu-iotests/271.out | 519 +
tests/qemu-iotests/group | 1 +
3 files changed, 1184 insertions(+)
create mode 100755 tests/qemu-iotests/271
create
In order to support extended L2 entries some functions of the qcow2
driver need to start dealing with subclusters instead of clusters.
qcow2_get_host_offset() is modified to return the subcluster type
instead of the cluster type, and all callers are updated to replace
all values of
When writing to a qcow2 file there are two functions that take a
virtual offset and return a host offset, possibly allocating new
clusters if necessary:
- handle_copied() looks for normal data clusters that are already
allocated and have a reference count of 1. In those clusters we
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
Reviewed-by: Max Reitz
---
qapi/block-core.json | 7 +++
block/qcow2.h
This patch adds QCow2SubclusterType, which is the subcluster-level
version of QCow2ClusterType. All QCOW2_SUBCLUSTER_* values have the
the same meaning as their QCOW2_CLUSTER_* equivalents (when they
exist). See below for details and caveats.
In images without extended L2 entries clusters are
This works now at the subcluster level and pwrite_zeroes_alignment is
updated accordingly.
qcow2_cluster_zeroize() is turned into qcow2_subcluster_zeroize() with
the following changes:
- The request can now be subcluster-aligned.
- The cluster-aligned body of the request is still zeroized
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.h
Subcluster allocation in qcow2 is implemented by extending the
existing L2 table entries and adding additional information to
indicate the allocation status of each subcluster.
This patch documents the changes to the qcow2 format and how they
affect the calculation of the L2 cache size.
qcow2 images with subclusters have 128-bit L2 entries. The first 64
bits contain the same information as traditional images and the last
64 bits form a bitmap with the status of each individual subcluster.
Because of that we cannot assume that L2 entries are sizeof(uint64_t)
anymore. This
Extended L2 entries are 128-bit wide: 64 bits for the entry itself and
64 bits for the subcluster allocation bitmap.
In order to support them correctly get/set_l2_entry() need to be
updated so they take the entry width into account in order to
calculate the correct offset.
This patch also adds
This patch adds the following new fields to BDRVQcow2State:
- subclusters_per_cluster: Number of subclusters in a cluster
- subcluster_size: The size of each subcluster, in bytes
- subcluster_bits: No. of bits so 1 << subcluster_bits = subcluster_size
Images without subclusters are treated as if
This function is only used by qcow2_expand_zero_clusters() to
downgrade a qcow2 image to a previous version. It is however not
possible to downgrade an image with extended L2 entries because older
versions of qcow2 do not have this feature.
Signed-off-by: Alberto Garcia
---
The size of an L2 entry is 64 bits, but if we want to have subclusters
we need extended L2 entries. This means that we have to access L2
tables and slices differently depending on whether an image has
extended L2 entries or not.
This patch replaces all l2_slice[] accesses with calls to
We are going to need it in other places.
Signed-off-by: Alberto Garcia
Reviewed-by: Vladimir Sementsov-Ogievskiy
Reviewed-by: Max Reitz
---
block/qcow2-cluster.c | 34 +++---
1 file changed, 19 insertions(+), 15 deletions(-)
diff --git a/block/qcow2-cluster.c
Two things need to be taken into account here:
1) With full_discard == true the L2 entry must be cleared completely.
This also includes the L2 bitmap if the image has extended L2
entries.
2) With full_discard == false we have to make the discarded cluster
read back as zeroes. With
This helper function tells us if a cluster is allocated (that is,
there is an associated host offset for it).
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 be7816a3b8..b5db8d2f36 100644
---
qcow2_get_cluster_offset() takes an (unaligned) guest offset and
returns the (aligned) offset of the corresponding cluster in the qcow2
image.
In practice none of the callers need to know where the cluster starts
so this patch makes the function calculate and return the final host
offset
The QCOW_OFLAG_ZERO bit that indicates that a cluster reads as
zeroes is only used in standard L2 entries. Extended L2 entries use
individual 'all zeroes' bits for each subcluster.
This must be taken into account when updating the L2 entry and also
when deciding that an existing entry does not
The file_cluster_offset field of Qcow2AioTask stores a cluster-aligned
host offset. In practice this is not very useful because all users(*)
of this structure need the final host offset into the cluster, which
they calculate using
host_offset = file_cluster_offset + offset_into_cluster(s,
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
Reviewed-by: Max Reitz
Reviewed-by:
Like offset_into_cluster() and size_to_clusters(), but for
subclusters.
Signed-off-by: Alberto Garcia
---
block/qcow2.h | 10 ++
1 file changed, 10 insertions(+)
diff --git a/block/qcow2.h b/block/qcow2.h
index e68febb15b..8b1ed1cbcf 100644
--- a/block/qcow2.h
+++ b/block/qcow2.h
@@
1 - 100 of 385 matches
Mail list logo