qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] 79ef0c: block/copy-before-write: refactor opt


From: Richard Henderson
Subject: [Qemu-commits] [qemu/qemu] 79ef0c: block/copy-before-write: refactor option parsing
Date: Wed, 29 Jun 2022 16:17:38 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 79ef0cebb5694411e7452f0cf15c4bd170c7f2d6
      
https://github.com/qemu/qemu/commit/79ef0cebb5694411e7452f0cf15c4bd170c7f2d6
  Author: Vladimir Sementsov-Ogievskiy <vsementsov@openvz.org>
  Date:   2022-06-28 (Tue, 28 Jun 2022)

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

  Log Message:
  -----------
  block/copy-before-write: refactor option parsing

We are going to add one more option of enum type. Let's refactor option
parsing so that we can simply work with BlockdevOptionsCbw object.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@openvz.org>
Reviewed-by: Hanna Reitz <hreitz@redhat.com>
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>


  Commit: f1bb39a8a5b6d486faa1a51a7f28c577155642c9
      
https://github.com/qemu/qemu/commit/f1bb39a8a5b6d486faa1a51a7f28c577155642c9
  Author: Vladimir Sementsov-Ogievskiy <vsementsov@openvz.org>
  Date:   2022-06-28 (Tue, 28 Jun 2022)

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

  Log Message:
  -----------
  block/copy-before-write: add on-cbw-error open parameter

Currently, behavior on copy-before-write operation failure is simple:
report error to the guest.

Let's implement alternative behavior: break the whole copy-before-write
process (and corresponding backup job or NBD client) but keep guest
working. It's needed if we consider guest stability as more important.

The realisation is simple: on copy-before-write failure we set
s->snapshot_ret and continue guest operations. s->snapshot_ret being
set will lead to all further snapshot API requests. Note that all
in-flight snapshot-API requests may still success: we do wait for them
on BREAK_SNAPSHOT-failure path in cbw_do_copy_before_write().

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@openvz.org>
Reviewed-by: Hanna Reitz <hreitz@redhat.com>
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>


  Commit: dd3e97dfbe199fa277869d127884071100a426e5
      
https://github.com/qemu/qemu/commit/dd3e97dfbe199fa277869d127884071100a426e5
  Author: Vladimir Sementsov-Ogievskiy <vsementsov@openvz.org>
  Date:   2022-06-29 (Wed, 29 Jun 2022)

  Changed paths:
    M tests/qemu-iotests/pylintrc
    A tests/qemu-iotests/tests/copy-before-write
    A tests/qemu-iotests/tests/copy-before-write.out

  Log Message:
  -----------
  iotests: add copy-before-write: on-cbw-error tests

Add tests for new option of copy-before-write filter: on-cbw-error.

Note that we use QEMUMachine instead of VM class, because in further
commit we'll want to use throttling which doesn't work with -accel
qtest used by VM.

We also touch pylintrc to not break iotest 297.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@openvz.org>
Reviewed-by: Hanna Reitz <hreitz@redhat.com>
  [vsementsov: add arguments to QEMUMachine constructor]
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>


  Commit: e1878eb5f0d93a67deb46aaeea898cf4824a759a
      
https://github.com/qemu/qemu/commit/e1878eb5f0d93a67deb46aaeea898cf4824a759a
  Author: Vladimir Sementsov-Ogievskiy <vsementsov@openvz.org>
  Date:   2022-06-29 (Wed, 29 Jun 2022)

  Changed paths:
    M include/qemu/coroutine.h
    M util/meson.build
    A util/qemu-co-timeout.c

  Log Message:
  -----------
  util: add qemu-co-timeout

Add new API, to make a time limited call of the coroutine.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@openvz.org>
Reviewed-by: Hanna Reitz <hreitz@redhat.com>
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>


  Commit: 15df6e698719505570f8532772c2b08cb278a45a
      
