qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] 517619: block: Make bdrv_perm_names public


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] 517619: block: Make bdrv_perm_names public
Date: Mon, 15 May 2017 05:32:28 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 5176196c3233dcb80aacc719be6b6502bb1c972b
      
https://github.com/qemu/qemu/commit/5176196c3233dcb80aacc719be6b6502bb1c972b
  Author: Fam Zheng <address@hidden>
  Date:   2017-05-11 (Thu, 11 May 2017)

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

  Log Message:
  -----------
  block: Make bdrv_perm_names public

It can be used outside of block.c for making user friendly messages.

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


  Commit: 5a9347c6730ff6d68bba30b24f80cd90a6671a20
      
https://github.com/qemu/qemu/commit/5a9347c6730ff6d68bba30b24f80cd90a6671a20
  Author: Fam Zheng <address@hidden>
  Date:   2017-05-11 (Thu, 11 May 2017)

  Changed paths:
    M block.c
    M include/block/block.h
    M include/block/block_int.h
    M qapi/block-core.json

  Log Message:
  -----------
  block: Add, parse and store "force-share" option

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


  Commit: ffd1a5a25c7199d3c9c6d84a5a84ae51f8824602
      
https://github.com/qemu/qemu/commit/ffd1a5a25c7199d3c9c6d84a5a84ae51f8824602
  Author: Fam Zheng <address@hidden>
  Date:   2017-05-11 (Thu, 11 May 2017)

  Changed paths:
    M block.c

  Log Message:
  -----------
  block: Respect "force-share" in perm propagating

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


  Commit: 335e9937844449a3fc172dd5e64549ad7d5ad1c2
      
https://github.com/qemu/qemu/commit/335e9937844449a3fc172dd5e64549ad7d5ad1c2
  Author: Fam Zheng <address@hidden>
  Date:   2017-05-11 (Thu, 11 May 2017)

  Changed paths:
    M qemu-img.c

  Log Message:
  -----------
  qemu-img: Add --force-share option to subcommands

This will force the opened images to allow sharing all permissions with other
programs.

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


  Commit: a8d16f9ca289c102d74c74c2834209eeef1e625f
      
https://github.com/qemu/qemu/commit/a8d16f9ca289c102d74c74c2834209eeef1e625f
  Author: Fam Zheng <address@hidden>
  Date:   2017-05-11 (Thu, 11 May 2017)

  Changed paths:
    M qemu-img-cmds.hx

  Log Message:
  -----------
  qemu-img: Update documentation for -U

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


  Commit: 459571f7b2df957b8108eda06e923ddf60fec113
      
https://github.com/qemu/qemu/commit/459571f7b2df957b8108eda06e923ddf60fec113
  Author: Fam Zheng <address@hidden>
  Date:   2017-05-11 (Thu, 11 May 2017)

  Changed paths:
    M qemu-io.c

  Log Message:
  -----------
  qemu-io: Add --force-share option

Add --force-share/-U to program options and -U to open subcommand.

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


  Commit: aca7063a5686b5551f5699ac70d9643bd48a6fa9
      
https://github.com/qemu/qemu/commit/aca7063a5686b5551f5699ac70d9643bd48a6fa9
  Author: Fam Zheng <address@hidden>
  Date:   2017-05-11 (Thu, 11 May 2017)

  Changed paths:
    M tests/qemu-iotests/030

  Log Message:
  -----------
  iotests: 030: Prepare for image locking

qemu-img and qemu-io commands when guest is running need "-U" option,
add it.

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


  Commit: 55e5a3b65e3e8bdf2fe5e22bbd8c0c4023cef1c2
      
https://github.com/qemu/qemu/commit/55e5a3b65e3e8bdf2fe5e22bbd8c0c4023cef1c2
  Author: Fam Zheng <address@hidden>
  Date:   2017-05-11 (Thu, 11 May 2017)

  Changed paths:
    M tests/qemu-iotests/046

  Log Message:
  -----------
  iotests: 046: Prepare for image locking

The qemu-img info command is executed while VM is running, add -U option
to avoid the image locking error.

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


  Commit: 4797aeabdc61d7bbf9ef0cb9e25fb539912bb7f3
      
https://github.com/qemu/qemu/commit/4797aeabdc61d7bbf9ef0cb9e25fb539912bb7f3
  Author: Fam Zheng <address@hidden>
  Date:   2017-05-11 (Thu, 11 May 2017)

  Changed paths:
    M tests/qemu-iotests/055

  Log Message:
  -----------
  iotests: 055: Don't attach the target image already for drive-backup

Double attach is not a valid usage of the target image, drive-backup
will open the blockdev itself so skip the add_drive call in this case.

Signed-off-by: Fam Zheng <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>


  Commit: ecffa634218c05813c4b055f73826d09d7f07346
      
https://github.com/qemu/qemu/commit/ecffa634218c05813c4b055f73826d09d7f07346
  Author: Fam Zheng <address@hidden>
  Date:   2017-05-11 (Thu, 11 May 2017)

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

  Log Message:
  -----------
  iotests: 085: Avoid image locking conflict

In the case where we test the expected error when a blockdev-snapshot
target already has a backing image, the backing chain is opened multiple
times. This will be a problem when we use image locking, so use a
different backing file that is not already open.

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


  Commit: d5b8336a6284fa4d75eaae3ac0bfb974cb7f5f4a
      
https://github.com/qemu/qemu/commit/d5b8336a6284fa4d75eaae3ac0bfb974cb7f5f4a
  Author: Fam Zheng <address@hidden>
  Date:   2017-05-11 (Thu, 11 May 2017)

  Changed paths:
    M tests/qemu-iotests/087

  Log Message:
  -----------
  iotests: 087: Don't attach test image twice

The test scenario doesn't require the same image, instead it focuses on
the duplicated node-name, so use null-co to avoid locking conflict.

Reviewed-by: Max Reitz <address@hidden>
Signed-off-by: Fam Zheng <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>


  Commit: 8b084489b06c8dbc7fb6be3bba713fbbb9886b43
      
https://github.com/qemu/qemu/commit/8b084489b06c8dbc7fb6be3bba713fbbb9886b43
  Author: Fam Zheng <address@hidden>
  Date:   2017-05-11 (Thu, 11 May 2017)

  Changed paths:
    M tests/qemu-iotests/091

  Log Message:
  -----------
  iotests: 091: Quit QEMU before checking image

Signed-off-by: Fam Zheng <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>


  Commit: 7ceb4fc1147ea34a50f1846db3782a8329a4efb4
      
https://github.com/qemu/qemu/commit/7ceb4fc1147ea34a50f1846db3782a8329a4efb4
  Author: Fam Zheng <address@hidden>
  Date:   2017-05-11 (Thu, 11 May 2017)

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

  Log Message:
  -----------
  iotests: 172: Use separate images for multiple devices

To avoid image lock failures.

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


  Commit: 2420d369a2c16867ee18fd363b617aa5a66ab933
      
https://github.com/qemu/qemu/commit/2420d369a2c16867ee18fd363b617aa5a66ab933
  Author: Fam Zheng <address@hidden>
  Date:   2017-05-11 (Thu, 11 May 2017)

  Changed paths:
    M tests/drive_del-test.c
    M tests/nvme-test.c
    M tests/usb-hcd-uhci-test.c
    M tests/usb-hcd-xhci-test.c
    M tests/virtio-blk-test.c
    M tests/virtio-scsi-test.c

  Log Message:
  -----------
  tests: Use null-co:// instead of /dev/null as the dummy image

Signed-off-by: Fam Zheng <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>


  Commit: 16b48d5d66d2fceb86114b28d693aad930f5070d
      
https://github.com/qemu/qemu/commit/16b48d5d66d2fceb86114b28d693aad930f5070d
  Author: Fam Zheng <address@hidden>
  Date:   2017-05-11 (Thu, 11 May 2017)

  Changed paths:
    M block/file-posix.c
    M qapi/block-core.json

  Log Message:
  -----------
  file-posix: Add 'locking' option

