qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] ead3f1: block/mirror: set .co for active-writ


From: Peter Maydell
Subject: [Qemu-commits] [qemu/qemu] ead3f1: block/mirror: set .co for active-write MirrorOp ob...
Date: Tue, 20 Jul 2021 11:30:30 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: ead3f1bff99f4a4227975a1f026f4091e50f199f
      
https://github.com/qemu/qemu/commit/ead3f1bff99f4a4227975a1f026f4091e50f199f
  Author: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
  Date:   2021-07-20 (Tue, 20 Jul 2021)

  Changed paths:
    M block/mirror.c

  Log Message:
  -----------
  block/mirror: set .co for active-write MirrorOp objects

This field is unused, but it very helpful for debugging.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20210702211636.228981-2-vsementsov@virtuozzo.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: e0f69d83d5c5c039b133b60b5a7130dedeeaca42
      
https://github.com/qemu/qemu/commit/e0f69d83d5c5c039b133b60b5a7130dedeeaca42
  Author: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
  Date:   2021-07-20 (Tue, 20 Jul 2021)

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

  Log Message:
  -----------
  iotest 151: add test-case that shows active mirror dead-lock

There is a dead-lock in active mirror: when we have parallel
intersecting requests (note that non intersecting requests may be
considered intersecting after aligning to mirror granularity), it may
happen that request A waits request B in mirror_wait_on_conflicts() and
request B waits for A.

Look at the test for details. Test now dead-locks, that's why it's
disabled. Next commit will fix mirror and enable the test.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20210702211636.228981-3-vsementsov@virtuozzo.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: d44dae1a7cf782ec9235746ebb0e6c1a20dd7288
      
https://github.com/qemu/qemu/commit/d44dae1a7cf782ec9235746ebb0e6c1a20dd7288
  Author: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
  Date:   2021-07-20 (Tue, 20 Jul 2021)

  Changed paths:
    M block/mirror.c
    M tests/qemu-iotests/151

  Log Message:
  -----------
  block/mirror: fix active mirror dead-lock in mirror_wait_on_conflicts

It's possible that requests start to wait each other in
mirror_wait_on_conflicts(). To avoid it let's use same technique as in
block/io.c in bdrv_wait_serialising_requests_locked() /
bdrv_find_conflicting_request(): don't wait on intersecting request if
it is already waiting for some other request.

For details of the dead-lock look at testIntersectingActiveIO()
test-case which we actually fixing now.

Fixes: d06107ade0ce74dc39739bac80de84b51ec18546
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20210702211636.228981-4-vsementsov@virtuozzo.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: e5f05f8c375157211c7da625a0d3f3ccdb4957d5
      
https://github.com/qemu/qemu/commit/e5f05f8c375157211c7da625a0d3f3ccdb4957d5
  Author: Kevin Wolf <kwolf@redhat.com>
  Date:   2021-07-20 (Tue, 20 Jul 2021)

  Changed paths:
    M block.c
    M configure
    M meson.build

  Log Message:
  -----------
  block: Add option to use driver whitelist even in tools

Currently, the block driver whitelists are only applied for the system
emulator. All other binaries still give unrestricted access to all block
drivers. There are use cases where this made sense because the main
concern was avoiding customers running VMs on less optimised block
drivers and getting bad performance. Allowing the same image format e.g.
as a target for 'qemu-img convert' is not a problem then.

However, if the concern is the supportability of the driver in general,
either in full or when used read-write, not applying the list driver
whitelist in tools doesn't help - especially since qemu-nbd and
qemu-storage-daemon now give access to more or less the same operations
in block drivers as running a system emulator.

In order to address this, introduce a new configure option that enforces
the driver whitelist in all binaries.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Message-Id: <20210709164141.254097-1-kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: 1e12ecfd2cd38d06278ee7424fa2ab0bf3c10e93
      
https://github.com/qemu/qemu/commit/1e12ecfd2cd38d06278ee7424fa2ab0bf3c10e93
  Author: Lukas Straub <lukasstraub2@web.de>
  Date:   2021-07-20 (Tue, 20 Jul 2021)

  Changed paths:
    M block/replication.c

  Log Message:
  -----------
  replication: Remove s->active_disk

