qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] 975a7b: block: Raise an error when backing fi


From: Peter Maydell
Subject: [Qemu-commits] [qemu/qemu] 975a7b: block: Raise an error when backing file parameter ...
Date: Fri, 11 Sep 2020 11:00:37 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 975a7bd2280db5a8db96a92ff0811e08431a64c7
      
https://github.com/qemu/qemu/commit/975a7bd2280db5a8db96a92ff0811e08431a64c7
  Author: Connor Kuehl <ckuehl@redhat.com>
  Date:   2020-09-07 (Mon, 07 Sep 2020)

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

  Log Message:
  -----------
  block: Raise an error when backing file parameter is an empty string

Providing an empty string for the backing file parameter like so:

        qemu-img create -f qcow2 -b '' /tmp/foo

allows the flow of control to reach and subsequently fail an assert
statement because passing an empty string to

        bdrv_get_full_backing_filename_from_filename()

simply results in NULL being returned without an error being raised.

To fix this, let's check for an empty string when getting the value from
the opts list.

Reported-by: Attila Fazekas <afazekas@redhat.com>
Fixes: https://bugzilla.redhat.com/1809553
Signed-off-by: Connor Kuehl <ckuehl@redhat.com>
Message-Id: <20200813134722.802180-1-ckuehl@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: e4f310fe7f5ed85c96c4a2175ec46054d02e0f81
      
https://github.com/qemu/qemu/commit/e4f310fe7f5ed85c96c4a2175ec46054d02e0f81
  Author: Philippe Mathieu-Daudé <philmd@redhat.com>
  Date:   2020-09-07 (Mon, 07 Sep 2020)

  Changed paths:
    M block/nvme.c

  Log Message:
  -----------
  block/nvme: Replace magic value by SCALE_MS definition

Use self-explicit SCALE_MS definition instead of magic value.

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20200821195359.1285345-2-philmd@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: e266f52cfb77e9fb162d3d02230170a373076d85
      
https://github.com/qemu/qemu/commit/e266f52cfb77e9fb162d3d02230170a373076d85
  Author: Philippe Mathieu-Daudé <philmd@redhat.com>
  Date:   2020-09-07 (Mon, 07 Sep 2020)

  Changed paths:
    M block/nvme.c

  Log Message:
  -----------
  block/nvme: Avoid further processing if trace event not enabled

Avoid further processing if TRACE_NVME_SUBMIT_COMMAND_RAW is
not enabled. This is an untested intend of performance optimization.

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20200821195359.1285345-3-philmd@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: 0ea45f76eb78b7c05929779ee1f5b1f365c66927
      
https://github.com/qemu/qemu/commit/0ea45f76eb78b7c05929779ee1f5b1f365c66927
  Author: Philippe Mathieu-Daudé <philmd@redhat.com>
  Date:   2020-09-07 (Mon, 07 Sep 2020)

  Changed paths:
    M block/nvme.c

  Log Message:
  -----------
  block/nvme: Let nvme_create_queue_pair() fail gracefully

As nvme_create_queue_pair() is allowed to fail, replace the
alloc() calls by try_alloc() to avoid aborting QEMU.

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20200821195359.1285345-4-philmd@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: 73159e52e64a20ecb6f5968bda8e43035be6fd67
      
https://github.com/qemu/qemu/commit/73159e52e64a20ecb6f5968bda8e43035be6fd67
  Author: Philippe Mathieu-Daudé <philmd@redhat.com>
  Date:   2020-09-07 (Mon, 07 Sep 2020)

  Changed paths:
    M block/nvme.c

  Log Message:
  -----------
  block/nvme: Define INDEX macros to ease code review

Use definitions instead of '0' or '1' indexes. Also this will
be useful when using multi-queues later.

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20200821195359.1285345-5-philmd@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: bf6ce5ec6d6846d7c1fc3899438ec11efc9c8fc8
      
https://github.com/qemu/qemu/commit/bf6ce5ec6d6846d7c1fc3899438ec11efc9c8fc8
  Author: Philippe Mathieu-Daudé <philmd@redhat.com>
  Date:   2020-09-07 (Mon, 07 Sep 2020)

  Changed paths:
    M block/nvme.c

  Log Message:
  -----------
  block/nvme: Improve error message when IO queue creation failed

Do not use the same error message for different failures.
Display a different error whether it is the CQ or the SQ.

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20200821195359.1285345-6-philmd@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: c8edbfb2cc44ad78a8cfbdd6a0cd1af863e199fd
      
https://github.com/qemu/qemu/commit/c8edbfb2cc44ad78a8cfbdd6a0cd1af863e199fd
  Author: Philippe Mathieu-Daudé <philmd@redhat.com>
  Date:   2020-09-07 (Mon, 07 Sep 2020)

  Changed paths:
    M block/nvme.c

  Log Message:
  -----------
  block/nvme: Use common error path in nvme_add_io_queue()

Rearrange nvme_add_io_queue() by using a common error path.
This will be proven useful in few commits where we add IRQ
notification to the IO queues.

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20200821195359.1285345-7-philmd@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: 4d980939374054b569dca981b1fb8f353c24a0ac
      
https://github.com/qemu/qemu/commit/4d980939374054b569dca981b1fb8f353c24a0ac
  Author: Philippe Mathieu-Daudé <philmd@redhat.com>
  Date:   2020-09-07 (Mon, 07 Sep 2020)

  Changed paths:
    M block/nvme.c

  Log Message:
  -----------
  block/nvme: Rename local variable

We are going to modify the code in the next commit. Renaming
the 'resp' variable to 'id' first makes the next commit easier
to review. No logical changes.

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20200821195359.1285345-8-philmd@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: 7d3b214ae45be7fafaf514c089360a3efc6bc23f
      
https://github.com/qemu/qemu/commit/7d3b214ae45be7fafaf514c089360a3efc6bc23f
  Author: Philippe Mathieu-Daudé <philmd@redhat.com>
  Date:   2020-09-07 (Mon, 07 Sep 2020)

  Changed paths:
    M block/nvme.c

  Log Message:
  -----------
  block/nvme: Use union of NvmeIdCtrl / NvmeIdNs structures

We allocate an unique chunk of memory then use it for two
different structures. By using an union, we make it clear
the data is overlapping (and we can remove the casts).

Suggested-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20200821195359.1285345-9-philmd@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: 2ed846930df76bb5c708cbbfbae714607c4d7e12
      
https://github.com/qemu/qemu/commit/2ed846930df76bb5c708cbbfbae714607c4d7e12
  Author: Philippe Mathieu-Daudé <philmd@redhat.com>
  Date:   2020-09-07 (Mon, 07 Sep 2020)

  Changed paths:
    M block/nvme.c

  Log Message:
  -----------
  block/nvme: Replace qemu_try_blockalign0 by qemu_try_blockalign/memset