Making this option available even before implementing it will let
converting tests easier: in coming patches they can specify the option
already when necessary, before we actually write code to lock the
images.

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


  Commit: 1c3a555c35f2124d45a295eb715e50512526810e
      
https://github.com/qemu/qemu/commit/1c3a555c35f2124d45a295eb715e50512526810e
  Author: Fam Zheng <address@hidden>
  Date:   2017-05-11 (Thu, 11 May 2017)

  Changed paths:
    M block/file-win32.c

  Log Message:
  -----------
  file-win32: Error out if locking=on

We share the same set of QAPI options with file-posix, but locking is
not supported here. So error out if it is specified as 'on' for now.

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


  Commit: 9c77fec2d366a2fc7848e9b58b82504365a664ae
      
https://github.com/qemu/qemu/commit/9c77fec2d366a2fc7848e9b58b82504365a664ae
  Author: Fam Zheng <address@hidden>
  Date:   2017-05-11 (Thu, 11 May 2017)

  Changed paths:
    M tests/test-replication.c

  Log Message:
  -----------
  tests: Disable image lock in test-replication

The COLO block replication architecture requires one disk to be shared
between primary and secondary, in the test both processes use posix file
protocol (instead of over NBD) so it is affected by image locking.
Disable the lock.

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


  Commit: fc0932fdcfc3e5cafa3641e361b681c07f639812
      
https://github.com/qemu/qemu/commit/fc0932fdcfc3e5cafa3641e361b681c07f639812
  Author: Fam Zheng <address@hidden>
  Date:   2017-05-11 (Thu, 11 May 2017)

  Changed paths:
    M blockdev.c

  Log Message:
  -----------
  block: Reuse bs as backing hd for drive-backup sync=none

Opening the backing image for the second time is bad, especially here
when it is also in use as the active image as the source. The
drive-backup job itself doesn't read from target->backing for COW,
instead it gets data from the write notifier, so it's not a big problem.
However, exporting the target to NBD etc. won't work, because of the
likely stale metadata cache.

Use BDRV_O_NO_BACKING in this case and manually set up the backing
BdrvChild.

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


  Commit: 13461fdba6588540c99bf1e32275e421da22c396
      
https://github.com/qemu/qemu/commit/13461fdba6588540c99bf1e32275e421da22c396
  Author: Fam Zheng <address@hidden>
  Date:   2017-05-11 (Thu, 11 May 2017)

  Changed paths:
    M include/qemu/osdep.h
    M util/osdep.c

  Log Message:
  -----------
  osdep: Add qemu_lock_fd and qemu_unlock_fd

They are wrappers of POSIX fcntl "file private locking", with a
convenient "try lock" wrapper implemented with F_OFD_GETLK.

Signed-off-by: Fam Zheng <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>


  Commit: e8c1094a0ee081f30ec9716593e7a90ee88623a1
      
https://github.com/qemu/qemu/commit/e8c1094a0ee081f30ec9716593e7a90ee88623a1
  Author: Fam Zheng <address@hidden>
  Date:   2017-05-11 (Thu, 11 May 2017)

  Changed paths:
    M util/osdep.c

  Log Message:
  -----------
  osdep: Fall back to posix lock when OFD lock is unavailable

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


  Commit: 244a5668106297378391b768e7288eb157616f64
      
https://github.com/qemu/qemu/commit/244a5668106297378391b768e7288eb157616f64
  Author: Fam Zheng <address@hidden>
  Date:   2017-05-11 (Thu, 11 May 2017)

  Changed paths:
    M block/file-posix.c

  Log Message:
  -----------
  file-posix: Add image locking to perm operations

This extends the permission bits of op blocker API to external using
Linux OFD locks.

Each permission in @perm and @shared_perm is represented by a locked
byte in the image file.  Requesting a permission in @perm is translated
to a shared lock of the corresponding byte; rejecting to share the same
permission is translated to a shared lock of a separate byte. With that,
we use 2x number of bytes of distinct permission types.

virtlockd in libvirt locks the first byte, so we do locking from a
higher offset.

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


  Commit: ba8980784df8c02ecc88f221e086653fc12908a8
      
https://github.com/qemu/qemu/commit/ba8980784df8c02ecc88f221e086653fc12908a8
  Author: Fam Zheng <address@hidden>
  Date:   2017-05-11 (Thu, 11 May 2017)

  Changed paths:
    A tests/qemu-iotests/153
    A tests/qemu-iotests/153.out
    M tests/qemu-iotests/group

  Log Message:
  -----------
  qemu-iotests: Add test case 153 for image locking

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


  Commit: de9efdb33454ae952c72ed826c54981d498b6c10
      
https://github.com/qemu/qemu/commit/de9efdb33454ae952c72ed826c54981d498b6c10
  Author: Fam Zheng <address@hidden>
  Date:   2017-05-11 (Thu, 11 May 2017)

  Changed paths:
    A tests/qemu-iotests/182
    A tests/qemu-iotests/182.out
    M tests/qemu-iotests/group

  Log Message:
  -----------
  tests: Add POSIX image locking test case 182

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


  Commit: 92413c16be8eee53a3b60739f2a28a1463651f47
      
https://github.com/qemu/qemu/commit/92413c16be8eee53a3b60739f2a28a1463651f47
  Author: Max Reitz <address@hidden>
  Date:   2017-05-11 (Thu, 11 May 2017)

  Changed paths:
    M block/qcow2.c

  Log Message:
  -----------
  qcow2: Fix preallocation size formula

When calculating the number of reftable entries, we should actually use
the number of refblocks and not (wrongly[1]) re-calculate it.

[1] "Wrongly" means: Dividing the number of clusters by the number of
    entries per refblock and rounding down instead of up.

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


  Commit: 564a6b693828ac38f3f562eed9e8b1dc62f45253
      
https://github.com/qemu/qemu/commit/564a6b693828ac38f3f562eed9e8b1dc62f45253
  Author: Max Reitz <address@hidden>
  Date:   2017-05-11 (Thu, 11 May 2017)

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

  Log Message:
  -----------
  qcow2: Reuse preallocated zero clusters

Instead of just freeing preallocated zero clusters and completely
allocating them from scratch, reuse them.

We cannot do this in handle_copied(), however, since this is a COW
operation. Therefore, we have to add the new logic to handle_alloc() and
simply return the existing offset if it exists. The only catch is that
we have to convince qcow2_alloc_cluster_link_l2() not to free the old
clusters (because we have reused them).

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


  Commit: 293073a56c6c921c9902da17711914a0042f29ba
      
https://github.com/qemu/qemu/commit/293073a56c6c921c9902da17711914a0042f29ba
  Author: Max Reitz <address@hidden>
  Date:   2017-05-11 (Thu, 11 May 2017)

  Changed paths:
    M block/qcow2-cluster.c

  Log Message:
  -----------
  qcow2: Discard preallocated zero clusters

In discard_single_l2(), we completely discard normal clusters instead of
simply turning them into preallocated zero clusters. That means we
should probably do the same with such preallocated zero clusters:
Discard them instead of keeping them allocated.

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


  Commit: aa93c834f9c5b971ad3b54944a5dae97ca310225
      
https://github.com/qemu/qemu/commit/aa93c834f9c5b971ad3b54944a5dae97ca310225
  Author: Max Reitz <address@hidden>
  Date:   2017-05-11 (Thu, 11 May 2017)

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

  Log Message:
  -----------
  iotests: Extend test 066

066 was supposed to be a test "for discarding preallocated zero
clusters", but it did so incompletely: While it did check the image
file's integrity after the operation, it did not confirm that the
clusters are indeed freed. This patch adds this test.

