qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] 209c07: iotests: Fix CID for VMDK afl image


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] 209c07: iotests: Fix CID for VMDK afl image
Date: Thu, 15 Feb 2018 02:13:49 -0800

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 209c07dbec78b62d8cf688ae64099694c42c6067
      
https://github.com/qemu/qemu/commit/209c07dbec78b62d8cf688ae64099694c42c6067
  Author: Fam Zheng <address@hidden>
  Date:   2018-02-13 (Tue, 13 Feb 2018)

  Changed paths:
    M tests/qemu-iotests/059.out
    M tests/qemu-iotests/sample_images/afl9.vmdk.bz2

  Log Message:
  -----------
  iotests: Fix CID for VMDK afl image

This reverts commit 76bf133c4 which updated the reference output, and
fixed the reference image, because the code path we want to exercise is
actually the invalid image size.

The descriptor block in the image, which includes the CID to verify, has been
invalid since the reference image was added. Since commit 9877860e7bd we report
this error earlier than the "file too large", so 059.out mismatches.

The binary change is generated along the operations of:

  $ bunzip2 afl9.vmdk.bz2
  $ qemu-img create -f vmdk fix.vmdk 1G
  $ dd if=afl9.vmdk of=fix.vmdk bs=512 count=1 conv=notrunc
  $ mv fix.vmdk afl9.vmdk
  $ bzip2 afl9.vmdk

Signed-off-by: Fam Zheng <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>


  Commit: c150eb92926ceb0cc6112c10e31e8af2f2d336cd
      
https://github.com/qemu/qemu/commit/c150eb92926ceb0cc6112c10e31e8af2f2d336cd
  Author: Fam Zheng <address@hidden>
  Date:   2018-02-13 (Tue, 13 Feb 2018)

  Changed paths:
    M qemu-img.texi

  Log Message:
  -----------
  qemu-img.texi: Clean up parameter list

Split options out of the "@table @var" section and create a "@table
@option", then use whitespaces and blank lines consistently.

Suggested-by: Kevin Wolf <address@hidden>
Signed-off-by: Fam Zheng <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Kashyap Chamarthy <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>


  Commit: a7e326df1c116e99e6e65ca02c6eadb5bd5aef45
      
https://github.com/qemu/qemu/commit/a7e326df1c116e99e6e65ca02c6eadb5bd5aef45
  Author: Fam Zheng <address@hidden>
  Date:   2018-02-13 (Tue, 13 Feb 2018)

  Changed paths:
    M qemu-img.texi

  Log Message:
  -----------
  qemu-img: Document --force-share / -U

Signed-off-by: Fam Zheng <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Kashyap Chamarthy <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>


  Commit: c1a4b6f9246bf2841b14b11d4c5a029429f0659a
      
https://github.com/qemu/qemu/commit/c1a4b6f9246bf2841b14b11d4c5a029429f0659a
  Author: Fam Zheng <address@hidden>
  Date:   2018-02-13 (Tue, 13 Feb 2018)

  Changed paths:
    M docs/qemu-block-drivers.texi

  Log Message:
  -----------
  docs: Document share-rw property more thoroughly

Suggested-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Fam Zheng <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Kashyap Chamarthy <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>


  Commit: de7269d293bc3a7fba98a0f12781eccb4ea4be1e
      
https://github.com/qemu/qemu/commit/de7269d293bc3a7fba98a0f12781eccb4ea4be1e
  Author: Alberto Garcia <address@hidden>
  Date:   2018-02-13 (Tue, 13 Feb 2018)

  Changed paths:
    M block/qcow2-cluster.c

  Log Message:
  -----------
  qcow2: Use g_try_realloc() in qcow2_expand_zero_clusters()

g_realloc() aborts the program if it fails to allocate the required
amount of memory. We want to detect that scenario and return an error
instead, so let's use g_try_realloc().

Signed-off-by: Alberto Garcia <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>


  Commit: cb2af9176fcb6b0b71bbac8c83498c4caa37ab05
      
https://github.com/qemu/qemu/commit/cb2af9176fcb6b0b71bbac8c83498c4caa37ab05
  Author: Paolo Bonzini <address@hidden>
  Date:   2018-02-13 (Tue, 13 Feb 2018)

  Changed paths:
    M blockdev.c

  Log Message:
  -----------
  block: early check for blockers on drive-mirror

Even if an op blocker is present for BLOCK_OP_TYPE_MIRROR_SOURCE,
it is checked a bit late and the result is that the target is
created even if drive-mirror subsequently fails.  Add an early
check to avoid this.

Signed-off-by: Paolo Bonzini <address@hidden>
Reviewed-by: Fam Zheng <address@hidden>
Reviewed-by: Alberto Garcia <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>


  Commit: 2782bb75e9ff6319386159577f544deb0f50f536
      
https://github.com/qemu/qemu/commit/2782bb75e9ff6319386159577f544deb0f50f536
  Author: Max Reitz <address@hidden>
  Date:   2018-02-13 (Tue, 13 Feb 2018)

  Changed paths:
    M tests/qemu-iotests/155

  Log Message:
  -----------
  iotests: Use virtio-blk in 155

Only a few select machine types support floppy drives and there is
actually nothing preventing us from using virtio here, so let's do it.

Reported-by: Christian Borntraeger <address@hidden>
Signed-off-by: Max Reitz <address@hidden>
Tested-by: Christian Borntraeger <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>


  Commit: 0e448a05444ddc602d2857a17f31042631a75946
      
https://github.com/qemu/qemu/commit/0e448a05444ddc602d2857a17f31042631a75946
  Author: Daniel P. Berrange <address@hidden>
  Date:   2018-02-13 (Tue, 13 Feb 2018)

  Changed paths:
    M qemu-io.c

  Log Message:
  -----------
  qemu-io: fix EOF Ctrl-D handling in qemu-io readline code

qemu-io puts the TTY into non-canonical mode, which means no EOF processing is
done and thus getchar() will never return the EOF constant. Instead we have to
query the TTY attributes to determine the configured EOF character (usually
Ctrl-D / 0x4), and then explicitly check for that value. This fixes the
regression that prevented Ctrl-D from triggering an exit of qemu-io that has
existed since readline was first added in

  commit 0cf17e181798063c3824c8200ba46f25f54faa1a
  Author: Stefan Hajnoczi <address@hidden>
  Date:   Thu Nov 14 11:54:17 2013 +0100

    qemu-io: use readline.c

It also ensures that a newline is printed when exiting, to complete the
line output by the "qemu-io> " prompt.

