qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] 7e5cdb: ide: Increment BB in-flight counter f


From: Peter Maydell
Subject: [Qemu-commits] [qemu/qemu] 7e5cdb: ide: Increment BB in-flight counter for TRIM BH
Date: Mon, 07 Mar 2022 11:07:42 -0800

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 7e5cdb345f77d76cb4877fe6230c4e17a7d0d0ca
      
https://github.com/qemu/qemu/commit/7e5cdb345f77d76cb4877fe6230c4e17a7d0d0ca
  Author: Hanna Reitz <hreitz@redhat.com>
  Date:   2022-03-07 (Mon, 07 Mar 2022)

  Changed paths:
    M hw/ide/core.c

  Log Message:
  -----------
  ide: Increment BB in-flight counter for TRIM BH

When we still have an AIOCB registered for DMA operations, we try to
settle the respective operation by draining the BlockBackend associated
with the IDE device.

However, this assumes that every DMA operation is associated with an
increment of the BlockBackend’s in-flight counter (e.g. through some
ongoing I/O operation), so that draining the BB until its in-flight
counter reaches 0 will settle all DMA operations.  That is not the case:
For TRIM, the guest can issue a zero-length operation that will not
result in any I/O operation forwarded to the BlockBackend, and also not
increment the in-flight counter in any other way.  In such a case,
blk_drain() will be a no-op if no other operations are in flight.

It is clear that if blk_drain() is a no-op, the value of
s->bus->dma->aiocb will not change between checking it in the `if`
condition and asserting that it is NULL after blk_drain().

The particular problem is that ide_issue_trim() creates a BH
(ide_trim_bh_cb()) to settle the TRIM request: iocb->common.cb() is
ide_dma_cb(), which will either create a new request, or find the
transfer to be done and call ide_set_inactive(), which clears
s->bus->dma->aiocb.  Therefore, the blk_drain() must wait for
ide_trim_bh_cb() to run, which currently it will not always do.

To fix this issue, we increment the BlockBackend's in-flight counter
when the TRIM operation begins (in ide_issue_trim(), when the
ide_trim_bh_cb() BH is created) and decrement it when ide_trim_bh_cb()
is done.

Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=2029980
Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Hanna Reitz <hreitz@redhat.com>
Message-Id: <20220120142259.120189-1-hreitz@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
Tested-by: John Snow <jsnow@redhat.com>


  Commit: 2ea7dfcd05bad3b81d63eaac50bf1fc78636de5b
      
https://github.com/qemu/qemu/commit/2ea7dfcd05bad3b81d63eaac50bf1fc78636de5b
  Author: Peter Maydell <peter.maydell@linaro.org>
  Date:   2022-03-07 (Mon, 07 Mar 2022)

  Changed paths:
    M block/curl.c

  Log Message:
  -----------
  block/curl.c: Set error message string if curl_init_state() fails

In curl_open(), the 'out' label assumes that the state->errmsg string
has been set (either by curl_easy_perform() or by manually copying a
string into it); however if curl_init_state() fails we will jump to
that label without setting the string.  Add the missing error string
setup.