In the next commit we'll get rid of qemu_try_blockalign().
To ease review, first replace qemu_try_blockalign0() by explicit
calls to qemu_try_blockalign() and memset().

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20200821195359.1285345-10-philmd@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: 38e1f8186fc40054ae12b9b5e21f051c2f59cb9c
      
https://github.com/qemu/qemu/commit/38e1f8186fc40054ae12b9b5e21f051c2f59cb9c
  Author: Philippe Mathieu-Daudé <philmd@redhat.com>
  Date:   2020-09-07 (Mon, 07 Sep 2020)

  Changed paths:
    M block/nvme.c

  Log Message:
  -----------
  block/nvme: Replace qemu_try_blockalign(bs) by qemu_try_memalign(pg_sz)

qemu_try_blockalign() is a generic API that call back to the
block driver to return its page alignment. As we call from
within the very same driver, we already know to page alignment
stored in our state. Remove indirections and use the value from
BDRVNVMeState.
This change is required to later remove the BlockDriverState
argument, to make nvme_init_queue() per hardware, and not per
block driver.

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20200821195359.1285345-11-philmd@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: 3a6d34d0661d25215ca2bc92fa8aa0dbb22a4e81
      
https://github.com/qemu/qemu/commit/3a6d34d0661d25215ca2bc92fa8aa0dbb22a4e81
  Author: Philippe Mathieu-Daudé <philmd@redhat.com>
  Date:   2020-09-07 (Mon, 07 Sep 2020)

  Changed paths:
    M block/nvme.c

  Log Message:
  -----------
  block/nvme: Simplify nvme_init_queue() arguments

nvme_init_queue() doesn't require BlockDriverState anymore.
Replace it by BDRVNVMeState to simplify.

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20200821195359.1285345-12-philmd@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: 073a06978c67cbddcaba06f2c4cba28a64a0bd98
      
https://github.com/qemu/qemu/commit/073a06978c67cbddcaba06f2c4cba28a64a0bd98
  Author: Philippe Mathieu-Daudé <philmd@redhat.com>
  Date:   2020-09-07 (Mon, 07 Sep 2020)

  Changed paths:
    M block/nvme.c

  Log Message:
  -----------
  block/nvme: Replace BDRV_POLL_WHILE by AIO_WAIT_WHILE

BDRV_POLL_WHILE() is defined as:

  #define BDRV_POLL_WHILE(bs, cond) ({          \
      BlockDriverState *bs_ = (bs);             \
      AIO_WAIT_WHILE(bdrv_get_aio_context(bs_), \
                     cond); })

As we will remove the BlockDriverState use in the next commit,
start by using the exploded version of BDRV_POLL_WHILE().

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20200821195359.1285345-13-philmd@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: 0a28b02ef9e1db544e78918ee553637fa6166058
      
https://github.com/qemu/qemu/commit/0a28b02ef9e1db544e78918ee553637fa6166058
  Author: Philippe Mathieu-Daudé <philmd@redhat.com>
  Date:   2020-09-07 (Mon, 07 Sep 2020)

  Changed paths:
    M block/nvme.c

  Log Message:
  -----------
  block/nvme: Simplify nvme_create_queue_pair() arguments

nvme_create_queue_pair() doesn't require BlockDriverState anymore.
Replace it by BDRVNVMeState and AioContext to simplify.

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20200821195359.1285345-14-philmd@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: 7a1fb2ef40df508e90eb756a80d67e6435246cae
      
https://github.com/qemu/qemu/commit/7a1fb2ef40df508e90eb756a80d67e6435246cae
  Author: Philippe Mathieu-Daudé <philmd@redhat.com>
  Date:   2020-09-07 (Mon, 07 Sep 2020)

  Changed paths:
    M block/nvme.c

  Log Message:
  -----------
  block/nvme: Extract nvme_poll_queue()

As we want to do per-queue polling, extract the nvme_poll_queue()
method which operates on a single queue.

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20200821195359.1285345-15-philmd@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: b111b3fcdecc7ce441fa6760e116c3c45b4b8133
      
https://github.com/qemu/qemu/commit/b111b3fcdecc7ce441fa6760e116c3c45b4b8133
  Author: Philippe Mathieu-Daudé <philmd@redhat.com>
  Date:   2020-09-07 (Mon, 07 Sep 2020)

  Changed paths:
    M block/nvme.c

  Log Message:
  -----------
  block/nvme: Use an array of EventNotifier

In preparation of using multiple IRQ (thus multiple eventfds)
make BDRVNVMeState::irq_notifier an array (for now of a single
element, the admin queue notifier).

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20200821195359.1285345-16-philmd@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: 9a6fc88799cc9a68d2821e49665ca50de75f399c
      
https://github.com/qemu/qemu/commit/9a6fc88799cc9a68d2821e49665ca50de75f399c
  Author: Max Reitz <mreitz@redhat.com>
  Date:   2020-09-07 (Mon, 07 Sep 2020)

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

  Log Message:
  -----------
  block: Add child access functions

There are BDS children that the general block layer code can access,
namely bs->file and bs->backing.  Since the introduction of filters and
external data files, their meaning is not quite clear.  bs->backing can
be a COW source, or it can be a filtered child; bs->file can be a
filtered child, it can be data and metadata storage, or it can be just
metadata storage.

This overloading really is not helpful.  This patch adds functions that
retrieve the correct child for each exact purpose.  Later patches in
this series will make use of them.  Doing so will allow us to handle
filter nodes in a meaningful way.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>


  Commit: d38d7eb8a5e78ecc1906e763f59356a0b26a8b53
      
https://github.com/qemu/qemu/commit/d38d7eb8a5e78ecc1906e763f59356a0b26a8b53
  Author: Max Reitz <mreitz@redhat.com>
  Date:   2020-09-07 (Mon, 07 Sep 2020)

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

  Log Message:
  -----------
  block: Add chain helper functions

Add some helper functions for skipping filters in a chain of block
nodes.

Signed-off-by: Max Reitz <mreitz@redhat.com>


  Commit: 34778172f1eb75796c8af9fae8d88b889cff4fd2
      
https://github.com/qemu/qemu/commit/34778172f1eb75796c8af9fae8d88b889cff4fd2
  Author: Max Reitz <mreitz@redhat.com>
  Date:   2020-09-07 (Mon, 07 Sep 2020)

  Changed paths:
    M block.c

  Log Message:
  -----------
  block: bdrv_cow_child() for bdrv_has_zero_init()