Signed-off-by: Daniel P. Berrange <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>


  Commit: 0375003df4153dce7f3ece9285b27427f00f9e01
      
https://github.com/qemu/qemu/commit/0375003df4153dce7f3ece9285b27427f00f9e01
  Author: Max Reitz <address@hidden>
  Date:   2018-02-13 (Tue, 13 Feb 2018)

  Changed paths:
    M block/gluster.c

  Log Message:
  -----------
  gluster: Move glfs_close() to create's clean-up

glfs_close() is a classical clean-up operation, as can be seen by the
fact that it is executed even if the truncation before it failed.
Also, moving it to clean-up makes it more clear that if it fails, we do
not want it to overwrite the current ret value if that signifies an
error already.

Signed-off-by: Max Reitz <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>


  Commit: 36e87909f8f324a7c442444e5cc02cc5efcdf360
      
https://github.com/qemu/qemu/commit/36e87909f8f324a7c442444e5cc02cc5efcdf360
  Author: Max Reitz <address@hidden>
  Date:   2018-02-13 (Tue, 13 Feb 2018)

  Changed paths:
    M block/gluster.c

  Log Message:
  -----------
  gluster: Pull truncation from qemu_gluster_create

Pull out the truncation code from the qemu_cluster_create() function so
we can later reuse it in qemu_gluster_truncate().

Signed-off-by: Max Reitz <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>


  Commit: f3a33f795cc7a3372d2372480d34f6b95a3b09b6
      
https://github.com/qemu/qemu/commit/f3a33f795cc7a3372d2372480d34f6b95a3b09b6
  Author: Max Reitz <address@hidden>
  Date:   2018-02-13 (Tue, 13 Feb 2018)

  Changed paths:
    M block/gluster.c

  Log Message:
  -----------
  gluster: Query current size in do_truncate()

Instead of expecting the current size to be 0, query it and allocate
only the area [current_size, offset) if preallocation is requested.

Signed-off-by: Max Reitz <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>


  Commit: c3132aff174ea35dd78bc8828fd79c28f9bc9a65
      
https://github.com/qemu/qemu/commit/c3132aff174ea35dd78bc8828fd79c28f9bc9a65
  Author: Max Reitz <address@hidden>
  Date:   2018-02-13 (Tue, 13 Feb 2018)

  Changed paths:
    M block/gluster.c

  Log Message:
  -----------
  gluster: Add preallocated truncation

By using qemu_do_cluster_truncate() in qemu_cluster_truncate(), we now
automatically have preallocated truncation.

Signed-off-by: Max Reitz <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>


  Commit: 8b9ad56e9cbfd852af53090d18bb32e94b539253
      
https://github.com/qemu/qemu/commit/8b9ad56e9cbfd852af53090d18bb32e94b539253
  Author: Max Reitz <address@hidden>
  Date:   2018-02-13 (Tue, 13 Feb 2018)

  Changed paths:
    M block/sheepdog.c

  Log Message:
  -----------
  sheepdog: Make sd_prealloc() take a BDS

We want to use this function in sd_truncate() later on, so taking a
filename is not exactly ideal.

Signed-off-by: Max Reitz <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>


  Commit: 1a62baf62bdc30ec4856ac569cefb9d831808253
      
https://github.com/qemu/qemu/commit/1a62baf62bdc30ec4856ac569cefb9d831808253
  Author: Max Reitz <address@hidden>
  Date:   2018-02-13 (Tue, 13 Feb 2018)

  Changed paths:
    M block/sheepdog.c

  Log Message:
  -----------
  sheepdog: Pass old and new size to sd_prealloc()

sd_prealloc() will now preallocate the area [old_size, new_size).  As
before, it rounds to buf_size and may thus overshoot and preallocate
areas that were not requested to be preallocated.  For image creation,
this is no change in behavior.  For truncation, this is in accordance
with the documentation for preallocated truncation.

Signed-off-by: Max Reitz <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>


  Commit: 74f1eabf9cbdd168f0aceae97a0f6645d1ce7ebd
      
https://github.com/qemu/qemu/commit/74f1eabf9cbdd168f0aceae97a0f6645d1ce7ebd
  Author: Max Reitz <address@hidden>
  Date:   2018-02-13 (Tue, 13 Feb 2018)

  Changed paths:
    M block/sheepdog.c

  Log Message:
  -----------
  sheepdog: Allow fully preallocated truncation

Signed-off-by: Max Reitz <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>


  Commit: 3e99da5e76a4e834e457cbef774ed5f83589c5e7
      
https://github.com/qemu/qemu/commit/3e99da5e76a4e834e457cbef774ed5f83589c5e7
  Author: Vladimir Sementsov-Ogievskiy <address@hidden>
  Date:   2018-02-13 (Tue, 13 Feb 2018)

  Changed paths:
    M block/dirty-bitmap.c
    M block/qcow2-bitmap.c
    M block/qcow2.c
    M block/qcow2.h
    M blockdev.c
    M include/block/dirty-bitmap.h
    M qapi/block-core.json
    M qemu-doc.texi
    M tests/qemu-iotests/165
    M tests/qemu-iotests/176

  Log Message:
  -----------
  block: maintain persistent disabled bitmaps

To maintain load/store disabled bitmap there is new approach:

 - deprecate @autoload flag of block-dirty-bitmap-add, make it ignored
 - store enabled bitmaps as "auto" to qcow2
 - store disabled bitmaps without "auto" flag to qcow2
 - on qcow2 open load "auto" bitmaps as enabled and others
   as disabled (except in_use bitmaps)

Also, adjust iotests 165 and 176 appropriately.

Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: d4c373b854f813a6c3b9f763c98723053aa80ac5
      
https://github.com/qemu/qemu/commit/d4c373b854f813a6c3b9f763c98723053aa80ac5
  Author: Alberto Garcia <address@hidden>
  Date:   2018-02-13 (Tue, 13 Feb 2018)

  Changed paths:
    M block/qcow2-cluster.c

  Log Message:
  -----------
  qcow2: Fix documentation of get_cluster_table()

This function has not been returning the offset of the L2 table since
commit 3948d1d4876065160583e79533bf604481063833

Signed-off-by: Alberto Garcia <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: 03019d73142f78c22b87b7162f3c4a390d7d839e
      
https://github.com/qemu/qemu/commit/03019d73142f78c22b87b7162f3c4a390d7d839e
  Author: Alberto Garcia <address@hidden>
  Date:   2018-02-13 (Tue, 13 Feb 2018)

  Changed paths:
    M block/qcow2-cache.c

  Log Message:
  -----------
  qcow2: Add table size field to Qcow2Cache