https://github.com/qemu/qemu/commit/15df6e698719505570f8532772c2b08cb278a45a
  Author: Vladimir Sementsov-Ogievskiy <vsementsov@openvz.org>
  Date:   2022-06-29 (Wed, 29 Jun 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(): add timeout_ns parameter

Add possibility to limit block_copy() call in time. To be used in the
next commit.

As timed-out block_copy() call will continue in background anyway (we
can't immediately cancel IO operation), it's important also give user a
possibility to pass a callback, to do some additional actions on
block-copy call finish.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@openvz.org>
Reviewed-by: Hanna Reitz <hreitz@redhat.com>
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>


  Commit: 6db7fd1ca980f8dd2fd082f13613166e170afd05
      
https://github.com/qemu/qemu/commit/6db7fd1ca980f8dd2fd082f13613166e170afd05
  Author: Vladimir Sementsov-Ogievskiy <vsementsov@openvz.org>
  Date:   2022-06-29 (Wed, 29 Jun 2022)

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

  Log Message:
  -----------
  block/copy-before-write: implement cbw-timeout option

In some scenarios, when copy-before-write operations lasts too long
time, it's better to cancel it.

Most useful would be to use the new option together with
on-cbw-error=break-snapshot: this way if cbw operation takes too long
time we'll just cancel backup process but do not disturb the guest too
much.

Note the tricky point of realization: we keep additional point in
bs->in_flight during block_copy operation even if it's timed-out.
Background "cancelled" block_copy operations will finish at some point
and will want to access state. We should care to not free the state in
.bdrv_close() earlier.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@openvz.org>
Reviewed-by: Hanna Reitz <hreitz@redhat.com>
  [vsementsov: use bdrv_inc_in_flight()/bdrv_dec_in_flight() instead of
   direct manipulation on bs->in_flight]
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>


  Commit: 9d05a87b77a63ed5505c59f5e8e6c5ca4f2c04d3
      
https://github.com/qemu/qemu/commit/9d05a87b77a63ed5505c59f5e8e6c5ca4f2c04d3
  Author: Vladimir Sementsov-Ogievskiy <vsementsov@openvz.org>
  Date:   2022-06-29 (Wed, 29 Jun 2022)

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

  Log Message:
  -----------
  iotests: copy-before-write: add cases for cbw-timeout option

Add two simple test-cases: timeout failure with
break-snapshot-on-cbw-error behavior and similar with
break-guest-write-on-cbw-error behavior.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@openvz.org>
Reviewed-by: Hanna Reitz <hreitz@redhat.com>
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>


  Commit: 8bb100c9e2dc1fe0e33283b0c43252dbaf4eb71b
      
https://github.com/qemu/qemu/commit/8bb100c9e2dc1fe0e33283b0c43252dbaf4eb71b
  Author: Denis V. Lunev <den@openvz.org>
  Date:   2022-06-29 (Wed, 29 Jun 2022)

  Changed paths:
    M block/nbd.c
    M block/trace-events
    M nbd/client-connection.c
    M nbd/trace-events

  Log Message:
  -----------
  nbd: trace long NBD operations

At the moment there are 2 sources of lengthy operations if configured:
* open connection, which could retry inside and
* reconnect of already opened connection
These operations could be quite lengthy and cumbersome to catch thus
it would be quite natural to add trace points for them.

This patch is based on the original downstream work made by Vladimir.

Signed-off-by: Denis V. Lunev <den@openvz.org>
CC: Eric Blake <eblake@redhat.com>
CC: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
CC: Kevin Wolf <kwolf@redhat.com>
CC: Hanna Reitz <hreitz@redhat.com>
CC: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>


  Commit: 1b8f777673985af366de099ad4e41d334b36fb12
      
https://github.com/qemu/qemu/commit/1b8f777673985af366de099ad4e41d334b36fb12
  Author: Denis V. Lunev <den@openvz.org>
  Date:   2022-06-29 (Wed, 29 Jun 2022)

  Changed paths:
    M block/mirror.c
    M block/nbd.c

  Log Message:
  -----------
  block: use 'unsigned' for in_flight field on driver state

This patch makes in_flight field 'unsigned' for BDRVNBDState and
MirrorBlockJob. This matches the definition of this field on BDS
and is generically correct - we should never get negative value here.

Signed-off-by: Denis V. Lunev <den@openvz.org>
CC: John Snow <jsnow@redhat.com>
CC: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
CC: Kevin Wolf <kwolf@redhat.com>
CC: Hanna Reitz <hreitz@redhat.com>
CC: Eric Blake <eblake@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>


  Commit: f96d4e0f60073963a5c64844271ecfee8dd87abc
      
https://github.com/qemu/qemu/commit/f96d4e0f60073963a5c64844271ecfee8dd87abc
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2022-06-29 (Wed, 29 Jun 2022)

  Changed paths:
    M block/block-copy.c
    M block/copy-before-write.c
    M block/mirror.c
    M block/nbd.c
    M block/trace-events
    M include/block/block-copy.h
    M include/qemu/coroutine.h
    M nbd/client-connection.c
    M nbd/trace-events
    M qapi/block-core.json
    M tests/qemu-iotests/pylintrc
    A tests/qemu-iotests/tests/copy-before-write
    A tests/qemu-iotests/tests/copy-before-write.out
    M util/meson.build
    A util/qemu-co-timeout.c

  Log Message:
  -----------
  Merge tag 'pull-block-2022-06-14-v2' of https://gitlab.com/vsementsov/qemu 
into staging

Block jobs & NBD patches

v2: - add arguments to QEMUMachine constructor in test, to make it work
      on arm in gitlab pipeline
    - use bdrv_inc_in_flight() / bdrv_dec_in_flight() instead of direct
      manipulation with bs->in_flight

- add new options for copy-before-write filter
- new trace points for NBD
- prefer unsigned type for some 'in_flight' fields

# -----BEGIN PGP SIGNATURE-----
#
# iQIzBAABCgAdFiEEi5wmzbL9FHyIDoahVh8kwfGfefsFAmK8BqkACgkQVh8kwfGf
# efuiMw/+P9FFLfGFSjVP+LYeT0Ah6kN1ypCMQzIk3Qq/J6qgMZhtRqpQoZOfIFQL
# U9fGmEtQZ7gvEMD/nJToL6uOYlnQfPxDcA6GrRwWWE3rcFiPK4J0q2LlnPLn4QaU
# W/qag5l/QnZfLlj/iV6neWOEvqdnvY1L8IS+T8xV6N0iBYlwgMC/6FGshQwehzcV
# T5F1qPGB0vjFDjf92LFPEsvsFFHjHIVPwOyJMvF64QtSk57utikq/la9PI/yA9AH
# Ll4mNQuZKx6rSI5wE6b21jc8iOUvaoHdPSEDQZfNILSdgGdiKvFwE51y+baGnIAD
# TpjxfG59q0jyGxMjQVxMRSFaxAC4+Mqi82diSPv4xbiUdsE4byJH0oENn4z7+wAv
# EvjuU9yx4FfHHltoUNwfn2pv00o/ELdZIoBNmW36rPxSGZMvfVfRtuBL7XWNUFbW
# Fr4BwsjC4KfIxb16QTBGhXVv6grxdlwoU9N23npdi0YpW1ftZzXGDa85+gINQ807
# eK/gP/OtYPwIql0bgmLiuaRNzC9psmQOO6vQbdvd/e4BEVWkxiez37+e+zFMStmL
# OAL8rS6jckUoxVZjCYFEWg97XOobLUIhQxt9Fwh2omMDGKTwv861ghUAivxSWs93
# IRNxfwqNPxnpDDXjnK1ayZgU08IL98AUYVKcPN1y8JvEhB4Hr1k=
# =ndKk
# -----END PGP SIGNATURE-----
# gpg: Signature made Wed 29 Jun 2022 01:30:41 PM +0530
# gpg:                using RSA key 8B9C26CDB2FD147C880E86A1561F24C1F19F79FB
# gpg: Good signature from "Vladimir Sementsov-Ogievskiy 
<vsementsov@yandex-team.ru>" [unknown]
# gpg:                 aka "Vladimir Sementsov-Ogievskiy 
<vsementsov@virtuozzo.com>" [unknown]
# gpg: WARNING: This key is not certified with a trusted signature!
# gpg:          There is no indication that the signature belongs to the owner.
# Primary key fingerprint: 8B9C 26CD B2FD 147C 880E  86A1 561F 24C1 F19F 79FB

* tag 'pull-block-2022-06-14-v2' of https://gitlab.com/vsementsov/qemu:
  block: use 'unsigned' for in_flight field on driver state
  nbd: trace long NBD operations
  iotests: copy-before-write: add cases for cbw-timeout option
  block/copy-before-write: implement cbw-timeout option
  block/block-copy: block_copy(): add timeout_ns parameter
  util: add qemu-co-timeout
  iotests: add copy-before-write: on-cbw-error tests
  block/copy-before-write: add on-cbw-error open parameter
  block/copy-before-write: refactor option parsing

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


Compare: https://github.com/qemu/qemu/compare/2a8835cb4537...f96d4e0f6007



reply via email to

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