bdrv_has_zero_init() should use bdrv_cow_child() if it wants to check
whether the given BDS has a COW backing file.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>


  Commit: 9ee413cb561092e2db2ba5a7110282a36fb9fd25
      
https://github.com/qemu/qemu/commit/9ee413cb561092e2db2ba5a7110282a36fb9fd25
  Author: Max Reitz <mreitz@redhat.com>
  Date:   2020-09-07 (Mon, 07 Sep 2020)

  Changed paths:
    M block.c

  Log Message:
  -----------
  block: bdrv_set_backing_hd() is about bs->backing

bdrv_set_backing_hd() is a function that explicitly cares about the
bs->backing child.  Highlight that in its description and use
child_bs(bs->backing) instead of backing_bs(bs) to make it more obvious.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>


  Commit: 7b99a26600ea4953f9eb9a0cc3aa4c84b19718cc
      
https://github.com/qemu/qemu/commit/7b99a26600ea4953f9eb9a0cc3aa4c84b19718cc
  Author: Max Reitz <mreitz@redhat.com>
  Date:   2020-09-07 (Mon, 07 Sep 2020)

  Changed paths:
    M block.c

  Log Message:
  -----------
  block: Include filters when freezing backing chain

In order to make filters work in backing chains, the associated
functions must be able to deal with them and freeze both COW and filter
child links.

While at it, add some comments that note which functions require their
caller to ensure that a given child link is not frozen, and how the
callers do so.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>


  Commit: 8b8277cdb05eef79bfe6b14c21dfaa027cebbd08
      
https://github.com/qemu/qemu/commit/8b8277cdb05eef79bfe6b14c21dfaa027cebbd08
  Author: Max Reitz <mreitz@redhat.com>
  Date:   2020-09-07 (Mon, 07 Sep 2020)

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

  Log Message:
  -----------
  block: Drop bdrv_is_encrypted()

The original purpose of bdrv_is_encrypted() was to inquire whether a BDS
can be used without the user entering a password or not.  It has not
been used for that purpose for quite some time.

Actually, it is not even fit for that purpose, because to answer that
question, it would have recursively query all of the given node's
children.

So now we have to decide in which direction we want to fix
bdrv_is_encrypted(): Recursively query all children, or drop it and just
use bs->encrypted to get the current node's status?

Nowadays, its only purpose is to report through bdrv_query_image_info()
whether the given image is encrypted or not.  For this purpose, it is
probably more interesting to see whether a given node itself is
encrypted or not (otherwise, a management application cannot discern for
certain which nodes are really encrypted and which just have encrypted
children).

Suggested-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>


  Commit: ae23f78646e9635ec9cbf15dbf82a717ea1b0e69
      
https://github.com/qemu/qemu/commit/ae23f78646e9635ec9cbf15dbf82a717ea1b0e69
  Author: Max Reitz <mreitz@redhat.com>
  Date:   2020-09-07 (Mon, 07 Sep 2020)

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

  Log Message:
  -----------
  block: Add bdrv_supports_compressed_writes()

Filters cannot compress data themselves but they have to implement
.bdrv_co_pwritev_compressed() still (or they cannot forward compressed
writes).  Therefore, checking whether
bs->drv->bdrv_co_pwritev_compressed is non-NULL is not sufficient to
know whether the node can actually handle compressed writes.  This
function looks down the filter chain to see whether there is a
non-filter that can actually convert the compressed writes into
compressed data (and thus normal writes).

Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>


  Commit: e7e754aec3aca3a509d8826cc9a6e6136e9aca65
      
https://github.com/qemu/qemu/commit/e7e754aec3aca3a509d8826cc9a6e6136e9aca65
  Author: Max Reitz <mreitz@redhat.com>
  Date:   2020-09-07 (Mon, 07 Sep 2020)

  Changed paths:
    M block/throttle.c

  Log Message:
  -----------
  throttle: Support compressed writes

Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>


  Commit: 4935e8be22745ff2b23bc87a5015176d991ce233
      
https://github.com/qemu/qemu/commit/4935e8be22745ff2b23bc87a5015176d991ce233
  Author: Max Reitz <mreitz@redhat.com>
  Date:   2020-09-07 (Mon, 07 Sep 2020)

  Changed paths:
    M block/copy-on-read.c

  Log Message:
  -----------
  copy-on-read: Support compressed writes

Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>


  Commit: 93393e698c76c9b95b1fcf9649eef41f9cdbbb07
      
https://github.com/qemu/qemu/commit/93393e698c76c9b95b1fcf9649eef41f9cdbbb07
  Author: Max Reitz <mreitz@redhat.com>
  Date:   2020-09-07 (Mon, 07 Sep 2020)

  Changed paths:
    M block.c
    M block/io.c
    M migration/block-dirty-bitmap.c

  Log Message:
  -----------
  block: Use bdrv_filter_(bs|child) where obvious

Places that use patterns like

    if (bs->drv->is_filter && bs->file) {
        ... something about bs->file->bs ...
    }

should be

    BlockDriverState *filtered = bdrv_filter_bs(bs);
    if (filtered) {
        ... something about @filtered ...
    }

instead.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>


  Commit: cb8503159a46f862303680816b1768bef78ac4e3
      
https://github.com/qemu/qemu/commit/cb8503159a46f862303680816b1768bef78ac4e3
  Author: Max Reitz <mreitz@redhat.com>
  Date:   2020-09-07 (Mon, 07 Sep 2020)

  Changed paths:
    M block/io.c

  Log Message:
  -----------
  block: Use CAFs in block status functions

Use the child access functions in the block status inquiry functions as
appropriate.

Signed-off-by: Max Reitz <mreitz@redhat.com>


  Commit: 67acfd21885b70ae0cd11f12e34821be3d8b90bb
      
https://github.com/qemu/qemu/commit/67acfd21885b70ae0cd11f12e34821be3d8b90bb
  Author: Max Reitz <mreitz@redhat.com>
  Date:   2020-09-07 (Mon, 07 Sep 2020)

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

  Log Message:
  -----------
  stream: Deal with filters

Because of the (not so recent anymore) changes that make the stream job
independent of the base node and instead track the node above it, we
have to split that "bottom" node into two cases: The bottom COW node,
and the node directly above the base node (which may be an R/W filter
or the bottom COW node).

Signed-off-by: Max Reitz <mreitz@redhat.com>


  Commit: dcf3f9b268a5c04bd94d721b81774092d7170cc4
      
https://github.com/qemu/qemu/commit/dcf3f9b268a5c04bd94d721b81774092d7170cc4
  Author: Max Reitz <mreitz@redhat.com>
  Date:   2020-09-07 (Mon, 07 Sep 2020)

  Changed paths:
    M block.c

  Log Message:
  -----------
  block: Use CAFs when working with backing chains