(We can't be specific about the cause of failure: the documentation
of curl_easy_init() just says "If this function returns NULL,
something went wrong".)

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-Id: <20220222152341.850419-2-peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Hanna Reitz <hreitz@redhat.com>
Signed-off-by: Hanna Reitz <hreitz@redhat.com>


  Commit: b0ea6c98fa2431b9e24b3a53b8b42c960ccf3dba
      
https://github.com/qemu/qemu/commit/b0ea6c98fa2431b9e24b3a53b8b42c960ccf3dba
  Author: Peter Maydell <peter.maydell@linaro.org>
  Date:   2022-03-07 (Mon, 07 Mar 2022)

  Changed paths:
    M block/curl.c

  Log Message:
  -----------
  block/curl.c: Check error return from curl_easy_setopt()

Coverity points out that we aren't checking the return value
from curl_easy_setopt() for any of the calls to it we make
in block/curl.c.

Some of these options are documented as always succeeding (e.g.
CURLOPT_VERBOSE) but others have documented failure cases (e.g.
CURLOPT_URL).  For consistency we check every call, even the ones
that theoretically cannot fail.

Fixes: Coverity CID 1459336, 1459482, 1460331
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-Id: <20220222152341.850419-3-peter.maydell@linaro.org>
Reviewed-by: Hanna Reitz <hreitz@redhat.com>
Signed-off-by: Hanna Reitz <hreitz@redhat.com>


  Commit: 45e62b464a5fa62f0f005b76f59ad587944cd55f
      
https://github.com/qemu/qemu/commit/45e62b464a5fa62f0f005b76f59ad587944cd55f
  Author: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
  Date:   2022-03-07 (Mon, 07 Mar 2022)

  Changed paths:
    M block/io.c
    M block/preallocate.c
    M include/block/block-common.h

  Log Message:
  -----------
  block: fix preallocate filter: don't do unaligned preallocate requests

There is a bug in handling BDRV_REQ_NO_WAIT flag: we still may wait in
wait_serialising_requests() if request is unaligned. And this is
possible for the only user of this flag (preallocate filter) if
underlying file is unaligned to its request_alignment on start.

So, we have to fix preallocate filter to do only aligned preallocate
requests.

Next, we should fix generic block/io.c somehow. Keeping in mind that
preallocate is the only user of BDRV_REQ_NO_WAIT and that we have to
fix its behavior now, it seems more safe to just assert that we never
use BDRV_REQ_NO_WAIT with unaligned requests and add corresponding
comment. Let's do so.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Denis V. Lunev <den@openvz.org>
Message-Id: <20220215121609.38570-1-vsementsov@virtuozzo.com>
[hreitz: Rebased on block GS/IO split]
Signed-off-by: Hanna Reitz <hreitz@redhat.com>


  Commit: 024354ea9164d3c4b6fd766784939fe39fa4e166
      
https://github.com/qemu/qemu/commit/024354ea9164d3c4b6fd766784939fe39fa4e166
  Author: Thomas Huth <thuth@redhat.com>
  Date:   2022-03-07 (Mon, 07 Mar 2022)

  Changed paths:
    M tests/qemu-iotests/040

  Log Message:
  -----------
  tests/qemu-iotests/040: Skip TestCommitWithFilters without 'throttle'

iotest 040 already has some checks for the availability of the 'throttle'
driver, but some new code has been added in the course of time that
depends on 'throttle' but does not check for its availability. Add
a check to the TestCommitWithFilters class so that this iotest now
also passes again if 'throttle' has not been enabled in the QEMU
binaries.

Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20220223123127.3206042-1-thuth@redhat.com>
Signed-off-by: Hanna Reitz <hreitz@redhat.com>


  Commit: db4b2133b8d3012dfd1977dc12d48d6bf46543d6
      
https://github.com/qemu/qemu/commit/db4b2133b8d3012dfd1977dc12d48d6bf46543d6
  Author: Thomas Huth <thuth@redhat.com>
  Date:   2022-03-07 (Mon, 07 Mar 2022)

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

  Log Message:
  -----------
  tests/qemu-iotests/testrunner: Quote "case not run" lines in TAP mode

In TAP mode, the stdout is reserved for the TAP protocol, so we
have to make sure to mark other lines with a comment '#' character
at the beginning to avoid that the TAP parser at the other end
gets confused.

To test this condition, run "configure" for example with:

 
--block-drv-rw-whitelist=copy-before-write,qcow2,raw,file,host_device,blkdebug,null-co,copy-on-read

so that iotest 041 will report that some tests are not run due to
the missing "quorum" driver. Without this change, "make check-block"
fails since the meson tap parser gets confused by these messages.

Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20220223124353.3273898-1-thuth@redhat.com>
Signed-off-by: Hanna Reitz <hreitz@redhat.com>


  Commit: 1a8fcca03fd6ff5acec8ca97fc20766df74f2ccb
      
https://github.com/qemu/qemu/commit/1a8fcca03fd6ff5acec8ca97fc20766df74f2ccb
  Author: Hanna Reitz <hreitz@redhat.com>
  Date:   2022-03-07 (Mon, 07 Mar 2022)

  Changed paths:
    M tests/qemu-iotests/common.rc
    M tests/qemu-iotests/iotests.py
    M tests/qemu-iotests/testenv.py
    M tests/qemu-iotests/testrunner.py

  Log Message:
  -----------
  iotests: Write test output to TEST_DIR

Drop the use of OUTPUT_DIR (test/qemu-iotests under the build
directory), and instead write test output files (.out.bad, .notrun, and
.casenotrun) to TEST_DIR.

With this, the same test can be run concurrently without the separate
instances interfering, because they will need separate TEST_DIRs anyway.
Running the same test separately is useful when running the iotests with
various format/protocol combinations in parallel, or when you just want
to aggressively exercise a single test (e.g. when it fails only
sporadically).

Putting this output into TEST_DIR means that it will stick around for
inspection after the test run is done (though running the same test in
the same TEST_DIR will overwrite it, just as it used to be); but given
that TEST_DIR is a scratch directory, it should be clear that users can
delete all of its content at any point.  (And if TEST_DIR is on tmpfs,
it will just disappear on shutdown.)  Contrarily, alternative approaches
that would put these output files into OUTPUT_DIR with some prefix to
differentiate between separate test runs might easily lead to cluttering
OUTPUT_DIR.

(This change means OUTPUT_DIR is no longer written to by the iotests, so
we can drop its usage altogether.)

Signed-off-by: Hanna Reitz <hreitz@redhat.com>
Message-Id: <20220221172909.762858-1-hreitz@redhat.com>
[hreitz: Simplified `Path(os.path.join(x, y))` to `Path(x, y)`, as
         suggested by Vladimir; and rebased on 9086c7639822b6
         ("tests/qemu-iotests: Rework the checks and spots using GNU
         sed")]
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>


  Commit: 051f66caa2716b1e01cf44f15b8fcd885d6d7784
      
https://github.com/qemu/qemu/commit/051f66caa2716b1e01cf44f15b8fcd885d6d7784
  Author: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
  Date:   2022-03-07 (Mon, 07 Mar 2022)

  Changed paths:
    M block/block-copy.c
    M block/copy-before-write.c

  Log Message:
  -----------
  block/block-copy: move copy_bitmap initialization to block_copy_state_new()

We are going to complicate bitmap initialization in the further
commit. And in future, backup job will be able to work without filter
(when source is immutable), so we'll need same bitmap initialization in
copy-before-write filter and in backup job. So, it's reasonable to do
it in block-copy.

Note that for now cbw_open() is the only caller of
block_copy_state_new().

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Hanna Reitz <hreitz@redhat.com>
Message-Id: <20220303194349.2304213-2-vsementsov@virtuozzo.com>
Signed-off-by: Hanna Reitz <hreitz@redhat.com>


  Commit: 34ffacb7f4e781873ffdee54c7bb800fa1853a92
      
https://github.com/qemu/qemu/commit/34ffacb7f4e781873ffdee54c7bb800fa1853a92
  Author: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
  Date:   2022-03-07 (Mon, 07 Mar 2022)

  Changed paths:
    M block/dirty-bitmap.c
    M block/monitor/bitmap-qmp-cmds.c
    M include/block/dirty-bitmap.h

  Log Message:
  -----------
  block/dirty-bitmap: bdrv_merge_dirty_bitmap(): add return value

That simplifies handling failure in existing code and in further new
usage of bdrv_merge_dirty_bitmap().

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Hanna Reitz <hreitz@redhat.com>
Message-Id: <20220303194349.2304213-3-vsementsov@virtuozzo.com>
Signed-off-by: Hanna Reitz <hreitz@redhat.com>


  Commit: 1f7252e868a72f1455f4c061e2105269fc3caf40
      
https://github.com/qemu/qemu/commit/1f7252e868a72f1455f4c061e2105269fc3caf40
  Author: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
  Date:   2022-03-07 (Mon, 07 Mar 2022)

  Changed paths:
    M block/block-copy.c
    M block/copy-before-write.c
    M include/block/block-copy.h

  Log Message:
  -----------
  block/block-copy: block_copy_state_new(): add bitmap parameter

This will be used in the following commit to bring "incremental" mode
to copy-before-write filter.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Hanna Reitz <hreitz@redhat.com>
Message-Id: <20220303194349.2304213-4-vsementsov@virtuozzo.com>
Signed-off-by: Hanna Reitz <hreitz@redhat.com>


  Commit: 5f3a3cd7f03aa82ea3a35019f0e5419bbfd0a194
      
https://github.com/qemu/qemu/commit/5f3a3cd7f03aa82ea3a35019f0e5419bbfd0a194
  Author: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
  Date:   2022-03-07 (Mon, 07 Mar 2022)

  Changed paths:
    M block/copy-before-write.c
    M qapi/block-core.json

  Log Message:
  -----------
  block/copy-before-write: add bitmap open parameter

This brings "incremental" mode to copy-before-write filter: user can
specify bitmap so that filter will copy only "dirty" areas.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20220303194349.2304213-5-vsementsov@virtuozzo.com>
Signed-off-by: Hanna Reitz <hreitz@redhat.com>


  Commit: 177541e671b439c358f816f8d8b98031a7e93540
      
https://github.com/qemu/qemu/commit/177541e671b439c358f816f8d8b98031a7e93540
  Author: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
  Date:   2022-03-07 (Mon, 07 Mar 2022)

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

  Log Message:
  -----------
  block/block-copy: add block_copy_reset()

Split block_copy_reset() out of block_copy_reset_unallocated() to be
used separately later.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Hanna Reitz <hreitz@redhat.com>
Message-Id: <20220303194349.2304213-6-vsementsov@virtuozzo.com>
Signed-off-by: Hanna Reitz <hreitz@redhat.com>


  Commit: d088e6a48aa437b2bf706a5f6cc4967f0eceba64
      
https://github.com/qemu/qemu/commit/d088e6a48aa437b2bf706a5f6cc4967f0eceba64
  Author: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
  Date:   2022-03-07 (Mon, 07 Mar 2022)

  Changed paths:
    M MAINTAINERS
    M block/block-copy.c
    M block/meson.build
    A block/reqlist.c
    A include/block/reqlist.h

  Log Message:
  -----------
  block: intoduce reqlist

Split intersecting-requests functionality out of block-copy to be
reused in copy-before-write filter.

Note: while being here, fix tiny typo in MAINTAINERS.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Hanna Reitz <hreitz@redhat.com>
Message-Id: <20220303194349.2304213-7-vsementsov@virtuozzo.com>
Signed-off-by: Hanna Reitz <hreitz@redhat.com>


  Commit: 84b1e80f67f74a9d505802343458d4ebe8bdb3e4
      
https://github.com/qemu/qemu/commit/84b1e80f67f74a9d505802343458d4ebe8bdb3e4
  Author: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
  Date:   2022-03-07 (Mon, 07 Mar 2022)

  Changed paths:
    M block/reqlist.c

  Log Message:
  -----------
  block/reqlist: reqlist_find_conflict(): use ranges_overlap()

Let's reuse convenient helper.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Hanna Reitz <hreitz@redhat.com>
Message-Id: <20220303194349.2304213-8-vsementsov@virtuozzo.com>
Signed-off-by: Hanna Reitz <hreitz@redhat.com>


  Commit: a6426475a75fb793d4c9dd9fe94815e8d18ddaa1
      
https://github.com/qemu/qemu/commit/a6426475a75fb793d4c9dd9fe94815e8d18ddaa1
  Author: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
  Date:   2022-03-07 (Mon, 07 Mar 2022)

  Changed paths:
    M block/dirty-bitmap.c
    M include/block/dirty-bitmap.h
    M include/qemu/hbitmap.h
    M util/hbitmap.c

  Log Message:
  -----------
  block/dirty-bitmap: introduce bdrv_dirty_bitmap_status()

Add a convenient function similar with bdrv_block_status() to get
status of dirty bitmap.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Hanna Reitz <hreitz@redhat.com>
Message-Id: <20220303194349.2304213-9-vsementsov@virtuozzo.com>
Signed-off-by: Hanna Reitz <hreitz@redhat.com>


  Commit: 3b7ca26bdf1eb1f9703048831d442adbb103069b
      
https://github.com/qemu/qemu/commit/3b7ca26bdf1eb1f9703048831d442adbb103069b
  Author: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
  Date:   2022-03-07 (Mon, 07 Mar 2022)

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

  Log Message:
  -----------
  block/reqlist: add reqlist_wait_all()

Add function to wait for all intersecting requests.
To be used in the further commit.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Nikita Lapshin <nikita.lapshin@virtuozzo.com>
Reviewed-by: Hanna Reitz <hreitz@redhat.com>
Message-Id: <20220303194349.2304213-10-vsementsov@virtuozzo.com>
Signed-off-by: Hanna Reitz <hreitz@redhat.com>


  Commit: ce14f3b407aef73ed3c6034d2166bb89f4fbd8b5
      
https://github.com/qemu/qemu/commit/ce14f3b407aef73ed3c6034d2166bb89f4fbd8b5
  Author: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
  Date:   2022-03-07 (Mon, 07 Mar 2022)

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

  Log Message:
  -----------
  block/io: introduce block driver snapshot-access API

Add new block driver handlers and corresponding generic wrappers.
It will be used to allow copy-before-write filter to provide
reach fleecing interface in further commit.

In future this approach may be used to allow reading qcow2 internal
snapshots, for example to export them through NBD.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Hanna Reitz <hreitz@redhat.com>
Message-Id: <20220303194349.2304213-11-vsementsov@virtuozzo.com>
[hreitz: Rebased on block GS/IO split]
Signed-off-by: Hanna Reitz <hreitz@redhat.com>


  Commit: 1c14eaabdb7c4c55656b795469c32b0076c6d614
      
https://github.com/qemu/qemu/commit/1c14eaabdb7c4c55656b795469c32b0076c6d614
  Author: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
  Date:   2022-03-07 (Mon, 07 Mar 2022)

  Changed paths:
    M MAINTAINERS
    M block/meson.build
    A block/snapshot-access.c
    M include/block/block_int-common.h
    M qapi/block-core.json

  Log Message:
  -----------
  block: introduce snapshot-access block driver

The new block driver simply utilizes snapshot-access API of underlying
block node.

In further patches we want to use it like this:

[guest]                   [NBD export]
   |                            |
   | root                       | root
   v                 file       v
[copy-before-write]<------[snapshot-access]
   |           |
   | file      | target
   v           v
[active-disk] [temp.img]

This way, NBD client will be able to read snapshotted state of active
disk, when active disk is continued to be written by guest. This is
known as "fleecing", and currently uses another scheme based on qcow2
temporary image which backing file is active-disk. New scheme comes
with benefits - see next commit.

The other possible application is exporting internal snapshots of
qcow2, like this:

[guest]          [NBD export]
   |                  |
   | root             | root
   v       file       v
[qcow2]<---------[snapshot-access]

For this, we'll need to implement snapshot-access API handlers in
qcow2 driver, and improve snapshot-access block driver (and API) to
make it possible to select snapshot by name. Another thing to improve
is size of snapshot. Now for simplicity we just use size of bs->file,
which is OK for backup, but for qcow2 snapshots export we'll need to
imporve snapshot-access API to get size of snapshot.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20220303194349.2304213-12-vsementsov@virtuozzo.com>
[hreitz: Rebased on block GS/IO split]
Signed-off-by: Hanna Reitz <hreitz@redhat.com>


  Commit: af5bcd775f3115e4c1b7715920a67b31b119de30
      
https://github.com/qemu/qemu/commit/af5bcd775f3115e4c1b7715920a67b31b119de30
  Author: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
  Date:   2022-03-07 (Mon, 07 Mar 2022)

  Changed paths:
    M block/copy-before-write.c
    M tests/qemu-iotests/257.out

  Log Message:
  -----------
  block: copy-before-write: realize snapshot-access API

Current scheme of image fleecing looks like this:

[guest]                    [NBD export]
  |                              |
  |root                          | root
  v                              v
[copy-before-write] -----> [temp.qcow2]
  |                 target  |
  |file                     |backing
  v                         |
[active disk] <-------------+

 - On guest writes copy-before-write filter copies old data from active
   disk to temp.qcow2. So fleecing client (NBD export) when reads
   changed regions from temp.qcow2 image and unchanged from active disk
   through backing link.

This patch makes possible new image fleecing scheme:

[guest]                   [NBD export]
   |                            |
   | root                       | root
   v                 file       v
[copy-before-write]<------[snapshot-access]
   |           |
   | file      | target
   v           v
[active-disk] [temp.img]

 - copy-before-write does CBW operations and also provides
   snapshot-access API. The API may be accessed through
   snapshot-access driver.

Benefits of new scheme:

1. Access control: if remote client try to read data that not covered
   by original dirty bitmap used on copy-before-write open, client gets
   -EACCES.

2. Discard support: if remote client do DISCARD, this additionally to
   discarding data in temp.img informs block-copy process to not copy
   these clusters. Next read from discarded area will return -EACCES.
   This is significant thing: when fleecing user reads data that was
   not yet copied to temp.img, we can avoid copying it on further guest
   write.

3. Synchronisation between client reads and block-copy write is more
   efficient. In old scheme we just rely on BDRV_REQ_SERIALISING flag
   used for writes to temp.qcow2. New scheme is less blocking:
     - fleecing reads are never blocked: if data region is untouched or
       in-flight, we just read from active-disk, otherwise we read from
       temp.img
     - writes to temp.img are not blocked by fleecing reads
     - still, guest writes of-course are blocked by in-flight fleecing
       reads, that currently read from active-disk - it's the minimum
       necessary blocking

4. Temporary image may be of any format, as we don't rely on backing
   feature.

5. Permission relation are simplified. With old scheme we have to share
   write permission on target child of copy-before-write, otherwise
   backing link conflicts with copy-before-write file child write
   permissions. With new scheme we don't have backing link, and
   copy-before-write node may have unshared access to temporary node.
   (Not realized in this commit, will be in future).

6. Having control on fleecing reads we'll be able to implement
   alternative behavior on failed copy-before-write operations.
   Currently we just break guest request (that's a historical behavior
   of backup). But in some scenarios it's a bad behavior: better
   is to drop the backup as failed but don't break guest request.
   With new scheme we can simply unset some bits in a bitmap on CBW
   failure and further fleecing reads will -EACCES, or something like
   this. (Not implemented in this commit, will be in future)
   Additional application for this is implementing timeout for CBW
   operations.

Iotest 257 output is updated, as two more bitmaps now live in
copy-before-write filter.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20220303194349.2304213-13-vsementsov@virtuozzo.com>
Signed-off-by: Hanna Reitz <hreitz@redhat.com>


  Commit: 3927e5c5c80ed8b36f79cde6e6c901bf2b391085
      
https://github.com/qemu/qemu/commit/3927e5c5c80ed8b36f79cde6e6c901bf2b391085
  Author: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
  Date:   2022-03-07 (Mon, 07 Mar 2022)

  Changed paths:
    M tests/qemu-iotests/tests/image-fleecing
    M tests/qemu-iotests/tests/image-fleecing.out

  Log Message:
  -----------
  iotests/image-fleecing: add test-case for fleecing format node

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Hanna Reitz <hreitz@redhat.com>
Message-Id: <20220303194349.2304213-14-vsementsov@virtuozzo.com>
Signed-off-by: Hanna Reitz <hreitz@redhat.com>


  Commit: 308c6abf731b8c54bcfb5e9e8e30f2478b1d7457
      
https://github.com/qemu/qemu/commit/308c6abf731b8c54bcfb5e9e8e30f2478b1d7457
  Author: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
  Date:   2022-03-07 (Mon, 07 Mar 2022)

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

  Log Message:
  -----------
  iotests.py: add qemu_io_pipe_and_status()

Add helper that returns both status and output, to be used in the
following commit

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20220303194349.2304213-15-vsementsov@virtuozzo.com>
Signed-off-by: Hanna Reitz <hreitz@redhat.com>


  Commit: 153bab4d4cce7586e8225709c4d77aebe92c8783
      
https://github.com/qemu/qemu/commit/153bab4d4cce7586e8225709c4d77aebe92c8783
  Author: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
  Date:   2022-03-07 (Mon, 07 Mar 2022)

  Changed paths:
    M tests/qemu-iotests/tests/image-fleecing
    M tests/qemu-iotests/tests/image-fleecing.out

  Log Message:
  -----------
  iotests/image-fleecing: add test case with bitmap

Note that reads zero areas (not dirty in the bitmap) fails, that's
correct.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20220303194349.2304213-16-vsementsov@virtuozzo.com>
Signed-off-by: Hanna Reitz <hreitz@redhat.com>


  Commit: 743da0b401cdc3ee94bc519975e339a3cdbe0ad1
      
https://github.com/qemu/qemu/commit/743da0b401cdc3ee94bc519975e339a3cdbe0ad1
  Author: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
  Date:   2022-03-07 (Mon, 07 Mar 2022)

  Changed paths:
    M tests/qemu-iotests/tests/image-fleecing
    M tests/qemu-iotests/tests/image-fleecing.out

  Log Message:
  -----------
  iotests/image-fleecing: test push backup with fleecing

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20220303194349.2304213-17-vsementsov@virtuozzo.com>
Signed-off-by: Hanna Reitz <hreitz@redhat.com>


  Commit: b49872aa8fc0f3f5a3036cc37aa2cb5c92866f33
      
https://github.com/qemu/qemu/commit/b49872aa8fc0f3f5a3036cc37aa2cb5c92866f33
  Author: Peter Maydell <peter.maydell@linaro.org>
  Date:   2022-03-07 (Mon, 07 Mar 2022)

  Changed paths:
    M MAINTAINERS
    M block/block-copy.c
    M block/copy-before-write.c
    M block/curl.c
    M block/dirty-bitmap.c
    M block/io.c
    M block/meson.build
    M block/monitor/bitmap-qmp-cmds.c
    M block/preallocate.c
    A block/reqlist.c
    A block/snapshot-access.c
    M hw/ide/core.c
    M include/block/block-common.h
    M include/block/block-copy.h
    M include/block/block_int-common.h
    M include/block/block_int-io.h
    M include/block/dirty-bitmap.h
    A include/block/reqlist.h
    M include/qemu/hbitmap.h
    M qapi/block-core.json
    M tests/qemu-iotests/040
    M tests/qemu-iotests/257.out
    M tests/qemu-iotests/common.rc
    M tests/qemu-iotests/iotests.py
    M tests/qemu-iotests/testenv.py
    M tests/qemu-iotests/testrunner.py
    M tests/qemu-iotests/tests/image-fleecing
    M tests/qemu-iotests/tests/image-fleecing.out
    M util/hbitmap.c

  Log Message:
  -----------
  Merge remote-tracking branch 
'remotes/hreitz-gitlab/tags/pull-block-2022-03-07' into staging

Block patches for 7.0-rc0:
- New fleecing backup scheme
- iotest fixes
- Fixes for the curl block driver
- Fix for the preallocate block driver
- IDE fix for zero-length TRIM requests

# gpg: Signature made Mon 07 Mar 2022 10:33:31 GMT
# gpg:                using RSA key CB62D7A0EE3829E45F004D34A1FA40D098019CDF
# gpg:                issuer "hreitz@redhat.com"
# gpg: Good signature from "Hanna Reitz <hreitz@redhat.com>" [marginal]
# gpg: WARNING: This key is not certified with sufficiently trusted signatures!
# gpg:          It is not certain that the signature belongs to the owner.
# Primary key fingerprint: CB62 D7A0 EE38 29E4 5F00  4D34 A1FA 40D0 9801 9CDF

* remotes/hreitz-gitlab/tags/pull-block-2022-03-07: (23 commits)
  iotests/image-fleecing: test push backup with fleecing
  iotests/image-fleecing: add test case with bitmap
  iotests.py: add qemu_io_pipe_and_status()
  iotests/image-fleecing: add test-case for fleecing format node
  block: copy-before-write: realize snapshot-access API
  block: introduce snapshot-access block driver
  block/io: introduce block driver snapshot-access API
  block/reqlist: add reqlist_wait_all()
  block/dirty-bitmap: introduce bdrv_dirty_bitmap_status()
  block/reqlist: reqlist_find_conflict(): use ranges_overlap()
  block: intoduce reqlist
  block/block-copy: add block_copy_reset()
  block/copy-before-write: add bitmap open parameter
  block/block-copy: block_copy_state_new(): add bitmap parameter
  block/dirty-bitmap: bdrv_merge_dirty_bitmap(): add return value
  block/block-copy: move copy_bitmap initialization to block_copy_state_new()
  iotests: Write test output to TEST_DIR
  tests/qemu-iotests/testrunner: Quote "case not run" lines in TAP mode
  tests/qemu-iotests/040: Skip TestCommitWithFilters without 'throttle'
  block: fix preallocate filter: don't do unaligned preallocate requests
  ...

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


Compare: https://github.com/qemu/qemu/compare/9d662a6b22a0...b49872aa8fc0



reply via email to

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