The table size in the qcow2 cache is currently equal to the cluster
size. This doesn't allow us to use the cache memory efficiently,
particularly with large cluster sizes, so we need to be able to have
smaller cache tables that are independent from the cluster size. This
patch adds a new field to Qcow2Cache that we can use instead of the
cluster size.

The current table size is still being initialized to the cluster size,
so there are no semantic changes yet, but this patch will allow us to
prepare the rest of the code and simplify a few function calls.

Signed-off-by: Alberto Garcia <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: 9869b27bb5c1c08f175804d287efc7b3c6a94e33
      
https://github.com/qemu/qemu/commit/9869b27bb5c1c08f175804d287efc7b3c6a94e33
  Author: Alberto Garcia <address@hidden>
  Date:   2018-02-13 (Tue, 13 Feb 2018)

  Changed paths:
    M block/qcow2-cache.c

  Log Message:
  -----------
  qcow2: Remove BDS parameter from qcow2_cache_get_table_addr()

This function was only using the BlockDriverState parameter to get the
cache table size (since it was equal to the cluster size). This is no
longer necessary so this parameter can be removed.

Signed-off-by: Alberto Garcia <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: b3b8b6d9c4c7885e39bebe02abf60855c233dc5c
      
https://github.com/qemu/qemu/commit/b3b8b6d9c4c7885e39bebe02abf60855c233dc5c
  Author: Alberto Garcia <address@hidden>
  Date:   2018-02-13 (Tue, 13 Feb 2018)

  Changed paths:
    M block/qcow2-cache.c

  Log Message:
  -----------
  qcow2: Remove BDS parameter from qcow2_cache_get_table_idx()

This function was only using the BlockDriverState parameter to get the
cache table size (since it was equal to the cluster size). This is no
longer necessary so this parameter can be removed.

Signed-off-by: Alberto Garcia <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: ebe988f318e1dc89d83572da4ba545619514ad1e
      
https://github.com/qemu/qemu/commit/ebe988f318e1dc89d83572da4ba545619514ad1e
  Author: Alberto Garcia <address@hidden>
  Date:   2018-02-13 (Tue, 13 Feb 2018)

  Changed paths:
    M block/qcow2-cache.c

  Log Message:
  -----------
  qcow2: Remove BDS parameter from qcow2_cache_table_release()

This function was only using the BlockDriverState parameter to get the
cache table size (since it was equal to the cluster size). This is no
longer necessary so this parameter can be removed.

Signed-off-by: Alberto Garcia <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: 2d135ee92d656f824504b603054435297552bd8b
      
https://github.com/qemu/qemu/commit/2d135ee92d656f824504b603054435297552bd8b
  Author: Alberto Garcia <address@hidden>
  Date:   2018-02-13 (Tue, 13 Feb 2018)

  Changed paths:
    M block/qcow2-cache.c
    M block/qcow2-cluster.c
    M block/qcow2-refcount.c
    M block/qcow2.h

  Log Message:
  -----------
  qcow2: Remove BDS parameter from qcow2_cache_entry_mark_dirty()

This function was only using the BlockDriverState parameter to pass it
to qcow2_cache_get_table_idx(). This is no longer necessary so this
parameter can be removed.

Signed-off-by: Alberto Garcia <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: 2013c3d44d75020292905828e02dd44520a26b7b
      
https://github.com/qemu/qemu/commit/2013c3d44d75020292905828e02dd44520a26b7b
  Author: Alberto Garcia <address@hidden>
  Date:   2018-02-13 (Tue, 13 Feb 2018)

  Changed paths:
    M block/qcow2-cache.c
    M block/qcow2-cluster.c
    M block/qcow2-refcount.c
    M block/qcow2.h

  Log Message:
  -----------
  qcow2: Remove BDS parameter from qcow2_cache_put()

This function was only using the BlockDriverState parameter to pass it
to qcow2_cache_get_table_idx(). This is no longer necessary so this
parameter can be removed.

Signed-off-by: Alberto Garcia <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: e64d4072d1f32128a03264df0539ed60395a17d0
      
https://github.com/qemu/qemu/commit/e64d4072d1f32128a03264df0539ed60395a17d0
  Author: Alberto Garcia <address@hidden>
  Date:   2018-02-13 (Tue, 13 Feb 2018)

  Changed paths:
    M block/qcow2-cache.c
    M block/qcow2.c
    M block/qcow2.h

  Log Message:
  -----------
  qcow2: Remove BDS parameter from qcow2_cache_destroy()

This function was never using the BlockDriverState parameter so it can
be safely removed.

Signed-off-by: Alberto Garcia <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: b2f68bffab1a0ec5fb5c913b22d8a75b24d7945d
      
https://github.com/qemu/qemu/commit/b2f68bffab1a0ec5fb5c913b22d8a75b24d7945d
  Author: Alberto Garcia <address@hidden>
  Date:   2018-02-13 (Tue, 13 Feb 2018)

  Changed paths:
    M block/qcow2-cache.c
    M block/qcow2.c
    M block/qcow2.h

  Log Message:
  -----------
  qcow2: Remove BDS parameter from qcow2_cache_clean_unused()

This function was only using the BlockDriverState parameter to pass it
to qcow2_cache_table_release(). This is no longer necessary so this
parameter can be removed.

Signed-off-by: Alberto Garcia <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: 77aadd7bedbd4455fb824d6426d11043fe921d85
      
https://github.com/qemu/qemu/commit/77aadd7bedbd4455fb824d6426d11043fe921d85
  Author: Alberto Garcia <address@hidden>
  Date:   2018-02-13 (Tue, 13 Feb 2018)

  Changed paths:
    M block/qcow2-cache.c
    M block/qcow2-refcount.c
    M block/qcow2.h

  Log Message:
  -----------
  qcow2: Remove BDS parameter from qcow2_cache_discard()

This function was only using the BlockDriverState parameter to pass it
to qcow2_cache_get_table_idx() and qcow2_cache_table_release(). This
is no longer necessary so this parameter can be removed.

Signed-off-by: Alberto Garcia <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: 6e6fa7605e8a7c08d873dba9e1688f93aac20fc5
      