Use child access functions when iterating through backing chains so
filters do not break the chain.

In addition, bdrv_find_overlay() will now always return the actual
overlay; that is, it will never return a filter node but only one with a
COW backing file (there may be filter nodes between that node and @bs).

Signed-off-by: Max Reitz <mreitz@redhat.com>


  Commit: 23b93525a2f30915f6c8418eb23db6912a3b5811
      
https://github.com/qemu/qemu/commit/23b93525a2f30915f6c8418eb23db6912a3b5811
  Author: Max Reitz <mreitz@redhat.com>
  Date:   2020-09-07 (Mon, 07 Sep 2020)

  Changed paths:
    M block/io.c

  Log Message:
  -----------
  block: Use bdrv_cow_child() in bdrv_co_truncate()

The condition modified here is not about potentially filtered children,
but only about COW sources (i.e. traditional backing files).

Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>


  Commit: 1d42f48c3a468fbf53660970d7372d0f0f9d0529
      
https://github.com/qemu/qemu/commit/1d42f48c3a468fbf53660970d7372d0f0f9d0529
  Author: Max Reitz <mreitz@redhat.com>
  Date:   2020-09-07 (Mon, 07 Sep 2020)

  Changed paths:
    M block.c

  Log Message:
  -----------
  block: Re-evaluate backing file handling in reopen

Reopening a node's backing child needs a bit of special handling because
the "backing" child has different defaults than all other children
(among other things).  Adding filter support here is a bit more
difficult than just using the child access functions.  In fact, we often
have to directly use bs->backing because these functions are about the
"backing" child (which may or may not be the COW backing file).

Signed-off-by: Max Reitz <mreitz@redhat.com>


  Commit: 883833e29cb800b4d92b5d4736252f4004885191
      
https://github.com/qemu/qemu/commit/883833e29cb800b4d92b5d4736252f4004885191
  Author: Max Reitz <mreitz@redhat.com>
  Date:   2020-09-07 (Mon, 07 Sep 2020)

  Changed paths:
    M block/io.c

  Log Message:
  -----------
  block: Flush all children in generic code

If the driver does not support .bdrv_co_flush() so bdrv_co_flush()
itself has to flush the children of the given node, it should not flush
just bs->file->bs, but in fact all children that might have been written
to (judging from the permissions taken on them).

This is a bug fix for qcow2 images with an external data file, as they
so far did not flush that data_file node.

In any case, the BLKDBG_EVENT() should be emitted on the primary child,
because that is where a blkdebug node would be if there is any.

Suggested-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>


  Commit: fb787f02a6dc1c6b459316376ccfe186ee85a2dc
      
https://github.com/qemu/qemu/commit/fb787f02a6dc1c6b459316376ccfe186ee85a2dc
  Author: Max Reitz <mreitz@redhat.com>
  Date:   2020-09-07 (Mon, 07 Sep 2020)

  Changed paths:
    M block/vmdk.c

  Log Message:
  -----------
  vmdk: Drop vmdk_co_flush()

Before HEAD^, we needed this because bdrv_co_flush() by itself would
only flush bs->file.  With HEAD^, bdrv_co_flush() will flush all
children on which a WRITE or WRITE_UNCHANGED permission has been taken.
Thus, vmdk no longer needs to do it itself.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>


  Commit: 66b129ac5ec0f1c66e5574e91bd1e19c4047888b
      
https://github.com/qemu/qemu/commit/66b129ac5ec0f1c66e5574e91bd1e19c4047888b
  Author: Max Reitz <mreitz@redhat.com>
  Date:   2020-09-07 (Mon, 07 Sep 2020)

  Changed paths:
    M block/io.c

  Log Message:
  -----------
  block: Iterate over children in refresh_limits

Instead of looking at just bs->file and bs->backing, we should look at
all children that could end up receiving forwarded requests.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>


  Commit: 52f72d6fb62d83eb23f9ff45aad2d9a95c7f8f63
      
https://github.com/qemu/qemu/commit/52f72d6fb62d83eb23f9ff45aad2d9a95c7f8f63
  Author: Max Reitz <mreitz@redhat.com>
  Date:   2020-09-07 (Mon, 07 Sep 2020)

  Changed paths:
    M block.c

  Log Message:
  -----------
  block: Use CAFs in bdrv_refresh_filename()

bdrv_refresh_filename() and the kind of related bdrv_dirname() should
look to the primary child when they wish to copy the underlying file's
filename.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>


  Commit: c4db2e25df0e4a91bd8a8044756fe3c712b11768
      
https://github.com/qemu/qemu/commit/c4db2e25df0e4a91bd8a8044756fe3c712b11768
  Author: Max Reitz <mreitz@redhat.com>
  Date:   2020-09-07 (Mon, 07 Sep 2020)

  Changed paths:
    M block/io.c

  Log Message:
  -----------
  block: Use CAF in bdrv_co_rw_vmstate()

If a node whose driver does not provide VM state functions has a
metadata child, the VM state should probably go there; if it is a
filter, the VM state should probably go there.  It follows that we
should generally go down to the primary child.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>


  Commit: c8af87573f90e6b2ce828177664ea552efe2b249
      
https://github.com/qemu/qemu/commit/c8af87573f90e6b2ce828177664ea552efe2b249
  Author: Max Reitz <mreitz@redhat.com>
  Date:   2020-09-07 (Mon, 07 Sep 2020)

  Changed paths:
    M block/snapshot.c

  Log Message:
  -----------
  block/snapshot: Fix fallback

If the top node's driver does not provide snapshot functionality and we
want to fall back to a node down the chain, we need to snapshot all
non-COW children.  For simplicity's sake, just do not fall back if there
is more than one such child.  Furthermore, we really only can fall back
to bs->file and bs->backing, because bdrv_snapshot_goto() has to modify
the child link (notably, set it to NULL).

Suggested-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>


  Commit: f706a92f249b573c624fa5a8067fa1c6636a6ae0
      
https://github.com/qemu/qemu/commit/f706a92f249b573c624fa5a8067fa1c6636a6ae0
  Author: Max Reitz <mreitz@redhat.com>
  Date:   2020-09-07 (Mon, 07 Sep 2020)

  Changed paths:
    M block.c

  Log Message:
  -----------
  block: Use CAFs for debug breakpoints

When looking for a blkdebug node (which implements debug breakpoints),
use bdrv_primary_bs() to iterate through the graph, because that is
where a blkdebug node would be.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>


  Commit: 081e465026769a24b86ba2e6a77709cfea33f16a
      