s->active_disk is bs->file. Remove it and use local variables instead.

Signed-off-by: Lukas Straub <lukasstraub2@web.de>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: 
<2534f867ea9be5b666dfce19744b7d4e2b96c976.1626619393.git.lukasstraub2@web.de>
Reviewed-by: Zhang Chen <chen.zhang@intel.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: a990a42b39338ffd12fb9640d792276313f75ed5
      
https://github.com/qemu/qemu/commit/a990a42b39338ffd12fb9640d792276313f75ed5
  Author: Lukas Straub <lukasstraub2@web.de>
  Date:   2021-07-20 (Tue, 20 Jul 2021)

  Changed paths:
    M block/replication.c

  Log Message:
  -----------
  replication: Reduce usage of s->hidden_disk and s->secondary_disk

In preparation for the next patch, initialize s->hidden_disk and
s->secondary_disk later and replace access to them with local variables
in the places where they aren't initialized yet.

Signed-off-by: Lukas Straub <lukasstraub2@web.de>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: 
<1eb9dc179267207d9c7eccaeb30761758e32e9ab.1626619393.git.lukasstraub2@web.de>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: 3b78420bb14f7e439a079aee28eeec997a229c5e
      
https://github.com/qemu/qemu/commit/3b78420bb14f7e439a079aee28eeec997a229c5e
  Author: Lukas Straub <lukasstraub2@web.de>
  Date:   2021-07-20 (Tue, 20 Jul 2021)

  Changed paths:
    M block/replication.c

  Log Message:
  -----------
  replication: Properly attach children

The replication driver needs access to the children block-nodes of
it's child so it can issue bdrv_make_empty() and bdrv_co_pwritev()
to manage the replication. However, it does this by directly copying
the BdrvChilds, which is wrong.

Fix this by properly attaching the block-nodes with
bdrv_attach_child() and requesting the required permissions.

This ultimatively fixes a potential crash in replication_co_writev(),
because it may write to s->secondary_disk if it is in state
BLOCK_REPLICATION_FAILOVER_FAILED, without requesting write
permissions first. And now the workaround in
secondary_do_checkpoint() can be removed.

Signed-off-by: Lukas Straub <lukasstraub2@web.de>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: 
<5d0539d729afb8072d0d7cde977c5066285591b4.1626619393.git.lukasstraub2@web.de>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: c2cf0ecab5455f41ab56c131b21e153a3befa8b0
      
https://github.com/qemu/qemu/commit/c2cf0ecab5455f41ab56c131b21e153a3befa8b0
  Author: Lukas Straub <lukasstraub2@web.de>
  Date:   2021-07-20 (Tue, 20 Jul 2021)

  Changed paths:
    M block/replication.c

  Log Message:
  -----------
  replication: Remove workaround

Remove the workaround introduced in commit
6ecbc6c52672db5c13805735ca02784879ce8285
"replication: Avoid blk_make_empty() on read-only child".

It is not needed anymore since s->hidden_disk is guaranteed to be
writable when secondary_do_checkpoint() runs. Because replication_start(),
_do_checkpoint() and _stop() are only called by COLO migration code
and COLO-migration activates all disks via bdrv_invalidate_cache_all()
before it calls these functions.

Signed-off-by: Lukas Straub <lukasstraub2@web.de>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: 
<d3acfad43879e9f376bffa7dd797ae74d0a7c81a.1626619393.git.lukasstraub2@web.de>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: 6af72274efd580fbfc048aad75d3e9af44614590
      
https://github.com/qemu/qemu/commit/6af72274efd580fbfc048aad75d3e9af44614590
  Author: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
  Date:   2021-07-20 (Tue, 20 Jul 2021)

  Changed paths:
    M block/vvfat.c

  Log Message:
  -----------
  block/vvfat: fix: drop backing

Most probably this fake backing child doesn't work anyway (see notes
about it in a8a4d15c1c34d).