https://github.com/qemu/qemu/commit/6e6fa7605e8a7c08d873dba9e1688f93aac20fc5
  Author: Alberto Garcia <address@hidden>
  Date:   2018-02-13 (Tue, 13 Feb 2018)

  Changed paths:
    M block/qcow2-cache.c
    M block/qcow2-refcount.c
    M block/qcow2.h

  Log Message:
  -----------
  qcow2: Remove BDS parameter from qcow2_cache_is_table_offset()

This function was only using the BlockDriverState parameter to pass it
to qcow2_cache_get_table_addr(). This is no longer necessary so this
parameter can be removed.

Signed-off-by: Alberto Garcia <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: 05b5b6ee54cf69e7053c73286aac354be754235e
      
https://github.com/qemu/qemu/commit/05b5b6ee54cf69e7053c73286aac354be754235e
  Author: Alberto Garcia <address@hidden>
  Date:   2018-02-13 (Tue, 13 Feb 2018)

  Changed paths:
    M block/qcow2-cluster.c
    M block/qcow2.h

  Log Message:
  -----------
  qcow2: Add offset_to_l1_index()

Similar to offset_to_l2_index(), this function returns the index in
the L1 table for a given guest offset. This is only used in a couple
of places and it's not a particularly complex calculation, but it
makes the code a bit more readable.

Although in the qcow2_get_cluster_offset() case the old code was
taking advantage of the l1_bits variable, we're going to get rid of
the other uses of l1_bits in a later patch anyway, so it doesn't make
sense to keep it just for this.

Signed-off-by: Alberto Garcia <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: 3c2e511a24b51c5bfc70d365b54ad8c612d3b07c
      
https://github.com/qemu/qemu/commit/3c2e511a24b51c5bfc70d365b54ad8c612d3b07c
  Author: Alberto Garcia <address@hidden>
  Date:   2018-02-13 (Tue, 13 Feb 2018)

  Changed paths:
    M block/qcow2.c
    M block/qcow2.h

  Log Message:
  -----------
  qcow2: Add l2_slice_size field to BDRVQcow2State

The BDRVQcow2State structure contains an l2_size field, which stores
the number of 64-bit entries in an L2 table.

For efficiency reasons we want to be able to load slices instead of
full L2 tables, so we need to know how many entries an L2 slice can
hold.

An L2 slice is the portion of an L2 table that is loaded by the qcow2
cache. At the moment that cache can only load complete tables,
therefore an L2 slice has the same size as an L2 table (one cluster)
and l2_size == l2_slice_size.

Later we'll allow smaller slices, but until then we have to use this
new l2_slice_size field to make the rest of the code ready for that.

Signed-off-by: Alberto Garcia <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: 8f8181757771f252106efe2d6e833aabf0b64d01
      
https://github.com/qemu/qemu/commit/8f8181757771f252106efe2d6e833aabf0b64d01
  Author: Alberto Garcia <address@hidden>
  Date:   2018-02-13 (Tue, 13 Feb 2018)

  Changed paths:
    M block/qcow2.h

  Log Message:
  -----------
  qcow2: Add offset_to_l2_slice_index()

Similar to offset_to_l2_index(), this function takes a guest offset
and returns the index in the L2 slice that contains its L2 entry.

An L2 slice has currently the same size as an L2 table (one cluster),
so both functions return the same value for now.

Signed-off-by: Alberto Garcia <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: e2b5713eb9a8545e00eaeb5350069ef40c6cc49a
      
https://github.com/qemu/qemu/commit/e2b5713eb9a8545e00eaeb5350069ef40c6cc49a
  Author: Alberto Garcia <address@hidden>
  Date:   2018-02-13 (Tue, 13 Feb 2018)

  Changed paths:
    M block/qcow2-cluster.c

  Log Message:
  -----------
  qcow2: Update l2_load() to support L2 slices

Each entry in the qcow2 L2 cache stores a full L2 table (which uses a
complete cluster in the qcow2 image). A cluster is usually too large
to be used efficiently as the size for a cache entry, so we want to
decouple both values by allowing smaller cache entries. Therefore the
qcow2 L2 cache will no longer return full L2 tables but slices
instead.

This patch updates l2_load() so it can handle L2 slices correctly.
Apart from the offset of the L2 table (which we already had) we also
need the guest offset in order to calculate which one of the slices
we need.

An L2 slice has currently the same size as an L2 table (one cluster),
so for now this function will load exactly the same data as before.

This patch also removes a stale comment about the return value being
a pointer to the L2 table. This function returns an error code since
55c17e9821c474d5fcdebdc82ed2fc096777d611.

Signed-off-by: Alberto Garcia <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: 6580bb09ab154143461e9ddc956dee3d81018660
      
https://github.com/qemu/qemu/commit/6580bb09ab154143461e9ddc956dee3d81018660
  Author: Alberto Garcia <address@hidden>
  Date:   2018-02-13 (Tue, 13 Feb 2018)

  Changed paths:
    M block/qcow2-cluster.c

  Log Message:
  -----------
  qcow2: Prepare l2_allocate() for adding L2 slice support

Adding support for L2 slices to l2_allocate() needs (among other
things) an extra loop that iterates over all slices of a new L2 table.

Putting all changes in one patch would make it hard to read because
all semantic changes would be mixed with pure indentation changes.

To make things easier this patch simply creates a new block and
changes the indentation of all lines of code inside it. Thus, all
modifications in this patch are cosmetic. There are no semantic
changes and no variables are renamed yet. The next patch will take
care of that.

Signed-off-by: Alberto Garcia <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: 3861946a5b423b71e677e79cc32c528174bdf9df
      
https://github.com/qemu/qemu/commit/3861946a5b423b71e677e79cc32c528174bdf9df
  Author: Alberto Garcia <address@hidden>
  Date:   2018-02-13 (Tue, 13 Feb 2018)

  Changed paths:
    M block/qcow2-cluster.c

  Log Message:
  -----------
  qcow2: Update l2_allocate() to support L2 slices

This patch updates l2_allocate() to support the qcow2 cache returning
L2 slices instead of full L2 tables.

The old code simply gets an L2 table from the cache and initializes it
with zeroes or with the contents of an existing table. With a cache
that returns slices instead of tables the idea remains the same, but
the code must now iterate over all the slices that are contained in an
L2 table.

Since now we're operating with slices the function can no longer
return the newly-allocated table, so it's up to the caller to retrieve
the appropriate L2 slice after calling l2_allocate() (note that with
this patch the caller is still loading full L2 tables, but we'll deal
with that in a separate patch).