https://github.com/qemu/qemu/commit/081e465026769a24b86ba2e6a77709cfea33f16a
  Author: Max Reitz <mreitz@redhat.com>
  Date:   2020-09-07 (Mon, 07 Sep 2020)

  Changed paths:
    M block.c

  Log Message:
  -----------
  block: Improve get_allocated_file_size's default

There are two practical problems with bdrv_get_allocated_file_size()'s
default right now:
(1) For drivers with children, we should generally sum all their sizes
    instead of just passing the request through to bs->file.  The latter
    is good for filters, but not so much for format drivers.

(2) Filters need not have bs->file, so we should actually go to the
    filtered child instead of hard-coding bs->file.

Fix this by splitting the default implementation into three branches:
(1) For filter drivers: Return the size of the filtered child
(2) For protocol drivers: Return -ENOTSUP, because the default
    implementation cannot make a guess
(3) For other drivers: Sum all data-bearing children's sizes

Signed-off-by: Max Reitz <mreitz@redhat.com>


  Commit: 07cd7b659a7169ed4c5c6b45b48d8351566ed4cb
      
https://github.com/qemu/qemu/commit/07cd7b659a7169ed4c5c6b45b48d8351566ed4cb
  Author: Max Reitz <mreitz@redhat.com>
  Date:   2020-09-07 (Mon, 07 Sep 2020)

  Changed paths:
    M block/null.c
    M tests/qemu-iotests/153.out
    M tests/qemu-iotests/184
    M tests/qemu-iotests/184.out

  Log Message:
  -----------
  block/null: Implement bdrv_get_allocated_file_size

It is trivial, so we might as well do it.

Remove _filter_actual_image_size from iotest 184, so we get to see the
result in its reference output.

Signed-off-by: Max Reitz <mreitz@redhat.com>


  Commit: 7cc734a9ea1c57afe3b3fdeaba33b6a7da73bca2
      
https://github.com/qemu/qemu/commit/7cc734a9ea1c57afe3b3fdeaba33b6a7da73bca2
  Author: Max Reitz <mreitz@redhat.com>
  Date:   2020-09-07 (Mon, 07 Sep 2020)

  Changed paths:
    M blockdev.c

  Log Message:
  -----------
  blockdev: Use CAF in external_snapshot_prepare()

This allows us to differentiate between filters and nodes with COW
backing files: Filters cannot be used as overlays at all (for this
function).

Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>


  Commit: 3f26191c7350c28d9c17b5eba253bff367b6cb2e
      
https://github.com/qemu/qemu/commit/3f26191c7350c28d9c17b5eba253bff367b6cb2e
  Author: Max Reitz <mreitz@redhat.com>
  Date:   2020-09-07 (Mon, 07 Sep 2020)

  Changed paths:
    M block/qapi.c

  Log Message:
  -----------
  block: Report data child for query-blockstats

It makes no sense to report the block stats of a purely metadata-storing
child in query-blockstats.  So if the primary child does not have any
data, try to find a unique data-storing child.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>


  Commit: 0a7585dbba2bd28f3797ca414c82e526d9814ab1
      
https://github.com/qemu/qemu/commit/0a7585dbba2bd28f3797ca414c82e526d9814ab1
  Author: Max Reitz <mreitz@redhat.com>
  Date:   2020-09-07 (Mon, 07 Sep 2020)

  Changed paths:
    M block/qapi.c
    M tests/qemu-iotests/184.out

  Log Message:
  -----------
  block: Use child access functions for QAPI queries

query-block, query-named-block-nodes, and query-blockstats now return
any filtered child under "backing", not just bs->backing or COW
children.  This is so that filters do not interrupt the reported backing
chain.  This changes the output for iotest 184, as the throttled node
now appears as a backing child.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>


  Commit: c6f6d8462cecda0b9c390831904f1346c01f75ee
      
https://github.com/qemu/qemu/commit/c6f6d8462cecda0b9c390831904f1346c01f75ee
  Author: Max Reitz <mreitz@redhat.com>
  Date:   2020-09-07 (Mon, 07 Sep 2020)

  Changed paths:
    M block/block-copy.c

  Log Message:
  -----------
  block-copy: Use CAF to find sync=top base

Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>


  Commit: 3f072a7fb747413bbf6a63fd6476888b6b671a04
      
https://github.com/qemu/qemu/commit/3f072a7fb747413bbf6a63fd6476888b6b671a04
  Author: Max Reitz <mreitz@redhat.com>
  Date:   2020-09-07 (Mon, 07 Sep 2020)

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

  Log Message:
  -----------
  mirror: Deal with filters

This includes some permission limiting (for example, we only need to
take the RESIZE permission for active commits where the base is smaller
than the top).

base_overlay is introduced so we can query bdrv_is_allocated_above() on
it - we cannot do that with base itself, because a filter's block_status
is the same as its child node, so if there are filters on base,
bdrv_is_allocated_above() on base would return information including
base.

Use this opportunity to rename qmp_drive_mirror()'s "source" BDS to
"target_backing_bs", because that is what it really refers to.

Signed-off-by: Max Reitz <mreitz@redhat.com>


  Commit: 2b088c60bbe59e4f48fede97263bb293bd38e43e
      
https://github.com/qemu/qemu/commit/2b088c60bbe59e4f48fede97263bb293bd38e43e
  Author: Max Reitz <mreitz@redhat.com>
  Date:   2020-09-07 (Mon, 07 Sep 2020)

  Changed paths:
    M block/backup-top.c
    M block/backup.c
    M blockdev.c

  Log Message:
  -----------
  backup: Deal with filters

Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>


  Commit: 9a71b9de3f08941577a9760021f52771aaba4fa4
      
https://github.com/qemu/qemu/commit/9a71b9de3f08941577a9760021f52771aaba4fa4
  Author: Max Reitz <mreitz@redhat.com>
  Date:   2020-09-07 (Mon, 07 Sep 2020)

  Changed paths:
    M block/block-backend.c
    M block/commit.c
    M block/monitor/block-hmp-cmds.c
    M blockdev.c

  Log Message:
  -----------
  commit: Deal with filters

This includes some permission limiting (for example, we only need to
take the RESIZE permission if the base is smaller than the top).

Signed-off-by: Max Reitz <mreitz@redhat.com>


  Commit: ee2f94ca2799f3a6536cf19235c9bb44be919956
      
https://github.com/qemu/qemu/commit/ee2f94ca2799f3a6536cf19235c9bb44be919956
  Author: Max Reitz <mreitz@redhat.com>
  Date:   2020-09-07 (Mon, 07 Sep 2020)

  Changed paths:
    M nbd/server.c

  Log Message:
  -----------
  nbd: Use CAF when looking for dirty bitmap

When looking for a dirty bitmap to share, we should handle filters by
just including them in the search (so they do not break backing chains).

Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>


  Commit: 4a2061e66d1fb16c14ca65b2c702363361adeb7b
      