In addition, new cases for writing to preallocated zero clusters are
added.

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


  Commit: ace21a58751824f9a3d399e332317233e880de3a
      
https://github.com/qemu/qemu/commit/ace21a58751824f9a3d399e332317233e880de3a
  Author: Kevin Wolf <address@hidden>
  Date:   2017-05-11 (Thu, 11 May 2017)

  Changed paths:
    M migration/migration.c
    M migration/savevm.c
    M qmp.c

  Log Message:
  -----------
  migration: Unify block node activation error handling

Migration code activates all block driver nodes on the destination when
the migration completes. It does so by calling
bdrv_invalidate_cache_all() and blk_resume_after_migration(). There is
one code path for precopy and one for postcopy migration, resulting in
four function calls, which used to have three different failure modes.

This patch unifies the behaviour so that failure to activate all block
nodes is non-fatal, but the error message is logged and the VM isn't
automatically started. 'cont' will retry activating the block nodes.

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


  Commit: 4417ab7adf1613799054be5afedf810fc2524ee8
      
https://github.com/qemu/qemu/commit/4417ab7adf1613799054be5afedf810fc2524ee8
  Author: Kevin Wolf <address@hidden>
  Date:   2017-05-11 (Thu, 11 May 2017)

  Changed paths:
    M block.c
    M block/block-backend.c
    M include/block/block.h
    M include/block/block_int.h
    M migration/migration.c
    M migration/savevm.c
    M qmp.c

  Log Message:
  -----------
  block: New BdrvChildRole.activate() for blk_resume_after_migration()

Instead of manually calling blk_resume_after_migration() in migration
code after doing bdrv_invalidate_cache_all(), integrate the BlockBackend
activation with cache invalidation into a single function. This is
achieved with a new callback in BdrvChildRole that is called by
bdrv_invalidate_cache_all().

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


  Commit: cfa1a5723f0fc8eb6563fb1d19c206fd5e40cd41
      
https://github.com/qemu/qemu/commit/cfa1a5723f0fc8eb6563fb1d19c206fd5e40cd41
  Author: Kevin Wolf <address@hidden>
  Date:   2017-05-11 (Thu, 11 May 2017)

  Changed paths:
    M block.c
    M block/block-backend.c
    M include/block/block_int.h

  Log Message:
  -----------
  block: Drop permissions when migration completes

With image locking, permissions affect other qemu processes as well. We
want to be sure that the destination can run, so let's drop permissions
on the source when migration completes.

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


  Commit: 38701b6aef5e934c5901905e8ca2c50453088a81
      
https://github.com/qemu/qemu/commit/38701b6aef5e934c5901905e8ca2c50453088a81
  Author: Kevin Wolf <address@hidden>
  Date:   2017-05-11 (Thu, 11 May 2017)

  Changed paths:
    M block.c

  Log Message:
  -----------
  block: Inactivate parents before children

The proper order for inactivating block nodes is that first the parents
get inactivated and then the children. If we do things in this order, we
can assert that we didn't accidentally leave a parent activated when one
of its child nodes is inactive.

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


  Commit: 9c5e6594f15b7364624a3ad40306c396c93a2145
      
https://github.com/qemu/qemu/commit/9c5e6594f15b7364624a3ad40306c396c93a2145
  Author: Kevin Wolf <address@hidden>
  Date:   2017-05-11 (Thu, 11 May 2017)

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

  Log Message:
  -----------
  block: Fix write/resize permissions for inactive images

Format drivers for inactive nodes don't need write/resize permissions on
their bs->file and can share write/resize with another VM (in fact, this
is the whole point of keeping images inactive). Represent this fact in
the op blocker system, so that image locking does the right thing
without special-casing inactive images.

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


  Commit: 22d5cd82e98b61b1dbd791fab9f4ae0f77c0ed14
      
https://github.com/qemu/qemu/commit/22d5cd82e98b61b1dbd791fab9f4ae0f77c0ed14
  Author: Kevin Wolf <address@hidden>
  Date:   2017-05-11 (Thu, 11 May 2017)

  Changed paths:
    M block/file-posix.c

  Log Message:
  -----------
  file-posix: Remove .bdrv_inactivate/invalidate_cache

Now that the block layer takes care to request a lot less permissions
for inactive nodes, the special-casing in file-posix isn't necessary any
more.

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


  Commit: b91127edd0ff96f27f1e58e47f4e9f9d6a0fed02
      
https://github.com/qemu/qemu/commit/b91127edd0ff96f27f1e58e47f4e9f9d6a0fed02
  Author: Anton Nefedov <address@hidden>
  Date:   2017-05-11 (Thu, 11 May 2017)

  Changed paths:
    M qemu-img.c

  Log Message:
  -----------
  qemu-img: wait for convert coroutines to complete

On error path (like i/o error in one of the coroutines), it's required to
  - wait for coroutines completion before cleaning the common structures
  - reenter dependent coroutines so they ever finish

Introduced in 2d9187bc65.

Cc: address@hidden
Signed-off-by: Anton Nefedov <address@hidden>
Reviewed-by: Peter Lieven <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>


  Commit: c03e7ef12a954f715a4b56e3a9595f8253987701
      
https://github.com/qemu/qemu/commit/c03e7ef12a954f715a4b56e3a9595f8253987701
  Author: Christoph Hellwig <address@hidden>
  Date:   2017-05-11 (Thu, 11 May 2017)

  Changed paths:
    M hw/block/nvme.c
    M hw/block/nvme.h

  Log Message:
  -----------
  nvme: Implement Write Zeroes

Signed-off-by: Keith Busch <address@hidden>
[hch: ported over from qemu-nvme.git to mainline]
Signed-off-by: Christoph Hellwig <address@hidden>
Acked-by: Keith Busch <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>


  Commit: 698bdfa07d66b5ec218a60229e58eae1dcde00e5
      
https://github.com/qemu/qemu/commit/698bdfa07d66b5ec218a60229e58eae1dcde00e5
  Author: John Snow <address@hidden>
  Date:   2017-05-11 (Thu, 11 May 2017)

  Changed paths:
    M blockdev.c

  Log Message:
  -----------
  blockdev: use drained_begin/end for qmp_block_resize

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1447551

If one tries to issue a block_resize while a guest is busy
accessing the disk, it is possible that qemu may deadlock
when invoking aio_poll from both the main loop and the iothread.

Replace another instance of bdrv_drain_all that doesn't
quite belong.

Cc: address@hidden
Suggested-by: Paolo Bonzini <address@hidden>
Signed-off-by: John Snow <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Paolo Bonzini <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>


  Commit: 1bce6b4ce3ba03015bdf16d40c1bbe33d8b6031b
      
https://github.com/qemu/qemu/commit/1bce6b4ce3ba03015bdf16d40c1bbe33d8b6031b
  Author: Eric Blake <address@hidden>
  Date:   2017-05-11 (Thu, 11 May 2017)

  Changed paths:
    M qemu-io-cmds.c

  Log Message:
  -----------
  qemu-io: Improve alignment checks

Several copy-and-pasted alignment checks exist in qemu-io, which
could use some minor improvements:

- Manual comparison against 0x1ff is not as clean as using our
alignment macros (QEMU_IS_ALIGNED) from osdep.h.

- The error messages aren't quite grammatically correct.

Suggested-by: Philippe Mathieu-Daudé <address@hidden>
Suggested-by: Max Reitz <address@hidden>
Signed-off-by: Eric Blake <address@hidden>
Message-id: address@hidden
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Signed-off-by: Max Reitz <address@hidden>


  Commit: 4401fdc77cb6d79e53ce2fc2193444cad8b95749
      