Signed-off-by: Alberto Garcia <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Message-id: address@hidden
Reviewed-by: Max Reitz <address@hidden>
Signed-off-by: Max Reitz <address@hidden>


  Commit: 05f9ee4689b71e726c46e7477020ac4bf4814109
      
https://github.com/qemu/qemu/commit/05f9ee4689b71e726c46e7477020ac4bf4814109
  Author: Alberto Garcia <address@hidden>
  Date:   2018-02-13 (Tue, 13 Feb 2018)

  Changed paths:
    M block/qcow2-cluster.c

  Log Message:
  -----------
  qcow2: Refactor get_cluster_table()

After the previous patch we're now always using l2_load() in
get_cluster_table() regardless of whether a new L2 table has to be
allocated or not.

This patch refactors that part of the code to use one single l2_load()
call.

Signed-off-by: Alberto Garcia <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: c03bfc5bba594a961ddc3c755fd4c0e45c41bae4
      
https://github.com/qemu/qemu/commit/c03bfc5bba594a961ddc3c755fd4c0e45c41bae4
  Author: Alberto Garcia <address@hidden>
  Date:   2018-02-13 (Tue, 13 Feb 2018)

  Changed paths:
    M block/qcow2-cluster.c

  Log Message:
  -----------
  qcow2: Update get_cluster_table() to support L2 slices

This patch updates get_cluster_table() to return L2 slices instead of
full L2 tables.

The code itself needs almost no changes, it only needs to call
offset_to_l2_slice_index() instead of offset_to_l2_index(). This patch
also renames all the relevant variables and the documentation.

Signed-off-by: Alberto Garcia <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: fd630039c0478919434cd2f9a4b9a72f61312624
      
https://github.com/qemu/qemu/commit/fd630039c0478919434cd2f9a4b9a72f61312624
  Author: Alberto Garcia <address@hidden>
  Date:   2018-02-13 (Tue, 13 Feb 2018)

  Changed paths:
    M block/qcow2-cluster.c

  Log Message:
  -----------
  qcow2: Update qcow2_get_cluster_offset() to support L2 slices

qcow2_get_cluster_offset() checks how many contiguous bytes are
available at a given offset. The returned number of bytes is limited
by the amount that can be addressed without having to load more than
one L2 table.

Since we'll be loading L2 slices instead of full tables this patch
changes the limit accordingly using the size of the L2 slice for the
calculations instead of the full table size.

One consequence of this is that with small L2 slices operations such
as 'qemu-img map' will need to iterate in more steps because each
qcow2_get_cluster_offset() call will potentially return a smaller
number. However the code is already prepared for that so this doesn't
break semantics.

The l2_table variable is also renamed to l2_slice to reflect this, and
offset_to_l2_index() is replaced with offset_to_l2_slice_index().

Signed-off-by: Alberto Garcia <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: a002c0b09d3c48484225b268d0d3df8615d7f56c
      
https://github.com/qemu/qemu/commit/a002c0b09d3c48484225b268d0d3df8615d7f56c
  Author: Alberto Garcia <address@hidden>
  Date:   2018-02-13 (Tue, 13 Feb 2018)

  Changed paths:
    M block/qcow2-cluster.c

  Log Message:
  -----------
  qcow2: Update qcow2_alloc_cluster_link_l2() to support L2 slices

There's a loop in this function that iterates over the L2 entries in a
table, so now we need to assert that it remains within the limits of
an L2 slice.

Apart from that, this function doesn't need any additional changes, so
this patch simply updates the variable name from l2_table to l2_slice.

Signed-off-by: Alberto Garcia <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: cde917662a71bea9a42ae00c23235384df654804
      
https://github.com/qemu/qemu/commit/cde917662a71bea9a42ae00c23235384df654804
  Author: Alberto Garcia <address@hidden>
  Date:   2018-02-13 (Tue, 13 Feb 2018)

  Changed paths:
    M block/qcow2-cluster.c

  Log Message:
  -----------
  qcow2: Update handle_copied() to support L2 slices

handle_copied() loads an L2 table and limits the number of checked
clusters to the amount that fits inside that table. Since we'll be
loading L2 slices instead of full tables we need to update that limit.

Apart from that, this function doesn't need any additional changes, so
this patch simply updates the variable name from l2_table to l2_slice.

Signed-off-by: Alberto Garcia <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: 6d99a344473b2c5e2906489e3587b952d9b84a83
      
https://github.com/qemu/qemu/commit/6d99a344473b2c5e2906489e3587b952d9b84a83
  Author: Alberto Garcia <address@hidden>
  Date:   2018-02-13 (Tue, 13 Feb 2018)

  Changed paths:
    M block/qcow2-cluster.c

  Log Message:
  -----------
  qcow2: Update handle_alloc() to support L2 slices

handle_alloc() loads an L2 table and limits the number of checked
clusters to the amount that fits inside that table. Since we'll be
loading L2 slices instead of full tables we need to update that limit.

Apart from that, this function doesn't need any additional changes, so
this patch simply updates the variable name from l2_table to l2_slice.

Signed-off-by: Alberto Garcia <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: 21ab3add9c9564270a64c92fff448b3333b6d328
      
https://github.com/qemu/qemu/commit/21ab3add9c9564270a64c92fff448b3333b6d328
  Author: Alberto Garcia <address@hidden>
  Date:   2018-02-13 (Tue, 13 Feb 2018)

  Changed paths:
    M block/qcow2-cluster.c

  Log Message:
  -----------
  qcow2: Update discard_single_l2() to support L2 slices

discard_single_l2() limits the number of clusters to be discarded
to the amount that fits inside an L2 table. Since we'll be loading
L2 slices instead of full tables we need to update that limit. The
function is renamed to discard_in_l2_slice() for clarity.

Apart from that, this function doesn't need any additional changes, so
this patch simply updates the variable name from l2_table to l2_slice.

Signed-off-by: Alberto Garcia <address@hidden>
Message-id: address@hidden
Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Max Reitz <address@hidden>


  Commit: a9a9f8f0b6fae52296fe6cbcced9475aad485477
      
https://github.com/qemu/qemu/commit/a9a9f8f0b6fae52296fe6cbcced9475aad485477
  Author: Alberto Garcia <address@hidden>
  Date:   2018-02-13 (Tue, 13 Feb 2018)

  Changed paths:
    M block/qcow2-cluster.c

  Log Message:
  -----------
  qcow2: Update zero_single_l2() to support L2 slices

zero_single_l2() limits the number of clusters to be zeroed to the
amount that fits inside an L2 table. Since we'll be loading L2 slices
instead of full tables we need to update that limit. The function is
renamed to zero_in_l2_slice() for clarity.