https://github.com/qemu/qemu/commit/4a2061e66d1fb16c14ca65b2c702363361adeb7b
  Author: Max Reitz <mreitz@redhat.com>
  Date:   2020-09-07 (Mon, 07 Sep 2020)

  Changed paths:
    M qemu-img.c
    M tests/qemu-iotests/204.out

  Log Message:
  -----------
  qemu-img: Use child access functions

This changes iotest 204's output, because blkdebug on top of a COW node
used to make qemu-img map disregard the rest of the backing chain (the
backing chain was broken by the filter).  With this patch, the
allocation in the base image is reported correctly.

Signed-off-by: Max Reitz <mreitz@redhat.com>


  Commit: f1a7f18f07ef41b4d078621bd6e515165106d91f
      
https://github.com/qemu/qemu/commit/f1a7f18f07ef41b4d078621bd6e515165106d91f
  Author: Max Reitz <mreitz@redhat.com>
  Date:   2020-09-07 (Mon, 07 Sep 2020)

  Changed paths:
    M include/block/block_int.h

  Log Message:
  -----------
  block: Drop backing_bs()

We want to make it explicit where bs->backing is used, and we have done
so.  The old role of backing_bs() is now effectively taken by
bdrv_cow_bs().

Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>


  Commit: 05ea385afdfe5d0886265880bfd14d17192beb03
      
https://github.com/qemu/qemu/commit/05ea385afdfe5d0886265880bfd14d17192beb03
  Author: Max Reitz <mreitz@redhat.com>
  Date:   2020-09-07 (Mon, 07 Sep 2020)

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

  Log Message:
  -----------
  blockdev: Fix active commit choice

We have to perform an active commit whenever the top node has a parent
that has taken the WRITE permission on it.

This means that block-commit's @backing-file parameter is no longer
allowed for such nodes, and that users will have to issue a
block-job-complete command.  Neither should pose a problem in practice,
because this case was basically just broken until now.

(Since this commit already touches block-commit's documentation, it also
moves up the chunk explaining general block-commit behavior that for
some reason was situated under @backing-file.)

Signed-off-by: Max Reitz <mreitz@redhat.com>


  Commit: 549ec0d9783e1a94e502e677fe0ce4a90c0bd7df
      
https://github.com/qemu/qemu/commit/549ec0d9783e1a94e502e677fe0ce4a90c0bd7df
  Author: Max Reitz <mreitz@redhat.com>
  Date:   2020-09-07 (Mon, 07 Sep 2020)

  Changed paths:
    M block/backup-top.c
    M block/blkdebug.c
    M block/blklogwrites.c
    M block/commit.c
    M block/copy-on-read.c
    M block/filter-compress.c
    M block/io.c
    M block/mirror.c
    M block/throttle.c
    M include/block/block_int.h

  Log Message:
  -----------
  block: Inline bdrv_co_block_status_from_*()

With bdrv_filter_bs(), we can easily handle this default filter behavior
in bdrv_co_block_status().

blkdebug wants to have an additional assertion, so it keeps its own
implementation, except bdrv_co_block_status_from_file() needs to be
inlined there.

Suggested-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>


  Commit: 0b877d09df4557900149384d60be0e9c3d309105
      
https://github.com/qemu/qemu/commit/0b877d09df4557900149384d60be0e9c3d309105
  Author: Max Reitz <mreitz@redhat.com>
  Date:   2020-09-07 (Mon, 07 Sep 2020)

  Changed paths:
    M block.c
    M block/qapi.c
    M include/block/block_int.h
    M tests/qemu-iotests/228
    M tests/qemu-iotests/228.out
    M tests/qemu-iotests/245
    M tests/qemu-iotests/273.out

  Log Message:
  -----------
  block: Leave BDS.backing_{file,format} constant

Parts of the block layer treat BDS.backing_file as if it were whatever
the image header says (i.e., if it is a relative path, it is relative to
the overlay), other parts treat it like a cache for
bs->backing->bs->filename (relative paths are relative to the CWD).
Considering bs->backing->bs->filename exists, let us make it mean the
former.

Among other things, this now allows the user to specify a base when
using qemu-img to commit an image file in a directory that is not the
CWD (assuming, everything uses relative filenames).

Before this patch:

$ ./qemu-img create -f qcow2 foo/bot.qcow2 1M
$ ./qemu-img create -f qcow2 -b bot.qcow2 foo/mid.qcow2
$ ./qemu-img create -f qcow2 -b mid.qcow2 foo/top.qcow2
$ ./qemu-img commit -b mid.qcow2 foo/top.qcow2
qemu-img: Did not find 'mid.qcow2' in the backing chain of 'foo/top.qcow2'
$ ./qemu-img commit -b foo/mid.qcow2 foo/top.qcow2
qemu-img: Did not find 'foo/mid.qcow2' in the backing chain of 'foo/top.qcow2'
$ ./qemu-img commit -b $PWD/foo/mid.qcow2 foo/top.qcow2
qemu-img: Did not find '[...]/foo/mid.qcow2' in the backing chain of 
'foo/top.qcow2'

After this patch:

$ ./qemu-img commit -b mid.qcow2 foo/top.qcow2
Image committed.
$ ./qemu-img commit -b foo/mid.qcow2 foo/top.qcow2
qemu-img: Did not find 'foo/mid.qcow2' in the backing chain of 'foo/top.qcow2'
$ ./qemu-img commit -b $PWD/foo/mid.qcow2 foo/top.qcow2
Image committed.

With this change, bdrv_find_backing_image() must look at whether the
user has overridden a BDS's backing file.  If so, it can no longer use
bs->backing_file, but must instead compare the given filename against
the backing node's filename directly.

Note that this changes the QAPI output for a node's backing_file.  We
had very inconsistent output there (sometimes what the image header
said, sometimes the actual filename of the backing image).  This
inconsistent output was effectively useless, so we have to decide one
way or the other.  Considering that bs->backing_file usually at runtime
contained the path to the image relative to qemu's CWD (or absolute),
this patch changes QAPI's backing_file to always report the
bs->backing->bs->filename from now on.  If you want to receive the image
header information, you have to refer to full-backing-filename.

This necessitates a change to iotest 228.  The interesting information
it really wanted is the image header, and it can get that now, but it
has to use full-backing-filename instead of backing_file.  Because of
this patch's changes to bs->backing_file's behavior, we also need some
reference output changes.

Along with the changes to bs->backing_file, stop updating
BDS.backing_format in bdrv_backing_attach() as well.  This way,
ImageInfo's backing-filename and backing-filename-format fields will
represent what the image header says and nothing else.