https://github.com/qemu/qemu/commit/4401fdc77cb6d79e53ce2fc2193444cad8b95749
  Author: Eric Blake <address@hidden>
  Date:   2017-05-11 (Thu, 11 May 2017)

  Changed paths:
    M qemu-io-cmds.c
    M tests/qemu-iotests/019.out
    M tests/qemu-iotests/common.pattern

  Log Message:
  -----------
  qemu-io: Switch 'alloc' command to byte-based length

For the 'alloc' command, accepting an offset in bytes but a length
in sectors, and reporting output in sectors, is confusing.  Do
everything in bytes, and adjust the expected output accordingly.

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


  Commit: 6f3c90af3c50d4f839849c8ba9b6ba4e9a548c28
      
https://github.com/qemu/qemu/commit/6f3c90af3c50d4f839849c8ba9b6ba4e9a548c28
  Author: Eric Blake <address@hidden>
  Date:   2017-05-11 (Thu, 11 May 2017)

  Changed paths:
    M qemu-io-cmds.c
    M tests/qemu-iotests/102.out
    M tests/qemu-iotests/146.out

  Log Message:
  -----------
  qemu-io: Switch 'map' output to byte-based reporting

Mixing byte offset and sector allocation counts is a bit
confusing.  Also, reporting n/m sectors, where m decreases
according to the remaining size of the file, isn't really
adding any useful information; and reporting an offset at
both the front and end of the line, with large amounts of
whitespace, is pointless.  Update the output to use byte
counts and shorter lines, then adjust the affected tests
(./check -qcow2 102, ./check -vpc 146).

Note that 'qemu-io map' is MUCH weaker than 'qemu-img map';
the former only shows which regions of the active layer are
allocated, without regards to where the allocation comes from
or whether the allocated portion is known to read as zero
(because it is using the weaker bdrv_is_allocated()); while the
latter (especially in --output=json mode) reports more details
from bdrv_get_block_status().

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


  Commit: e0ef439588ce1ede747f82b77d893190c1cc9f4d
      
https://github.com/qemu/qemu/commit/e0ef439588ce1ede747f82b77d893190c1cc9f4d
  Author: Eric Blake <address@hidden>
  Date:   2017-05-11 (Thu, 11 May 2017)

  Changed paths:
    M block/blkdebug.c

  Log Message:
  -----------
  blkdebug: Sanity check block layer guarantees

Commits 04ed95f4 and 1a62d0ac updated the block layer to auto-fragment
any I/O to fit within device boundaries. Additionally, when using a
minimum alignment of 4k, we want to ensure the block layer does proper
read-modify-write rather than requesting I/O on a slice of a sector.
Let's enforce that the contract is obeyed when using blkdebug.  For
now, blkdebug only allows alignment overrides, and just inherits other
limits from whatever device it is wrapping, but a future patch will
further enhance things.

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


  Commit: d157ed5f7235f3d2d5596a514ad7507b18e24b88
      
https://github.com/qemu/qemu/commit/d157ed5f7235f3d2d5596a514ad7507b18e24b88
  Author: Eric Blake <address@hidden>
  Date:   2017-05-11 (Thu, 11 May 2017)

  Changed paths:
    M block/blkdebug.c

  Log Message:
  -----------
  blkdebug: Refactor error injection

Rather than repeat the logic at each caller of checking if a Rule
exists that warrants an error injection, fold that logic into
inject_error(); and rename it to rule_check() for legibility.
This will help the next patch, which adds two more callers that
need to check rules for the potential of injecting errors.

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


  Commit: 63188c245013dbe383e8b031e665f813e2452ea5
      
https://github.com/qemu/qemu/commit/63188c245013dbe383e8b031e665f813e2452ea5
  Author: Eric Blake <address@hidden>
  Date:   2017-05-11 (Thu, 11 May 2017)

  Changed paths:
    M block/blkdebug.c

  Log Message:
  -----------
  blkdebug: Add pass-through write_zero and discard support

In order to test the effects of artificial geometry constraints
on operations like write zero or discard, we first need blkdebug
to manage these actions.  It also allows us to inject errors on
those operations, just like we can for read/write/flush.

We can also test the contract promised by the block layer; namely,
if a device has specified limits on alignment or maximum size,
then those limits must be obeyed (for now, the blkdebug driver
merely inherits limits from whatever it is wrapping, but the next
patch will further enhance it to allow specific limit overrides).

This patch intentionally refuses to service requests smaller than
the requested alignments; this is because an upcoming patch adds
a qemu-iotest to prove that the block layer is correctly handling
fragmentation, but the test only works if there is a way to tell
the difference at artificial alignment boundaries when blkdebug is
using a larger-than-default alignment.  If we let the blkdebug
layer always defer to the underlying layer, which potentially has
a smaller granularity, the iotest will be thwarted.

Tested by setting up an NBD server with export 'foo', then invoking:
$ ./qemu-io
qemu-io> open -o driver=blkdebug blkdebug::nbd://localhost:10809/foo
qemu-io> d 0 15M
qemu-io> w -z 0 15M

Pre-patch, the server never sees the discard (it was silently
eaten by the block layer); post-patch it is passed across the
wire.  Likewise, pre-patch the write is always passed with
NBD_WRITE (with 15M of zeroes on the wire), while post-patch
it can utilize NBD_WRITE_ZEROES (for less traffic).

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


  Commit: 3dc834f8795a46f919d90b1e5369308628858601
      
https://github.com/qemu/qemu/commit/3dc834f8795a46f919d90b1e5369308628858601
  Author: Eric Blake <address@hidden>
  Date:   2017-05-11 (Thu, 11 May 2017)

  Changed paths:
    M block/blkdebug.c

  Log Message:
  -----------
  blkdebug: Simplify override logic

Rather than store into a local variable, then copy to the struct
if the value is valid, then reporting errors otherwise, it is
simpler to just store into the struct and report errors if the
value is invalid.  This however requires that the struct store
a 64-bit number, rather than a narrower type.  Likewise, setting
a sane errno value in ret prior to the sequence of parsing and
jumping to out: on error makes it easier for the next patch to
add a chain of similar checks.

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


  Commit: 430b26a82da61876c4eaf559ae02332582968043
      
https://github.com/qemu/qemu/commit/430b26a82da61876c4eaf559ae02332582968043
  Author: Eric Blake <address@hidden>
  Date:   2017-05-11 (Thu, 11 May 2017)

  Changed paths:
    M block/blkdebug.c
    M qapi/block-core.json

  Log Message:
  -----------
  blkdebug: Add ability to override unmap geometries

Make it easier to simulate various unusual hardware setups (for
example, recent commits 3482b9b and b8d0a98 affect the Dell
Equallogic iSCSI with its 15M preferred and maximum unmap and
write zero sizing, or b2f95fe deals with the Linux loopback
block device having a max_transfer of 64k), by allowing blkdebug
to wrap any other device with further restrictions on various
alignments.

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


  Commit: 40812d937392fddc11f72a668aef251039cc15ce
      
https://github.com/qemu/qemu/commit/40812d937392fddc11f72a668aef251039cc15ce
  Author: Eric Blake <address@hidden>
  Date:   2017-05-11 (Thu, 11 May 2017)

  Changed paths:
    A tests/qemu-iotests/177
    A tests/qemu-iotests/177.out
    M tests/qemu-iotests/group

  Log Message:
  -----------
  tests: Add coverage for recent block geometry fixes

Use blkdebug's new geometry constraints to emulate setups that
have needed past regression fixes: write zeroes asserting
when running through a loopback block device with max-transfer
smaller than cluster size, and discard rounding away portions
of requests not aligned to preferred boundaries.  Also, add
coverage that the block layer is honoring max transfer limits.

For now, a single iotest performs all actions, with the idea
that we can add future blkdebug constraint test cases in the
same file; but it can be split into multiple iotests if we find
reason to run one portion of the test in more setups than what
are possible in the other.

For reference, the final portion of the test (checking whether
discard passes as much as possible to the lowest layers of the
stack) works as follows:

qemu-io: discard 30M at 80000001, passed to blkdebug
  blkdebug: discard 511 bytes at 80000001, -ENOTSUP (smaller than
blkdebug's 512 align)
  blkdebug: discard 14371328 bytes at 80000512, passed to qcow2
    qcow2: discard 739840 bytes at 80000512, -ENOTSUP (smaller than
qcow2's 1M align)
    qcow2: discard 13M bytes at 77M, succeeds
  blkdebug: discard 15M bytes at 90M, passed to qcow2
    qcow2: discard 15M bytes at 90M, succeeds
  blkdebug: discard 1356800 bytes at 105M, passed to qcow2
    qcow2: discard 1M at 105M, succeeds
    qcow2: discard 308224 bytes at 106M, -ENOTSUP (smaller than qcow2's
1M align)
  blkdebug: discard 1 byte at 111457280, -ENOTSUP (smaller than
blkdebug's 512 align)

Signed-off-by: Eric Blake <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Message-id: address@hidden
[mreitz: For cooperation with image locking, add -r to the qemu-io
   invocation which verifies the image content]
Signed-off-by: Max Reitz <address@hidden>


  Commit: b32cbae11107e9e172e5c58425a2a8362e7382ed
      
https://github.com/qemu/qemu/commit/b32cbae11107e9e172e5c58425a2a8362e7382ed
  Author: Eric Blake <address@hidden>
  Date:   2017-05-11 (Thu, 11 May 2017)

  Changed paths:
    M block/qcow2-refcount.c

  Log Message:
  -----------
  qcow2: Nicer variable names in qcow2_update_snapshot_refcount()

In order to keep checkpatch happy when the next patch changes
indentation, we first have to shorten some long lines.  The easiest
approach is to use a new variable in place of
'offset & L2E_OFFSET_MASK', except that 'offset' is the best name
for that variable.  Change '[old_]offset' to '[old_]entry' to
make room.

While touching things, also fix checkpatch warnings about unusual
'for' statements.

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


  Commit: bbd995d8307e4a15a7724f11adf104b6e07a0849
      
https://github.com/qemu/qemu/commit/bbd995d8307e4a15a7724f11adf104b6e07a0849
  Author: Eric Blake <address@hidden>
  Date:   2017-05-11 (Thu, 11 May 2017)

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

  Log Message:
  -----------
  qcow2: Use consistent switch indentation

Fix a couple of inconsistent indentations, before an upcoming
patch further tweaks the switch statements.
(best viewed with 'git diff -b').

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


  Commit: 4c41cb4955effff3447bd07a09e0af9c6e0453e3
      
https://github.com/qemu/qemu/commit/4c41cb4955effff3447bd07a09e0af9c6e0453e3
  Author: Eric Blake <address@hidden>
  Date:   2017-05-11 (Thu, 11 May 2017)

  Changed paths:
    M include/block/block.h
    M include/block/block_int.h

  Log Message:
  -----------
  block: Update comments on BDRV_BLOCK_* meanings

We had some conflicting documentation: a nice 8-way table that
described all possible combinations of DATA, ZERO, and
OFFSET_VALID, contrasted with text that implied that OFFSET_VALID
always meant raw data could be read directly.  Furthermore, the
text refers a lot to bs->file, even though the interface was
updated back in 67a0fd2a to let the driver pass back a specific
BDS (not necessarily bs->file).  As the 8-way table is the
intended semantics, simplify the rest of the text to get rid of
the confusion.

ALLOCATED is always set by the block layer for convenience (drivers
do not have to worry about it).  RAW is used only internally, but
by more than the raw driver.  Document these additional items on
the driver callback.

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


  Commit: 4341df8a83d6a528a1e2855735f87fc3aab42b70
      
https://github.com/qemu/qemu/commit/4341df8a83d6a528a1e2855735f87fc3aab42b70
  Author: Eric Blake <address@hidden>
  Date:   2017-05-11 (Thu, 11 May 2017)

  Changed paths:
    M block/qcow2-cluster.c

  Log Message:
  -----------
  qcow2: Correctly report status of preallocated zero clusters

We were throwing away the preallocation information associated with
zero clusters.  But we should be matching the well-defined semantics
in bdrv_get_block_status(), where (BDRV_BLOCK_ZERO |
BDRV_BLOCK_OFFSET_VALID) informs the user which offset is reserved,
while still reminding the user that reading from that offset is
likely to read garbage.

count_contiguous_clusters_by_type() is now used only for unallocated
cluster runs, hence it gets renamed and tightened.

Making this change lets us see which portions of an image are zero
but preallocated, when using qemu-img map --output=json.  The
--output=human side intentionally ignores all zero clusters, whether
or not they are preallocated.

The fact that there is no change to qemu-iotests './check -qcow2'
merely means that we aren't yet testing this aspect of qemu-img;
a later patch will add a test.

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


  Commit: 3ef9521893c41638148d4452ee4da75fd8ef71a9
      
https://github.com/qemu/qemu/commit/3ef9521893c41638148d4452ee4da75fd8ef71a9
  Author: Eric Blake <address@hidden>
  Date:   2017-05-11 (Thu, 11 May 2017)

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

  Log Message:
  -----------
  qcow2: Name typedef for cluster type

Although it doesn't add all that much type safety (this is C, after
all), it does add a bit of legibility to use the name QCow2ClusterType
instead of a plain int.

In particular, qcow2_get_cluster_offset() has an overloaded return
type; a QCow2ClusterType on success, and -errno on failure; keeping
the cluster type in a separate variable makes it slightly easier for
the next patch to make further computations based on the type.

Suggested-by: Max Reitz <address@hidden>
Signed-off-by: Eric Blake <address@hidden>
Message-id: address@hidden
[mreitz: Use the new type in two more places (one of them pulled from
   the next patch)]
Signed-off-by: Max Reitz <address@hidden>


  Commit: fdfab37dfeffefbd4533b4158055c9b82d7c3e69
      
https://github.com/qemu/qemu/commit/fdfab37dfeffefbd4533b4158055c9b82d7c3e69
  Author: Eric Blake <address@hidden>
  Date:   2017-05-11 (Thu, 11 May 2017)

  Changed paths:
    M block/qcow2-cluster.c
    M block/qcow2-refcount.c
    M block/qcow2.c
    M block/qcow2.h
    M tests/qemu-iotests/060.out

  Log Message:
  -----------
  qcow2: Make distinction between zero cluster types obvious

Treat plain zero clusters differently from allocated ones, so that
we can simplify the logic of checking whether an offset is present.
Do this by splitting QCOW2_CLUSTER_ZERO into two new enums,
QCOW2_CLUSTER_ZERO_PLAIN and QCOW2_CLUSTER_ZERO_ALLOC.

I tried to arrange the enum so that we could use
'ret <= QCOW2_CLUSTER_ZERO_PLAIN' for all unallocated types, and
'ret >= QCOW2_CLUSTER_ZERO_ALLOC' for allocated types, although
I didn't actually end up taking advantage of the layout.

In many cases, this leads to simpler code, by properly combining
cases (sometimes, both zero types pair together, other times,
plain zero is more like unallocated while allocated zero is more
like normal).

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


  Commit: 06cc5e2b2d01cb778c966e1b4135062556b3b054
      
https://github.com/qemu/qemu/commit/06cc5e2b2d01cb778c966e1b4135062556b3b054
  Author: Eric Blake <address@hidden>
  Date:   2017-05-11 (Thu, 11 May 2017)

  Changed paths:
    M block/qcow2-cluster.c

  Log Message:
  -----------
  qcow2: Optimize zero_single_l2() to minimize L2 churn

Similar to discard_single_l2(), we should try to avoid dirtying
the L2 cache when the cluster we are changing already has the
right characteristics.

Note that by the time we get to zero_single_l2(), BDRV_REQ_MAY_UNMAP
is a requirement to unallocate a cluster (this is because the block
layer clears that flag if discard.* flags during open requested that
we never punch holes - see the conversation around commit 170f4b2e,
https://lists.gnu.org/archive/html/qemu-devel/2016-09/msg07306.html).
Therefore, this patch can only reuse a zero cluster as-is if either
unmapping is not requested, or if the zero cluster was not associated
with an allocation.

Technically, there are some cases where an unallocated cluster
already reads as all zeroes (namely, when there is no backing file
[easy: check bs->backing], or when the backing file also reads as
zeroes [harder: we can't check bdrv_get_block_status since we are
already holding the lock]), where the guest would not immediately see
a difference if we left that cluster unallocated.  But if the user
did not request unmapping, leaving an unallocated cluster is wrong;
and even if the user DID request unmapping, keeping a cluster
unallocated risks a subtle semantic change of guest-visible contents
if a backing file is later added, and it is not worth auditing
whether all internal uses such as mirror properly avoid an unmap
request.  Thus, this patch is intentionally limited to just clusters
that are already marked as zero.

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


  Commit: d9ca2214bd058cfb4371b8373123c0444e4a5ac8
      
https://github.com/qemu/qemu/commit/d9ca2214bd058cfb4371b8373123c0444e4a5ac8
  Author: Eric Blake <address@hidden>
  Date:   2017-05-11 (Thu, 11 May 2017)

  Changed paths:
    M tests/qemu-iotests/122.out
    M tests/qemu-iotests/154.out
    M tests/qemu-iotests/common.filter

  Log Message:
  -----------
  iotests: Improve _filter_qemu_img_map

Although _filter_qemu_img_map documents that it scrubs offsets, it
was only doing so for human mode.  Of the existing tests using the
filter (97, 122, 150, 154, 176), two of them are affected, but it
does not hurt the validity of the tests to not require particular
mappings (another test, 66, uses offsets but intentionally does not
pass through _filter_qemu_img_map, because it checks that offsets
are unchanged before and after an operation).

Another justification for this patch is that it will allow a future
patch to utilize 'qemu-img map --output=json' to check the status of
preallocated zero clusters without regards to the mapping (since
the qcow2 mapping can be very sensitive to the chosen cluster size,
when preallocation is not in use).

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


  Commit: e249d5195279cfadb7f15e2ad55dd4fe1d67c105
      
https://github.com/qemu/qemu/commit/e249d5195279cfadb7f15e2ad55dd4fe1d67c105
  Author: Eric Blake <address@hidden>
  Date:   2017-05-11 (Thu, 11 May 2017)

  Changed paths:
    A tests/qemu-iotests/179
    A tests/qemu-iotests/179.out
    M tests/qemu-iotests/group

  Log Message:
  -----------
  iotests: Add test 179 to cover write zeroes with unmap

No tests were covering write zeroes with unmap.  Additionally,
I needed to prove that my previous patches for correct status
reporting and write zeroes optimizations actually had an impact.

The test works for cluster_size between 8k and 2M (for smaller
sizes, it fails because our allocation patterns are not contiguous
with small clusters - in part, the largest consecutive allocation
we tend to get is often bounded by the size covered by one L2
table).

Note that testing for zero clusters is tricky: 'qemu-io map'
reports whether data comes from the current layer of the image
(useful for sniffing out which regions of the file have
QCOW_OFLAG_ZERO) - but doesn't show which clusters have mappings;
while 'qemu-img map' sees "zero":true for both unallocated and
zero clusters for any qcow2 with no backing layer (so less useful
at detecting true zero clusters), but reliably shows mappings.
So we have to rely on both queries side-by-side at each point of
the test.

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


  Commit: fbaa6bb3d3b4be71b7e234e908cb3c6bd280a222
      
https://github.com/qemu/qemu/commit/fbaa6bb3d3b4be71b7e234e908cb3c6bd280a222
  Author: Eric Blake <address@hidden>
  Date:   2017-05-11 (Thu, 11 May 2017)

  Changed paths:
    M block/qcow2.c
    M tests/qemu-iotests/154
    M tests/qemu-iotests/154.out

  Log Message:
  -----------
  qcow2: Optimize write zero of unaligned tail cluster

We've already improved discards to operate efficiently on the tail
of an unaligned qcow2 image; it's time to make a similar improvement
to write zeroes.  The special case is only valid at the tail
cluster of a file, where we must recognize that any sectors beyond
the image end would implicitly read as zero, and therefore should
not penalize our logic for widening a partial cluster into writing
the whole cluster as zero.

However, note that for now, the special case of end-of-file is only
recognized if there is no backing file, or if the backing file has
the same length; that's because when the backing file is shorter
than the active layer, we don't have code in place to recognize
that reads of a sector unallocated at the top and beyond the backing
end-of-file are implicitly zero.  It's not much of a real loss,
because most people don't use images that aren't cluster-aligned,
or where the active layer is a different size than the backing
layer (especially where the difference falls within a single cluster).

Update test 154 to cover the new scenarios, using two images of
intentionally differing length.

While at it, fix the test to gracefully skip when run as
./check -qcow2 -o compat=0.10 154
since the older format lacks zero clusters already required earlier
in the test.

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


  Commit: f10ee139adee1c18d399dc57a7ee22a03fa59513
      
https://github.com/qemu/qemu/commit/f10ee139adee1c18d399dc57a7ee22a03fa59513
  Author: Eric Blake <address@hidden>
  Date:   2017-05-11 (Thu, 11 May 2017)

  Changed paths:
    M block/qcow2-cluster.c

  Log Message:
  -----------
  qcow2: Assert that cluster operations are aligned

We already audited (in commit 0c1bd469) that qcow2_discard_clusters()
is only passed cluster-aligned start values; but we can further
tighten the assertion that the only unaligned end value is at EOF.

Recent commits have taken advantage of an unaligned tail cluster,
for both discard and write zeroes.

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


  Commit: d2cb36af2b0040d421b347e6e4e803e07220f78d
      
https://github.com/qemu/qemu/commit/d2cb36af2b0040d421b347e6e4e803e07220f78d
  Author: Eric Blake <address@hidden>
  Date:   2017-05-11 (Thu, 11 May 2017)

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

  Log Message:
  -----------
  qcow2: Discard/zero clusters by byte count

Passing a byte offset, but sector count, when we ultimately
want to operate on cluster granularity, is madness.  Clean up
the external interfaces to take both offset and count as bytes,
while still keeping the assertion added previously that the
caller must align the values to a cluster.  Then rename things
to make sure backports don't get confused by changed units:
instead of qcow2_discard_clusters() and qcow2_zero_clusters(),
we now have qcow2_cluster_discard() and qcow2_cluster_zeroize().

The internal functions still operate on clusters at a time, and
return an int for number of cleared clusters; but on an image
with 2M clusters, a single L2 table holds 256k entries that each
represent a 2M cluster, totalling well over INT_MAX bytes if we
ever had a request for that many bytes at once.  All our callers
currently limit themselves to 32-bit bytes (and therefore fewer
clusters), but by making this function 64-bit clean, we have one
less place to clean up if we later improve the block layer to
support 64-bit bytes through all operations (with the block layer
auto-fragmenting on behalf of more-limited drivers), rather than
the current state where some interfaces are artificially limited
to INT_MAX at a time.

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


  Commit: 8dd30c86dd41a727f726a086fff97c7ce06cbe1d
      
https://github.com/qemu/qemu/commit/8dd30c86dd41a727f726a086fff97c7ce06cbe1d
  Author: Max Reitz <address@hidden>
  Date:   2017-05-11 (Thu, 11 May 2017)

  Changed paths:
    M MAINTAINERS

  Log Message:
  -----------
  MAINTAINERS: Add qemu-progress to the block layer

util/qemu-progress.c is currently unmaintained. The only user of its
functionality is qemu-img, so it effectively is part of the block layer.

Suggested-by: Fam Zheng <address@hidden>
Signed-off-by: Max Reitz <address@hidden>
Message-id: address@hidden
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Max Reitz <address@hidden>


  Commit: d541e201bd3ad888f02abeddf0e14f7b0c126529
      
https://github.com/qemu/qemu/commit/d541e201bd3ad888f02abeddf0e14f7b0c126529
  Author: Kevin Wolf <address@hidden>
  Date:   2017-05-11 (Thu, 11 May 2017)

  Changed paths:
    M MAINTAINERS
    M block/blkdebug.c
    M block/qcow2-cluster.c
    M block/qcow2-refcount.c
    M block/qcow2-snapshot.c
    M block/qcow2.c
    M block/qcow2.h
    M include/block/block.h
    M include/block/block_int.h
    M qapi/block-core.json
    M qemu-io-cmds.c
    M tests/qemu-iotests/019.out
    M tests/qemu-iotests/060.out
    M tests/qemu-iotests/102.out
    M tests/qemu-iotests/122.out
    M tests/qemu-iotests/146.out
    M tests/qemu-iotests/154
    M tests/qemu-iotests/154.out
    A tests/qemu-iotests/177
    A tests/qemu-iotests/177.out
    A tests/qemu-iotests/179
    A tests/qemu-iotests/179.out
    M tests/qemu-iotests/common.filter
    M tests/qemu-iotests/common.pattern
    M tests/qemu-iotests/group

  Log Message:
  -----------
  Merge remote-tracking branch 'mreitz/tags/pull-block-2017-05-11' into 
queue-block

Block patches for the block queue.

# gpg: Signature made Thu May 11 14:28:41 2017 CEST
# gpg:                using RSA key 0xF407DB0061D5CF40
# 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-2017-05-11: (22 commits)
  MAINTAINERS: Add qemu-progress to the block layer
  qcow2: Discard/zero clusters by byte count
  qcow2: Assert that cluster operations are aligned
  qcow2: Optimize write zero of unaligned tail cluster
  iotests: Add test 179 to cover write zeroes with unmap
  iotests: Improve _filter_qemu_img_map
  qcow2: Optimize zero_single_l2() to minimize L2 churn
  qcow2: Make distinction between zero cluster types obvious
  qcow2: Name typedef for cluster type
  qcow2: Correctly report status of preallocated zero clusters
  block: Update comments on BDRV_BLOCK_* meanings
  qcow2: Use consistent switch indentation
  qcow2: Nicer variable names in qcow2_update_snapshot_refcount()
  tests: Add coverage for recent block geometry fixes
  blkdebug: Add ability to override unmap geometries
  blkdebug: Simplify override logic
  blkdebug: Add pass-through write_zero and discard support
  blkdebug: Refactor error injection
  blkdebug: Sanity check block layer guarantees
  qemu-io: Switch 'map' output to byte-based reporting
  ...

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


  Commit: 33c53c54e404b2cf0d78864bf1fa22b28fa93402
      
https://github.com/qemu/qemu/commit/33c53c54e404b2cf0d78864bf1fa22b28fa93402
  Author: Daniel P. Berrange <address@hidden>
  Date:   2017-05-12 (Fri, 12 May 2017)

  Changed paths:
    M .travis.yml
    M configure
    R util/coroutine-gthread.c

  Log Message:
  -----------
  coroutine: remove GThread implementation

The GThread implementation is not functional enough to actually
run QEMU reliably. While it was potentially useful for debugging,
we have a scripts/qemugdb/coroutine.py to enable tracing of
ucontext coroutines in GDB, so that removes the only reason for
GThread to exist.

Signed-off-by: Daniel P. Berrange <address@hidden>
Acked-by: Alex Bennée <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: ee29d6adefcca7e76abb124183814ed3acc74fac
      
https://github.com/qemu/qemu/commit/ee29d6adefcca7e76abb124183814ed3acc74fac
  Author: Eric Blake <address@hidden>
  Date:   2017-05-12 (Fri, 12 May 2017)

  Changed paths:
    M block/io.c

  Log Message:
  -----------
  block: Simplify BDRV_BLOCK_RAW recursion

Since we are already in coroutine context during the body of
bdrv_co_get_block_status(), we can shave off a few layers of
wrappers when recursing to query the protocol when a format driver
returned BDRV_BLOCK_RAW.

Note that we are already using the correct recursion later on in
the same function, when probing whether the protocol layer is sparse
in order to find out if we can add BDRV_BLOCK_ZERO to an existing
BDRV_BLOCK_DATA|BDRV_BLOCK_OFFSET_VALID.

Signed-off-by: Eric Blake <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Reviewed-by: Fam Zheng <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 321d1dba8bef9676a77e9399484e3cd8bf2cf16a
      
https://github.com/qemu/qemu/commit/321d1dba8bef9676a77e9399484e3cd8bf2cf16a
  Author: Stefan Hajnoczi <address@hidden>
  Date:   2017-05-12 (Fri, 12 May 2017)

  Changed paths:
    M include/block/aio.h

  Log Message:
  -----------
  aio: add missing aio_notify() to aio_enable_external()

The main loop uses aio_disable_external()/aio_enable_external() to
temporarily disable processing of external AioContext clients like
device emulation.

This allows monitor commands to quiesce I/O and prevent the guest from
submitting new requests while a monitor command is in progress.

The aio_enable_external() API is currently broken when an IOThread is in
aio_poll() waiting for fd activity when the main loop re-enables
external clients.  Incrementing ctx->external_disable_cnt does not wake
the IOThread from ppoll(2) so fd processing remains suspended and leads
to unresponsive emulated devices.

This patch adds an aio_notify() call to aio_enable_external() so the
IOThread is kicked out of ppoll(2) and will re-arm the file descriptors.

The bug can be reproduced as follows:

  $ qemu -M accel=kvm -m 1024 \
   -object iothread,id=iothread0 \
   -device virtio-scsi-pci,iothread=iothread0,id=virtio-scsi-pci0 \
   -drive if=none,id=drive0,aio=native,cache=none,format=raw,file=test.img \
   -device scsi-hd,id=scsi-hd0,drive=drive0 \
   -qmp tcp::5555,server,nowait

  $ scripts/qmp/qmp-shell localhost:5555
  (qemu) blockdev-snapshot-sync device=drive0 snapshot-file=sn1.qcow2
   mode=absolute-paths format=qcow2

After blockdev-snapshot-sync completes the SCSI disk will be
unresponsive.  This leads to request timeouts inside the guest.

Reported-by: Qianqian Zhu <address@hidden>
Reviewed-by: Fam Zheng <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>
Message-id: address@hidden
Suggested-by: Fam Zheng <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 5651743c908d8c3b1ff0192ce9543a502ec7a206
      
https://github.com/qemu/qemu/commit/5651743c908d8c3b1ff0192ce9543a502ec7a206
  Author: Anthony Xu <address@hidden>
  Date:   2017-05-12 (Fri, 12 May 2017)

  Changed paths:
    M qom/cpu.c

  Log Message:
  -----------
  trace: add sanity check

If trace backend is set to TRACE_NOP, trace_get_vcpu_event_count
returns 0, cause bitmap_new call abort.

The abort can be triggered as follows:

  $ ./configure --enable-trace-backend=nop --target-list=x86_64-softmmu
  $ gdb ./x86_64-softmmu/qemu-system-x86_64 -M q35,accel=kvm -m 1G
  (gdb) bt
  #0  0x00007ffff04e25f7 in raise () from /lib64/libc.so.6
  #1  0x00007ffff04e3ce8 in abort () from /lib64/libc.so.6
  #2  0x00005555559de905 in bitmap_new (nbits=<optimized out>)
      at /home/root/git/qemu2.git/include/qemu/bitmap.h:96
  #3  cpu_common_initfn (obj=0x555556621d30) at qom/cpu.c:399
  #4  0x0000555555a11869 in object_init_with_type (obj=0x555556621d30, 
ti=0x55555656bbb0) at qom/object.c:341
  #5  0x0000555555a11869 in object_init_with_type (obj=0x555556621d30, 
ti=0x55555656bd30) at qom/object.c:341
  #6  0x0000555555a11efc in object_initialize_with_type (address@hidden, 
size=76560,
      address@hidden) at qom/object.c:376
  #7  0x0000555555a12061 in object_new_with_type (type=0x55555656bd30) at 