Apart from that, this function doesn't need any additional changes, so
this patch simply updates the variable name from l2_table to l2_slice.

Signed-off-by: Alberto Garcia <address@hidden>
Message-id: address@hidden
Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Max Reitz <address@hidden>


  Commit: ca62dd5c2b1897a187c841371fef88263639ce0d
      
https://github.com/qemu/qemu/commit/ca62dd5c2b1897a187c841371fef88263639ce0d
  Author: Alberto Garcia <address@hidden>
  Date:   2018-02-13 (Tue, 13 Feb 2018)

  Changed paths:
    M block/qcow2-refcount.c

  Log Message:
  -----------
  qcow2: Prepare qcow2_update_snapshot_refcount() for adding L2 slice support

Adding support for L2 slices to qcow2_update_snapshot_refcount() needs
(among other things) an extra loop that iterates over all slices of
each L2 table.

Putting all changes in one patch would make it hard to read because
all semantic changes would be mixed with pure indentation changes.

To make things easier this patch simply creates a new block and
changes the indentation of all lines of code inside it. Thus, all
modifications in this patch are cosmetic. There are no semantic
changes and no variables are renamed yet. The next patch will take
care of that.

Signed-off-by: Alberto Garcia <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: 83ad165be74420bc5bbf0fe4f62b6f53b1fb6004
      
https://github.com/qemu/qemu/commit/83ad165be74420bc5bbf0fe4f62b6f53b1fb6004
  Author: Alberto Garcia <address@hidden>
  Date:   2018-02-13 (Tue, 13 Feb 2018)

  Changed paths:
    M block/qcow2-refcount.c

  Log Message:
  -----------
  qcow2: Update qcow2_update_snapshot_refcount() to support L2 slices

qcow2_update_snapshot_refcount() increases the refcount of all
clusters of a given snapshot. In order to do that it needs to load all
its L2 tables and iterate over their entries. Since we'll be loading
L2 slices instead of full tables we need to add an extra loop that
iterates over all slices of each L2 table.

This function doesn't need any additional changes so apart from that
this patch simply updates the variable name from l2_table to l2_slice.

Signed-off-by: Alberto Garcia <address@hidden>
Message-id: address@hidden
Reviewed-by: Max Reitz <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Max Reitz <address@hidden>


  Commit: 9b765486b7796bb775987dfbf5b99b9fdbc5e8ea
      
https://github.com/qemu/qemu/commit/9b765486b7796bb775987dfbf5b99b9fdbc5e8ea
  Author: Alberto Garcia <address@hidden>
  Date:   2018-02-13 (Tue, 13 Feb 2018)

  Changed paths:
    M block/qcow2-cluster.c

  Log Message:
  -----------
  qcow2: Read refcount before L2 table in expand_zero_clusters_in_l1()

At the moment it doesn't really make a difference whether we call
qcow2_get_refcount() before of after reading the L2 table, but if we
want to support L2 slices we'll need to read the refcount first.

This patch simply changes the order of those two operations to prepare
for that. The patch with the actual semantic changes will be easier to
read because of this.

Signed-off-by: Alberto Garcia <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: 226494ff69d3d0563d00c8dbab30e740191d4e93
      
https://github.com/qemu/qemu/commit/226494ff69d3d0563d00c8dbab30e740191d4e93
  Author: Alberto Garcia <address@hidden>
  Date:   2018-02-13 (Tue, 13 Feb 2018)

  Changed paths:
    M block/qcow2-cluster.c

  Log Message:
  -----------
  qcow2: Prepare expand_zero_clusters_in_l1() for adding L2 slice support

Adding support for L2 slices to expand_zero_clusters_in_l1() needs
(among other things) an extra loop that iterates over all slices of
each L2 table.

Putting all changes in one patch would make it hard to read because
all semantic changes would be mixed with pure indentation changes.

To make things easier this patch simply creates a new block and
changes the indentation of all lines of code inside it. Thus, all
modifications in this patch are cosmetic. There are no semantic
changes and no variables are renamed yet. The next patch will take
care of that.

Signed-off-by: Alberto Garcia <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: 415184f52031cd16ff7ea3702e0ef9f2f7edec9a
      
https://github.com/qemu/qemu/commit/415184f52031cd16ff7ea3702e0ef9f2f7edec9a
  Author: Alberto Garcia <address@hidden>
  Date:   2018-02-13 (Tue, 13 Feb 2018)

  Changed paths:
    M block/qcow2-cluster.c

  Log Message:
  -----------
  qcow2: Update expand_zero_clusters_in_l1() to support L2 slices

expand_zero_clusters_in_l1() expands zero clusters as a necessary step
to downgrade qcow2 images to a version that doesn't support metadata
zero clusters. This function takes an L1 table (which may or may not
be active) and iterates over all its L2 tables looking for zero
clusters.

Since we'll be loading L2 slices instead of full tables we need to add
an extra loop that iterates over all slices of each L2 table, and we
should also use the slice size when allocating the buffer used when
the L1 table is not active.

This function doesn't need any additional changes so apart from that
this patch simply updates the variable name from l2_table to l2_slice.

Finally, and since we have to touch the bdrv_read() / bdrv_write()
calls anyway, this patch takes the opportunity to replace them with
the byte-based bdrv_pread() / bdrv_pwrite().

Signed-off-by: Alberto Garcia <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: 13bec229d848d22fceb3f0f1bbf01e1f7bcac7a1
      
https://github.com/qemu/qemu/commit/13bec229d848d22fceb3f0f1bbf01e1f7bcac7a1
  Author: Alberto Garcia <address@hidden>
  Date:   2018-02-13 (Tue, 13 Feb 2018)

  Changed paths:
    M block/qcow2.c

  Log Message:
  -----------
  qcow2: Update qcow2_truncate() to support L2 slices

The qcow2_truncate() code is mostly independent from whether
we're using L2 slices or full L2 tables, but in full and
falloc preallocation modes new L2 tables are allocated using
qcow2_alloc_cluster_link_l2().  Therefore the code needs to be
modified to ensure that all nb_clusters that are processed in each
call can be allocated with just one L2 slice.

Signed-off-by: Alberto Garcia <address@hidden>
Message-id: address@hidden
Reviewed-by: Max Reitz <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Max Reitz <address@hidden>


  Commit: e4e7254829d12a831acf2935ea8388e27c06bc42
      