iotest 245 changes in behavior: With the backing node no longer
overriding the parent node's backing_file string, you can now omit the
@backing option when reopening a node with neither a default nor a
current backing file even if it used to have a backing node at some
point.

273 also changes: The base image is opened without a format layer, so
ImageInfo.backing-filename-format used to report "file" for the base
image's overlay after blockdev-snapshot.  However, the image header
never says "file" anywhere, so it now reports $IMGFMT.

Signed-off-by: Max Reitz <mreitz@redhat.com>


  Commit: c365625b0a7b44ad48dc9ab01605857c8d4cf2c3
      
https://github.com/qemu/qemu/commit/c365625b0a7b44ad48dc9ab01605857c8d4cf2c3
  Author: Max Reitz <mreitz@redhat.com>
  Date:   2020-09-07 (Mon, 07 Sep 2020)

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

  Log Message:
  -----------
  iotests: Test that qcow2's data-file is flushed

Flushing a qcow2 node must lead to the data-file node being flushed as
well.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>


  Commit: c682bf18c92d3c8b91cc81287954896f226800e1
      
https://github.com/qemu/qemu/commit/c682bf18c92d3c8b91cc81287954896f226800e1
  Author: Max Reitz <mreitz@redhat.com>
  Date:   2020-09-07 (Mon, 07 Sep 2020)

  Changed paths:
    M tests/qemu-iotests/iotests.py

  Log Message:
  -----------
  iotests: Let complete_and_wait() work with commit

complete_and_wait() and wait_ready() currently only work for mirror
jobs.  Let them work for active commit jobs, too.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>


  Commit: ffbba7fd11016d39363041ef6696a825f2b317fa
      
https://github.com/qemu/qemu/commit/ffbba7fd11016d39363041ef6696a825f2b317fa
  Author: Max Reitz <mreitz@redhat.com>
  Date:   2020-09-08 (Tue, 08 Sep 2020)

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

  Log Message:
  -----------
  iotests: Add filter commit test cases

This patch adds some tests on how commit copes with filter nodes.

Signed-off-by: Max Reitz <mreitz@redhat.com>


  Commit: 5f71c6b004c7c4509297f4426f0bbc836cac106f
      
https://github.com/qemu/qemu/commit/5f71c6b004c7c4509297f4426f0bbc836cac106f
  Author: Max Reitz <mreitz@redhat.com>
  Date:   2020-09-08 (Tue, 08 Sep 2020)

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

  Log Message:
  -----------
  iotests: Add filter mirror test cases

This patch adds some test cases how mirroring relates to filters.  One
of them tests what happens when you mirror off a filtered COW node, two
others use the mirror filter node as basically our only example of an
implicitly created filter node so far (besides the commit filter).

Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>


  Commit: 6c3e1106429a91419d1d91b4303596b7664763ac
      
https://github.com/qemu/qemu/commit/6c3e1106429a91419d1d91b4303596b7664763ac
  Author: Max Reitz <mreitz@redhat.com>
  Date:   2020-09-08 (Tue, 08 Sep 2020)

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

  Log Message:
  -----------
  iotests: Add test for commit in sub directory

Add a test for committing an overlay in a sub directory to one of the
images in its backing chain, using both relative and absolute filenames.

Signed-off-by: Max Reitz <mreitz@redhat.com>


  Commit: 374eedd1c47bafca912a67d556eb2f1c1c0b171a
      
https://github.com/qemu/qemu/commit/374eedd1c47bafca912a67d556eb2f1c1c0b171a
  Author: Max Reitz <mreitz@redhat.com>
  Date:   2020-09-08 (Tue, 08 Sep 2020)

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

  Log Message:
  -----------
  iotests: Test committing to overridden backing

Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>


  Commit: b1cbc33a3971b6bb005d5ac3569feae35a71de0f
      
https://github.com/qemu/qemu/commit/b1cbc33a3971b6bb005d5ac3569feae35a71de0f
  Author: Kevin Wolf <kwolf@redhat.com>
  Date:   2020-09-10 (Thu, 10 Sep 2020)

  Changed paths:
    M tests/qemu-iotests/check

  Log Message:
  -----------
  iotests: Allow running from different directory

It is convenient to be able to edit the tests and run them without
changing the current working directory back and forth. Instead of
assuming that $PWD is the qemu-iotests build directory, derive the build
directory from the executed script.

This allows 'check' to find the required files even when called from
another directory. The scratch directory will still be in the current
working directory.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Message-Id: <20200902110326.257115-1-kwolf@redhat.com>
Reviewed-by: Claudio Fontana <cfontana@suse.de>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: 3b079ac0ffc8e1d9e6528b6e258e7e0d494d9aa0
      
https://github.com/qemu/qemu/commit/3b079ac0ffc8e1d9e6528b6e258e7e0d494d9aa0
  Author: Kevin Wolf <kwolf@redhat.com>
  Date:   2020-09-10 (Thu, 10 Sep 2020)

  Changed paths:
    M block/file-win32.c

  Log Message:
  -----------
  file-win32: Fix "locking" option

The intended behaviour was that locking=off/auto work and have no
effect (to remain compatible with file-posix), whereas locking=on would
return an error. Unfortunately, the code forgot to remove "locking" from
the options QDict, so any attempt to use the option would fail.

Replace the option parsing code for "locking" with something that is
part of the raw_runtime_opts QemuOptsList (so it is properly removed
from the QDict) and looks more like file-posix.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Message-Id: <20200907092739.9988-1-kwolf@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: 0ea32f34ce08e10c3d715cfa1427a23fb7989196
      
https://github.com/qemu/qemu/commit/0ea32f34ce08e10c3d715cfa1427a23fb7989196
  Author: Philippe Mathieu-Daudé <philmd@redhat.com>
  Date:   2020-09-10 (Thu, 10 Sep 2020)

  Changed paths:
    M block/nvme.c

  Log Message:
  -----------
  block/nvme: Group controller registers in NVMeRegs structure

We want to use the NvmeBar structure from "block/nvme.h" in the
next commit. As a preliminary step, group all the NVMe controller
registers in the 'ctrl' field, keeping the doorbells registers
out of it.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20200904124130.583838-2-philmd@redhat.com>
Reviewed-by: Klaus Jensen <k.jensen@samsung.com>
Reviewed-by: Fam Zheng <fam@euphon.net>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: c7100f0a0bec585b88b67138f6e33791ec2dbf3e
      
https://github.com/qemu/qemu/commit/c7100f0a0bec585b88b67138f6e33791ec2dbf3e
  Author: Philippe Mathieu-Daudé <philmd@redhat.com>
  Date:   2020-09-10 (Thu, 10 Sep 2020)

  Changed paths:
    M block/nvme.c

  Log Message:
  -----------
  block/nvme: Use generic NvmeBar structure