qom/object.c:484
  #8  0x0000555555a121c5 in object_new (address@hidden "qemu64-x86_64-cpu")
      at qom/object.c:494
  #9  0x00005555557f6e3d in pc_new_cpu (address@hidden "qemu64-x86_64-cpu", 
apic_id=0,
      address@hidden <error_fatal>) at 
/home/root/git/qemu2.git/hw/i386/pc.c:1101
  #10 0x00005555557fa33e in pc_cpus_init (address@hidden)
      at /home/root/git/qemu2.git/hw/i386/pc.c:1184
  #11 0x00005555557fe0f6 in pc_q35_init (machine=0x5555565f9690) at 
/home/root/git/qemu2.git/hw/i386/pc_q35.c:121
  #12 0x000055555574fbad in main (argc=<optimized out>, argv=<optimized out>, 
envp=<optimized out>) at vl.c:4562

Signed-off-by: Anthony Xu <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 3753e255da8f6a654c3e7b650a2d27734bec15f9
      
https://github.com/qemu/qemu/commit/3753e255da8f6a654c3e7b650a2d27734bec15f9
  Author: Stefan Hajnoczi <address@hidden>
  Date:   2017-05-12 (Fri, 12 May 2017)

  Changed paths:
    M MAINTAINERS
    M block.c
    M block/blkdebug.c
    M block/block-backend.c
    M block/file-posix.c
    M block/file-win32.c
    M block/qcow2-cluster.c
    M block/qcow2-refcount.c
    M block/qcow2-snapshot.c
    M block/qcow2.c
    M block/qcow2.h
    M blockdev.c
    M hw/block/nvme.c
    M hw/block/nvme.h
    M include/block/block.h
    M include/block/block_int.h
    M include/qemu/osdep.h
    M migration/migration.c
    M migration/savevm.c
    M qapi/block-core.json
    M qemu-img-cmds.hx
    M qemu-img.c
    M qemu-io-cmds.c
    M qemu-io.c
    M qmp.c
    M tests/drive_del-test.c
    M tests/nvme-test.c
    M tests/qemu-iotests/019.out
    M tests/qemu-iotests/030
    M tests/qemu-iotests/046
    M tests/qemu-iotests/055
    M tests/qemu-iotests/060.out
    M tests/qemu-iotests/066
    M tests/qemu-iotests/066.out
    M tests/qemu-iotests/085
    M tests/qemu-iotests/085.out
    M tests/qemu-iotests/087
    M tests/qemu-iotests/091
    M tests/qemu-iotests/102.out
    M tests/qemu-iotests/122.out
    M tests/qemu-iotests/146.out
    A tests/qemu-iotests/153
    A tests/qemu-iotests/153.out
    M tests/qemu-iotests/154
    M tests/qemu-iotests/154.out
    M tests/qemu-iotests/172
    M tests/qemu-iotests/172.out
    A tests/qemu-iotests/177
    A tests/qemu-iotests/177.out
    A tests/qemu-iotests/179
    A tests/qemu-iotests/179.out
    A tests/qemu-iotests/182
    A tests/qemu-iotests/182.out
    M tests/qemu-iotests/common.filter
    M tests/qemu-iotests/common.pattern
    M tests/qemu-iotests/group
    M tests/test-replication.c
    M tests/usb-hcd-uhci-test.c
    M tests/usb-hcd-xhci-test.c
    M tests/virtio-blk-test.c
    M tests/virtio-scsi-test.c
    M util/osdep.c

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