https://github.com/qemu/qemu/commit/e4e7254829d12a831acf2935ea8388e27c06bc42
  Author: Alberto Garcia <address@hidden>
  Date:   2018-02-13 (Tue, 13 Feb 2018)

  Changed paths:
    M block/qcow2-cluster.c

  Log Message:
  -----------
  qcow2: Rename l2_table in qcow2_alloc_compressed_cluster_offset()

This function doesn't need any changes to support L2 slices, but since
it's now dealing with slices instead of full tables, the l2_table
variable is renamed for clarity.

Signed-off-by: Alberto Garcia <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: 13f893c47d8fe0dbd70c40570b3208fbc01579c4
      
https://github.com/qemu/qemu/commit/13f893c47d8fe0dbd70c40570b3208fbc01579c4
  Author: Alberto Garcia <address@hidden>
  Date:   2018-02-13 (Tue, 13 Feb 2018)

  Changed paths:
    M block/qcow2-cluster.c

  Log Message:
  -----------
  qcow2: Rename l2_table in count_contiguous_clusters()

This function doesn't need any changes to support L2 slices, but since
it's now dealing with slices intead of full tables, the l2_table
variable is renamed for clarity.

Signed-off-by: Alberto Garcia <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: c26f10ba898d07d5ac36f56a7629691cc0003076
      
https://github.com/qemu/qemu/commit/c26f10ba898d07d5ac36f56a7629691cc0003076
  Author: Alberto Garcia <address@hidden>
  Date:   2018-02-13 (Tue, 13 Feb 2018)

  Changed paths:
    M block/qcow2-cluster.c

  Log Message:
  -----------
  qcow2: Rename l2_table in count_contiguous_clusters_unallocated()

This function doesn't need any changes to support L2 slices, but since
it's now dealing with slices instead of full tables, the l2_table
variable is renamed for clarity.

Signed-off-by: Alberto Garcia <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: dd32c881080ca089c0f1914e0886771e59893cb2
      
https://github.com/qemu/qemu/commit/dd32c881080ca089c0f1914e0886771e59893cb2
  Author: Alberto Garcia <address@hidden>
  Date:   2018-02-13 (Tue, 13 Feb 2018)

  Changed paths:
    M block/qcow2-cluster.c

  Log Message:
  -----------
  qcow2: Rename l2_table in count_cow_clusters()

This function doesn't need any changes to support L2 slices, but since
it's now dealing with slices intead of full tables, the l2_table
variable is renamed for clarity.

Signed-off-by: Alberto Garcia <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: 1221fe6f636754ab5f2c1c87caa77633e9123622
      
https://github.com/qemu/qemu/commit/1221fe6f636754ab5f2c1c87caa77633e9123622
  Author: Alberto Garcia <address@hidden>
  Date:   2018-02-13 (Tue, 13 Feb 2018)

  Changed paths:
    M block/qcow2-cache.c
    M block/qcow2.c
    M block/qcow2.h
    M qapi/block-core.json

  Log Message:
  -----------
  qcow2: Allow configuring the L2 slice size

Now that the code is ready to handle L2 slices we can finally add an
option to allow configuring their size.

An L2 slice is the portion of an L2 table that is read by the qcow2
cache. Until now the cache was always reading full L2 tables, and
since the L2 table size is equal to the cluster size this was not very
efficient with large clusters. Here's a more detailed explanation of
why it makes sense to have smaller cache entries in order to load L2
data:

   https://lists.gnu.org/archive/html/qemu-block/2017-09/msg00635.html

This patch introduces a new command-line option to the qcow2 driver
named l2-cache-entry-size (cf. l2-cache-size). The cache entry size
has the same restrictions as the cluster size: it must be a power of
two and it has the same range of allowed values, with the additional
requirement that it must not be larger than the cluster size.

The L2 cache entry size (L2 slice size) remains equal to the cluster
size for now by default, so this feature must be explicitly enabled.
Although my tests show that 4KB slices consistently improve
performance and give the best results, let's wait and make more tests
with different cluster sizes before deciding on an optimal default.

Now that the cache entry size is not necessarily equal to the cluster
size we need to reflect that in the MIN_L2_CACHE_SIZE documentation.
That minimum value is a requirement of the COW algorithm: we need to
read two L2 slices (and not two L2 tables) in order to do COW, see
l2_allocate() for the actual code.

Signed-off-by: Alberto Garcia <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: 4450c39625d6ef4404f41bd1fda3793afd5ce5c0
      
https://github.com/qemu/qemu/commit/4450c39625d6ef4404f41bd1fda3793afd5ce5c0
  Author: Alberto Garcia <address@hidden>
  Date:   2018-02-13 (Tue, 13 Feb 2018)

  Changed paths:
    M tests/qemu-iotests/103
    M tests/qemu-iotests/103.out

  Log Message:
  -----------
  iotests: Test valid values of l2-cache-entry-size

The l2-cache-entry-size setting can only contain values that are
powers of two between 512 and the cluster size.

Signed-off-by: Alberto Garcia <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Message-id: address@hidden
[mreitz: Changed non-power-of-two test value from 300 to 4242]
Signed-off-by: Max Reitz <address@hidden>


  Commit: 2ecec91110e605d3b2d3d15d6fb9beaf6c96ada6
      
https://github.com/qemu/qemu/commit/2ecec91110e605d3b2d3d15d6fb9beaf6c96ada6
  Author: Alberto Garcia <address@hidden>
  Date:   2018-02-13 (Tue, 13 Feb 2018)

  Changed paths:
    M tests/qemu-iotests/061
    M tests/qemu-iotests/061.out

  Log Message:
  -----------
  iotests: Test downgrading an image using a small L2 slice size

expand_zero_clusters_in_l1() is used when downgrading qcow2 images
from v3 to v2 (compat=0.10). This is one of the functions that needed
more changes to support L2 slices, so this patch extends iotest 061 to
test downgrading a qcow2 image using a smaller slice size.

Signed-off-by: Alberto Garcia <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: 03b1b6f0220d5f50471a1f702bedcd789fee032d
      
https://github.com/qemu/qemu/commit/03b1b6f0220d5f50471a1f702bedcd789fee032d
  Author: Alberto Garcia <address@hidden>
  Date:   2018-02-13 (Tue, 13 Feb 2018)

  Changed paths:
    M tests/qemu-iotests/137
    M tests/qemu-iotests/137.out

  Log Message:
  -----------
  iotests: Add l2-cache-entry-size to iotest 137

This test tries reopening a qcow2 image with valid and invalid
options. This patch adds l2-cache-entry-size to the set.