Commit f3c507adcd7 ("NVMe: Initial commit for new storage interface")
introduced the NvmeBar structure. Unfortunately in commit bdd6a90a9e5
("block: Add VFIO based NVMe driver") we duplicated it.

Apparently in commit a3d9a352d48 ("block: Move NVMe constants to
a separate header") we tried to unify headers but forgot to remove
the structure declared in the block/nvme.c source file.

Do it now, and remove the structure size check which is redundant
with the header check added in commit 74e18435c0e ("hw/block/nvme:
Align I/O BAR to 4 KiB").

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20200904124130.583838-3-philmd@redhat.com>
Reviewed-by: Klaus Jensen <k.jensen@samsung.com>
Reviewed-by: Fam Zheng <fam@euphon.net>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: e5ff22ba9fc276c2f8f56af7d82770da027671f1
      
https://github.com/qemu/qemu/commit/e5ff22ba9fc276c2f8f56af7d82770da027671f1
  Author: Philippe Mathieu-Daudé <philmd@redhat.com>
  Date:   2020-09-10 (Thu, 10 Sep 2020)

  Changed paths:
    M block/nvme.c

  Log Message:
  -----------
  block/nvme: Pair doorbell registers

For each queue doorbell registers are paired as:
- Submission Queue Tail Doorbell
- Completion Queue Head Doorbell

Reflect that in the NVMeRegs structure, and adapt
nvme_create_queue_pair() accordingly.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20200904124130.583838-4-philmd@redhat.com>
Reviewed-by: Klaus Jensen <k.jensen@samsung.com>
Reviewed-by: Fam Zheng <fam@euphon.net>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: b9be6faed1a069526efdc80df7318b16afc6e116
      
https://github.com/qemu/qemu/commit/b9be6faed1a069526efdc80df7318b16afc6e116
  Author: Thomas Huth <thuth@redhat.com>
  Date:   2020-09-10 (Thu, 10 Sep 2020)

  Changed paths:
    M block/qcow2-cluster.c

  Log Message:
  -----------
  block/qcow2-cluster: Add missing "fallthrough" annotation

When compiling with -Werror=implicit-fallthrough, the compiler currently
complains:

../../devel/qemu/block/qcow2-cluster.c: In function ‘cluster_needs_new_alloc’:
../../devel/qemu/block/qcow2-cluster.c:1320:12: error: this statement may fall
 through [-Werror=implicit-fallthrough=]
         if (l2_entry & QCOW_OFLAG_COPIED) {
            ^
../../devel/qemu/block/qcow2-cluster.c:1323:5: note: here
     case QCOW2_CLUSTER_UNALLOCATED:
     ^~~~

It's quite obvious that the fallthrough is intended here, so let's add
a comment to silence the compiler warning.

Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20200908070028.193298-1-thuth@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: 2499453eb1cbb68a45d7562a180afd7659007fd4
      
https://github.com/qemu/qemu/commit/2499453eb1cbb68a45d7562a180afd7659007fd4
  Author: Peter Maydell <peter.maydell@linaro.org>
  Date:   2020-09-11 (Fri, 11 Sep 2020)

  Changed paths:
    M block.c
    M block/backup-top.c
    M block/backup.c
    M block/blkdebug.c
    M block/blklogwrites.c
    M block/block-backend.c
    M block/block-copy.c
    M block/commit.c
    M block/copy-on-read.c
    M block/file-win32.c
    M block/filter-compress.c
    M block/io.c
    M block/mirror.c
    M block/monitor/block-hmp-cmds.c
    M block/null.c
    M block/nvme.c
    M block/qapi.c
    M block/qcow2-cluster.c
    M block/snapshot.c
    M block/stream.c
    M block/throttle.c
    M block/vmdk.c
    M blockdev.c
    M include/block/block.h
    M include/block/block_int.h
    M migration/block-dirty-bitmap.c
    M nbd/server.c
    M qapi/block-core.json
    M qemu-img.c
    M tests/qemu-iotests/020
    M tests/qemu-iotests/020.out
    M tests/qemu-iotests/040
    M tests/qemu-iotests/040.out
    M tests/qemu-iotests/041
    M tests/qemu-iotests/041.out
    M tests/qemu-iotests/049
    M tests/qemu-iotests/049.out
    M tests/qemu-iotests/153.out
    M tests/qemu-iotests/184
    M tests/qemu-iotests/184.out
    M tests/qemu-iotests/204.out
    M tests/qemu-iotests/228
    M tests/qemu-iotests/228.out
    M tests/qemu-iotests/244
    M tests/qemu-iotests/244.out
    M tests/qemu-iotests/245
    M tests/qemu-iotests/273.out
    M tests/qemu-iotests/check
    M tests/qemu-iotests/iotests.py

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

Block layer patches:

- qemu-img create: Fail gracefully when backing file is an empty string
- Fixes related to filter block nodes ("Deal with filters" series)
- block/nvme: Various cleanups required to use multiple queues
- block/nvme: Use NvmeBar structure from "block/nvme.h"
- file-win32: Fix "locking" option
- iotests: Allow running from different directory

# gpg: Signature made Thu 10 Sep 2020 10:11:19 BST
# gpg:                using RSA key DC3DEB159A9AF95D3D7456FE7F09B272C88F2FD6
# gpg:                issuer "kwolf@redhat.com"
# gpg: Good signature from "Kevin Wolf <kwolf@redhat.com>" [full]
# Primary key fingerprint: DC3D EB15 9A9A F95D 3D74  56FE 7F09 B272 C88F 2FD6

* remotes/kevin/tags/for-upstream: (65 commits)
  block/qcow2-cluster: Add missing "fallthrough" annotation
  block/nvme: Pair doorbell registers
  block/nvme: Use generic NvmeBar structure
  block/nvme: Group controller registers in NVMeRegs structure
  file-win32: Fix "locking" option
  iotests: Allow running from different directory
  iotests: Test committing to overridden backing
  iotests: Add test for commit in sub directory
  iotests: Add filter mirror test cases
  iotests: Add filter commit test cases
  iotests: Let complete_and_wait() work with commit
  iotests: Test that qcow2's data-file is flushed
  block: Leave BDS.backing_{file,format} constant
  block: Inline bdrv_co_block_status_from_*()
  blockdev: Fix active commit choice
  block: Drop backing_bs()
  qemu-img: Use child access functions
  nbd: Use CAF when looking for dirty bitmap
  commit: Deal with filters
  backup: Deal with filters
  ...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>


Compare: https://github.com/qemu/qemu/compare/922781b7b37d...2499453eb1cb



reply via email to

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