Block layer patches

# gpg: Signature made Thu 11 May 2017 10:31:37 AM EDT
# gpg:                using RSA key 0x7F09B272C88F2FD6
# gpg: Good signature from "Kevin Wolf <address@hidden>"
# Primary key fingerprint: DC3D EB15 9A9A F95D 3D74  56FE 7F09 B272 C88F 2FD6

* kwolf/tags/for-upstream: (58 commits)
  MAINTAINERS: Add qemu-progress to the block layer
  qcow2: Discard/zero clusters by byte count
  qcow2: Assert that cluster operations are aligned
  qcow2: Optimize write zero of unaligned tail cluster
  iotests: Add test 179 to cover write zeroes with unmap
  iotests: Improve _filter_qemu_img_map
  qcow2: Optimize zero_single_l2() to minimize L2 churn
  qcow2: Make distinction between zero cluster types obvious
  qcow2: Name typedef for cluster type
  qcow2: Correctly report status of preallocated zero clusters
  block: Update comments on BDRV_BLOCK_* meanings
  qcow2: Use consistent switch indentation
  qcow2: Nicer variable names in qcow2_update_snapshot_refcount()
  tests: Add coverage for recent block geometry fixes
  blkdebug: Add ability to override unmap geometries
  blkdebug: Simplify override logic
  blkdebug: Add pass-through write_zero and discard support
  blkdebug: Refactor error injection
  blkdebug: Sanity check block layer guarantees
  qemu-io: Switch 'map' output to byte-based reporting
  ...

Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: b54933eed532b10c8a1967d9f988262ccbb94ee2
      