Signed-off-by: Alberto Garcia <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: 0a4dc980e6c935e9be745ce3ee1a4c71629ecd00
      
https://github.com/qemu/qemu/commit/0a4dc980e6c935e9be745ce3ee1a4c71629ecd00
  Author: Kevin Wolf <address@hidden>
  Date:   2018-02-13 (Tue, 13 Feb 2018)

  Changed paths:
    M block/dirty-bitmap.c
    M block/qcow2-bitmap.c
    M block/qcow2-cache.c
    M block/qcow2-cluster.c
    M block/qcow2-refcount.c
    M block/qcow2.c
    M block/qcow2.h
    M blockdev.c
    M include/block/dirty-bitmap.h
    M qapi/block-core.json
    M qemu-doc.texi
    M tests/qemu-iotests/061
    M tests/qemu-iotests/061.out
    M tests/qemu-iotests/103
    M tests/qemu-iotests/103.out
    M tests/qemu-iotests/137
    M tests/qemu-iotests/137.out
    M tests/qemu-iotests/165
    M tests/qemu-iotests/176

  Log Message:
  -----------
  Merge remote-tracking branch 'mreitz/tags/pull-block-2018-02-13' into 
queue-block

Block patches for the block queue

# gpg: Signature made Tue Feb 13 17:00:13 2018 CET
# gpg:                using RSA key F407DB0061D5CF40
# gpg: Good signature from "Max Reitz <address@hidden>"
# Primary key fingerprint: 91BE B60A 30DB 3E88 57D1  1829 F407 DB00 61D5 CF40

* mreitz/tags/pull-block-2018-02-13: (40 commits)
  iotests: Add l2-cache-entry-size to iotest 137
  iotests: Test downgrading an image using a small L2 slice size
  iotests: Test valid values of l2-cache-entry-size
  qcow2: Allow configuring the L2 slice size
  qcow2: Rename l2_table in count_cow_clusters()
  qcow2: Rename l2_table in count_contiguous_clusters_unallocated()
  qcow2: Rename l2_table in count_contiguous_clusters()
  qcow2: Rename l2_table in qcow2_alloc_compressed_cluster_offset()
  qcow2: Update qcow2_truncate() to support L2 slices
  qcow2: Update expand_zero_clusters_in_l1() to support L2 slices
  qcow2: Prepare expand_zero_clusters_in_l1() for adding L2 slice support
  qcow2: Read refcount before L2 table in expand_zero_clusters_in_l1()
  qcow2: Update qcow2_update_snapshot_refcount() to support L2 slices
  qcow2: Prepare qcow2_update_snapshot_refcount() for adding L2 slice support
  qcow2: Update zero_single_l2() to support L2 slices
  qcow2: Update discard_single_l2() to support L2 slices
  qcow2: Update handle_alloc() to support L2 slices
  qcow2: Update handle_copied() to support L2 slices
  qcow2: Update qcow2_alloc_cluster_link_l2() to support L2 slices
  qcow2: Update qcow2_get_cluster_offset() to support L2 slices
  ...

Signed-off-by: Kevin Wolf <address@hidden>


  Commit: 685a4eaf6d552762e03ce02b136978e0e5d5a0c2
      
https://github.com/qemu/qemu/commit/685a4eaf6d552762e03ce02b136978e0e5d5a0c2
  Author: Peter Maydell <address@hidden>
  Date:   2018-02-13 (Tue, 13 Feb 2018)

  Changed paths:
    M block/dirty-bitmap.c
    M block/gluster.c
    M block/qcow2-bitmap.c
    M block/qcow2-cache.c
    M block/qcow2-cluster.c
    M block/qcow2-refcount.c
    M block/qcow2.c
    M block/qcow2.h
    M block/sheepdog.c
    M blockdev.c
    M docs/qemu-block-drivers.texi
    M include/block/dirty-bitmap.h
    M qapi/block-core.json
    M qemu-doc.texi
    M qemu-img.texi
    M qemu-io.c
    M tests/qemu-iotests/059.out
    M tests/qemu-iotests/061
    M tests/qemu-iotests/061.out
    M tests/qemu-iotests/103
    M tests/qemu-iotests/103.out
    M tests/qemu-iotests/137
    M tests/qemu-iotests/137.out
    M tests/qemu-iotests/155
    M tests/qemu-iotests/165
    M tests/qemu-iotests/176
    M tests/qemu-iotests/sample_images/afl9.vmdk.bz2

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging

Block layer patches

# gpg: Signature made Tue 13 Feb 2018 17:03:11 GMT
# gpg:                using RSA key 7F09B272C88F2FD6
# gpg: Good signature from "Kevin Wolf <address@hidden>"
# Primary key fingerprint: DC3D EB15 9A9A F95D 3D74  56FE 7F09 B272 C88F 2FD6

* remotes/kevin/tags/for-upstream: (55 commits)
  iotests: Add l2-cache-entry-size to iotest 137
  iotests: Test downgrading an image using a small L2 slice size
  iotests: Test valid values of l2-cache-entry-size
  qcow2: Allow configuring the L2 slice size
  qcow2: Rename l2_table in count_cow_clusters()
  qcow2: Rename l2_table in count_contiguous_clusters_unallocated()
  qcow2: Rename l2_table in count_contiguous_clusters()
  qcow2: Rename l2_table in qcow2_alloc_compressed_cluster_offset()
  qcow2: Update qcow2_truncate() to support L2 slices
  qcow2: Update expand_zero_clusters_in_l1() to support L2 slices
  qcow2: Prepare expand_zero_clusters_in_l1() for adding L2 slice support
  qcow2: Read refcount before L2 table in expand_zero_clusters_in_l1()
  qcow2: Update qcow2_update_snapshot_refcount() to support L2 slices
  qcow2: Prepare qcow2_update_snapshot_refcount() for adding L2 slice support
  qcow2: Update zero_single_l2() to support L2 slices
  qcow2: Update discard_single_l2() to support L2 slices
  qcow2: Update handle_alloc() to support L2 slices
  qcow2: Update handle_copied() to support L2 slices
  qcow2: Update qcow2_alloc_cluster_link_l2() to support L2 slices
  qcow2: Update qcow2_get_cluster_offset() to support L2 slices
  ...

Signed-off-by: Peter Maydell <address@hidden>


Compare: https://github.com/qemu/qemu/compare/bec9c64ef7be...685a4eaf6d55

reply via email to

[Prev in Thread] Current Thread [Next in Thread]