Still, since 25f78d9e2de528473d52 drivers are required to set
.supports_backing if they want to call bdrv_set_backing_hd, so now
vvfat just doesn't work because of this check.

Let's finally drop this fake backing file.

Fixes: 25f78d9e2de528473d52acfcf7acdfb64e3453d4
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20210715124853.13335-1-vsementsov@virtuozzo.com>
Tested-by: John Arbuckle <programmingkidx@gmail.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: 8573823f3ba2b63926f82d5732473e0cd73c1213
      
https://github.com/qemu/qemu/commit/8573823f3ba2b63926f82d5732473e0cd73c1213
  Author: Max Reitz <mreitz@redhat.com>
  Date:   2021-07-20 (Tue, 20 Jul 2021)

  Changed paths:
    M block/export/export.c

  Log Message:
  -----------
  block/export: Conditionally ignore set-context error

When invoking block-export-add with some iothread and
fixed-iothread=false, and changing the node's iothread fails, the error
is supposed to be ignored.

However, it is still stored in *errp, which is wrong.  If a second error
occurs, the "*errp must be NULL" assertion in error_setv() fails:

  qemu-system-x86_64: ../util/error.c:59: error_setv: Assertion
  `*errp == NULL' failed.

So if fixed-iothread=false, we should ignore the error by passing NULL
to bdrv_try_set_aio_context().

Fixes: f51d23c80af73c95e0ce703ad06a300f1b3d63ef
       ("block/export: add iothread and fixed-iothread options")
Signed-off-by: Max Reitz <mreitz@redhat.com>
Message-Id: <20210624083825.29224-2-mreitz@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: d21471696b07f30cb00453709d055a25c1afde85
      
https://github.com/qemu/qemu/commit/d21471696b07f30cb00453709d055a25c1afde85
  Author: Max Reitz <mreitz@redhat.com>
  Date:   2021-07-20 (Tue, 20 Jul 2021)

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

  Log Message:
  -----------
  iotests/307: Test iothread conflict for exports

Passing fixed-iothread=true should make iothread conflicts fatal,
whereas fixed-iothread=false should not.

Combine the second case with an error condition that is checked after
the iothread is handled, to verify that qemu does not crash if there is
such an error after changing the iothread failed.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Message-Id: <20210624083825.29224-3-mreitz@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Tested-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: c04b4d9e6b596ead3cf6046a9243fbfee068ef33
      
https://github.com/qemu/qemu/commit/c04b4d9e6b596ead3cf6046a9243fbfee068ef33
  Author: Peter Maydell <peter.maydell@linaro.org>
  Date:   2021-07-20 (Tue, 20 Jul 2021)

  Changed paths:
    M block.c
    M block/export/export.c
    M block/mirror.c
    M block/replication.c
    M block/vvfat.c
    M configure
    M meson.build
    M tests/qemu-iotests/151
    M tests/qemu-iotests/151.out
    M tests/qemu-iotests/307
    M tests/qemu-iotests/307.out

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

Block layer patches

- mirror: Fix active mirror deadlock
- replication: Fix crashes due to operations on wrong BdrvChild
- configure: Add option to use driver whitelist even in tools
- vvfat: Fix crash when opening image read-write
- export: Fix crash in error path with fixed-iothread=false

# gpg: Signature made Tue 20 Jul 2021 16:09:23 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:
  iotests/307: Test iothread conflict for exports
  block/export: Conditionally ignore set-context error
  block/vvfat: fix: drop backing
  replication: Remove workaround
  replication: Properly attach children
  replication: Reduce usage of s->hidden_disk and s->secondary_disk
  replication: Remove s->active_disk
  block: Add option to use driver whitelist even in tools
  block/mirror: fix active mirror dead-lock in mirror_wait_on_conflicts
  iotest 151: add test-case that shows active mirror dead-lock
  block/mirror: set .co for active-write MirrorOp objects

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


Compare: https://github.com/qemu/qemu/compare/143c2e043285...c04b4d9e6b59



reply via email to

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