https://github.com/qemu/qemu/commit/b54933eed532b10c8a1967d9f988262ccbb94ee2
  Author: Stefan Hajnoczi <address@hidden>
  Date:   2017-05-12 (Fri, 12 May 2017)

  Changed paths:
    M .travis.yml
    M block/io.c
    M configure
    M include/block/aio.h
    R util/coroutine-gthread.c

  Log Message:
  -----------
  Merge tag 'block-pull-request' into staging

# gpg: Signature made Fri 12 May 2017 10:37:12 AM EDT
# gpg:                using RSA key 0x9CA4ABB381AB73C8
# gpg: Good signature from "Stefan Hajnoczi <address@hidden>"
# gpg:                 aka "Stefan Hajnoczi <address@hidden>"
# Primary key fingerprint: 8695 A8BF D3F9 7CDA AC35  775A 9CA4 ABB3 81AB 73C8

* tag 'block-pull-request':
  aio: add missing aio_notify() to aio_enable_external()
  block: Simplify BDRV_BLOCK_RAW recursion
  coroutine: remove GThread implementation

Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 3a8760664d5c1a1a93c9012bdb8ac07ab8fd4b0d
      
https://github.com/qemu/qemu/commit/3a8760664d5c1a1a93c9012bdb8ac07ab8fd4b0d
  Author: Stefan Hajnoczi <address@hidden>
  Date:   2017-05-12 (Fri, 12 May 2017)

  Changed paths:
    M qom/cpu.c

  Log Message:
  -----------
  Merge tag 'tracing-pull-request' into staging

# gpg: Signature made Fri 12 May 2017 10:38:07 AM EDT
# gpg:                using RSA key 0x9CA4ABB381AB73C8
# gpg: Good signature from "Stefan Hajnoczi <address@hidden>"
# gpg:                 aka "Stefan Hajnoczi <address@hidden>"
# Primary key fingerprint: 8695 A8BF D3F9 7CDA AC35  775A 9CA4 ABB3 81AB 73C8

* tag 'tracing-pull-request':
  trace: add sanity check

Signed-off-by: Stefan Hajnoczi <address@hidden>


Compare: https://github.com/qemu/qemu/compare/ecc1f5adeec4...3a8760664d5c

reply via email to

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