[PATCH v2 2/3] block/nbd: only enter connection coroutine if it's present

2021-01-28 Thread Roman Kagan
When an NBD block driver state is moved from one aio_context to another (e.g. when doing a drain in a migration thread), nbd_client_attach_aio_context_bh is executed that enters the connection coroutine. However, the assumption that ->connection_co is always present here appears incorrect: the

[PATCH v2 3/3] nbd: make nbd_read* return -EIO on error

2021-01-28 Thread Roman Kagan
NBD reconnect logic considers the error code from the functions that read NBD messages to tell if reconnect should be attempted or not: it is attempted on -EIO, otherwise the client transitions to NBD_CLIENT_QUIT state (see nbd_channel_error). This error code is propagated from the primitives

[PATCH v2 0/3] block/nbd: fix crashers in reconnect while migrating

2021-01-28 Thread Roman Kagan
During the final phase of migration the NBD reconnection logic may encounter situations it doesn't expect during regular operation. This series addresses some of them that make qemu crash. They are reproducible when a vm with a secondary drive attached via nbd with non-zero "reconnect-delay"

[PATCH v2 1/3] block/nbd: only detach existing iochannel from aio_context

2021-01-28 Thread Roman Kagan
When the reconnect in NBD client is in progress, the iochannel used for NBD connection doesn't exist. Therefore an attempt to detach it from the aio_context of the parent BlockDriverState results in a NULL pointer dereference. The problem is triggerable, in particular, when an outgoing migration

Re: [PATCH 0/3] block/nbd: fix crashers in reconnect while migrating

2021-01-28 Thread Roman Kagan
On Fri, Jan 29, 2021 at 08:51:39AM +0300, Vladimir Sementsov-Ogievskiy wrote: > 28.01.2021 23:14, Roman Kagan wrote: > > During the final phase of migration the NBD reconnection logic may > > encounter situations it doesn't expect during regular operation. > > > > This series addresses some of

Re: [PATCH 1/3] block/nbd: only detach existing iochannel from aio_context

2021-01-28 Thread Roman Kagan
On Fri, Jan 29, 2021 at 08:37:13AM +0300, Vladimir Sementsov-Ogievskiy wrote: > 28.01.2021 23:14, Roman Kagan wrote: > > When the reconnect in NBD client is in progress, the iochannel used for > > NBD connection doesn't exist. Therefore an attempt to detach it from > > the aio_context of the

[PATCH] hw/block/nvme: refactor zone state check for read

2021-01-28 Thread Klaus Jensen
From: Gollu Appalanaidu Align with nvme_check_zone_write. Remove unnecessary storing status value and return at the end of the function, if error occurs return immediately if applicable. Signed-off-by: Gollu Appalanaidu Reviewed-by: Klaus Jensen --- hw/block/nvme.c | 17 +++-- 1

Re: [PATCH 0/3] block/nbd: fix crashers in reconnect while migrating

2021-01-28 Thread Vladimir Sementsov-Ogievskiy
28.01.2021 23:14, Roman Kagan wrote: During the final phase of migration the NBD reconnection logic may encounter situations it doesn't expect during regular operation. This series addresses some of them that make qemu crash. They are reproducible when a vm with a secondary drive attached via

Re: [PATCH 3/3] nbd: make nbd_read* return -EIO on error

2021-01-28 Thread Vladimir Sementsov-Ogievskiy
28.01.2021 23:14, Roman Kagan wrote: NBD reconnect logic considers the error code from the functions that read NBD messages to tell if reconnect should be attempted or not: it is attempted on -EIO, otherwise the client transitions to NBD_CLIENT_QUIT state (see nbd_channel_error). This error

Re: [PATCH 2/3] block/nbd: only enter connection coroutine if it's present

2021-01-28 Thread Vladimir Sementsov-Ogievskiy
28.01.2021 23:14, Roman Kagan wrote: When an NBD block driver state is moved from one aio_context to another (e.g. when doing a drain in a migration thread), nbd_client_attach_aio_context_bh is executed that enters the connection coroutine. However, the assumption that ->connection_co is always

Re: [PATCH 1/3] block/nbd: only detach existing iochannel from aio_context

2021-01-28 Thread Vladimir Sementsov-Ogievskiy
28.01.2021 23:14, Roman Kagan wrote: When the reconnect in NBD client is in progress, the iochannel used for NBD connection doesn't exist. Therefore an attempt to detach it from the aio_context of the parent BlockDriverState results in a NULL pointer dereference. The problem is triggerable, in

Re: [PULL 14/53] block: apply COR-filter to block-stream jobs

2021-01-28 Thread Vladimir Sementsov-Ogievskiy
28.01.2021 21:38, Philippe Mathieu-Daudé wrote: Hi Andrey, On 1/26/21 3:19 PM, Max Reitz wrote: From: Andrey Shinkevich This patch completes the series with the COR-filter applied to block-stream operations. Adding the filter makes it possible in future implement discarding copied regions

[PATCH] tests/Makefile.include: export PYTHON for check-block.sh

2021-01-28 Thread Vladimir Sementsov-Ogievskiy
check-block.sh called by make check-block rely on PYTHON variable being set. Fixes: f203080bbd9f9e5b31041b1f2afcd6040c5aaec5 Signed-off-by: Vladimir Sementsov-Ogievskiy --- Hi! As Peter reported, build fails on platforms where python3 is not /usr/bin/python3.. This patch should help. At least

[PATCH 1/3] block/nbd: only detach existing iochannel from aio_context

2021-01-28 Thread Roman Kagan
When the reconnect in NBD client is in progress, the iochannel used for NBD connection doesn't exist. Therefore an attempt to detach it from the aio_context of the parent BlockDriverState results in a NULL pointer dereference. The problem is triggerable, in particular, when an outgoing migration

[PATCH 2/3] block/nbd: only enter connection coroutine if it's present

2021-01-28 Thread Roman Kagan
When an NBD block driver state is moved from one aio_context to another (e.g. when doing a drain in a migration thread), nbd_client_attach_aio_context_bh is executed that enters the connection coroutine. However, the assumption that ->connection_co is always present here appears incorrect: the

[PATCH 3/3] nbd: make nbd_read* return -EIO on error

2021-01-28 Thread Roman Kagan
NBD reconnect logic considers the error code from the functions that read NBD messages to tell if reconnect should be attempted or not: it is attempted on -EIO, otherwise the client transitions to NBD_CLIENT_QUIT state (see nbd_channel_error). This error code is propagated from the primitives

[PATCH 0/3] block/nbd: fix crashers in reconnect while migrating

2021-01-28 Thread Roman Kagan
During the final phase of migration the NBD reconnection logic may encounter situations it doesn't expect during regular operation. This series addresses some of them that make qemu crash. They are reproducible when a vm with a secondary drive attached via nbd with non-zero "reconnect-delay"

Re: [PULL 0/8] Block layer patches

2021-01-28 Thread Vladimir Sementsov-Ogievskiy
28.01.2021 21:19, Peter Maydell wrote: On Wed, 27 Jan 2021 at 19:58, Kevin Wolf wrote: The following changes since commit bf159f0bdc7b8e7aa8342dedb3829ca744c1b612: Merge remote-tracking branch 'remotes/edgar/tags/edgar/xilinx-next-2021-01-27.for-upstream' into staging (2021-01-27

Re: [PATCH] iotests/297: pylint: ignore too many statements

2021-01-28 Thread Vladimir Sementsov-Ogievskiy
28.01.2021 23:04, Vladimir Sementsov-Ogievskiy wrote: Ignore two complains, which now lead to 297 failure on testenv.py and testrunner.py. Fixes: 2e5a2f57db481f18fcf70be2a36b1417370b8476 Fixes: d74c754c924ca34e90b7c96ce2f5609d82c0e628 Signed-off-by: Vladimir Sementsov-Ogievskiy --- Forget to

[PATCH] iotests/297: pylint: ignore too many statements

2021-01-28 Thread Vladimir Sementsov-Ogievskiy
Ignore two complains, which now lead to 297 failure on testenv.py and testrunner.py. Fixes: 2e5a2f57db481f18fcf70be2a36b1417370b8476 Fixes: d74c754c924ca34e90b7c96ce2f5609d82c0e628 Signed-off-by: Vladimir Sementsov-Ogievskiy --- tests/qemu-iotests/297 | 4 +++- 1 file changed, 3 insertions(+),

Re: [PULL 14/53] block: apply COR-filter to block-stream jobs

2021-01-28 Thread Philippe Mathieu-Daudé
Hi Andrey, On 1/26/21 3:19 PM, Max Reitz wrote: > From: Andrey Shinkevich > > This patch completes the series with the COR-filter applied to > block-stream operations. > > Adding the filter makes it possible in future implement discarding > copied regions in backing files during the

Re: [PULL 0/8] Block layer patches

2021-01-28 Thread Peter Maydell
On Wed, 27 Jan 2021 at 19:58, Kevin Wolf wrote: > > The following changes since commit bf159f0bdc7b8e7aa8342dedb3829ca744c1b612: > > Merge remote-tracking branch > 'remotes/edgar/tags/edgar/xilinx-next-2021-01-27.for-upstream' into staging > (2021-01-27 17:40:25 +) > > are available in

Re: [PATCH v2 15/36] block: use topological sort for permission update

2021-01-28 Thread Vladimir Sementsov-Ogievskiy
28.01.2021 20:13, Kevin Wolf wrote: Am 28.01.2021 um 10:34 hat Vladimir Sementsov-Ogievskiy geschrieben: 27.01.2021 21:38, Kevin Wolf wrote: Am 27.11.2020 um 15:45 hat Vladimir Sementsov-Ogievskiy geschrieben: -static int bdrv_check_perm(BlockDriverState *bs, BlockReopenQueue *q, -

Re: [PATCH 1/1] docs: fix mistake in dirty bitmap feature description

2021-01-28 Thread Vladimir Sementsov-Ogievskiy
28.01.2021 20:13, Denis V. Lunev wrote: Original specification says that l1 table size if 64 * l1_size, which is obviously wrong. The size of the l1 entry is 64 _bits_, not bytes. Thus 64 is to be replaces with 8 as specification says about bytes. There is also minor tweak, field name is

Re: [PATCH v2 15/36] block: use topological sort for permission update

2021-01-28 Thread Kevin Wolf
Am 28.01.2021 um 10:34 hat Vladimir Sementsov-Ogievskiy geschrieben: > 27.01.2021 21:38, Kevin Wolf wrote: > > Am 27.11.2020 um 15:45 hat Vladimir Sementsov-Ogievskiy geschrieben: > > > -static int bdrv_check_perm(BlockDriverState *bs, BlockReopenQueue *q, > > > -

[PATCH 1/1] docs: fix mistake in dirty bitmap feature description

2021-01-28 Thread Denis V. Lunev
Original specification says that l1 table size if 64 * l1_size, which is obviously wrong. The size of the l1 entry is 64 _bits_, not bytes. Thus 64 is to be replaces with 8 as specification says about bytes. There is also minor tweak, field name is renamed from l1 to l1_table, which matches with

Re: [PATCH] MAINTAINERS: suggest myself as co-maintainer for Block Jobs

2021-01-28 Thread Max Reitz
On 28.01.21 15:41, Vladimir Sementsov-Ogievskiy wrote: I'm developing Qemu backup for several years, and finally new backup architecture, including block-copy generic engine and backup-top filter landed upstream, great thanks to reviewers and especially to Max Reitz! I also have plans of moving

Re: [PATCH] MAINTAINERS: suggest myself as co-maintainer for Block Jobs

2021-01-28 Thread John Snow
On 1/28/21 10:09 AM, Markus Armbruster wrote: Vladimir Sementsov-Ogievskiy writes: I'm developing Qemu backup for several years, and finally new backup architecture, including block-copy generic engine and backup-top filter landed upstream, great thanks to reviewers and especially to Max

Re: [PATCH] MAINTAINERS: suggest myself as co-maintainer for Block Jobs

2021-01-28 Thread Markus Armbruster
Vladimir Sementsov-Ogievskiy writes: > I'm developing Qemu backup for several years, and finally new backup > architecture, including block-copy generic engine and backup-top filter > landed upstream, great thanks to reviewers and especially to > Max Reitz! > > I also have plans of moving other

[PATCH] MAINTAINERS: suggest myself as co-maintainer for Block Jobs

2021-01-28 Thread Vladimir Sementsov-Ogievskiy
I'm developing Qemu backup for several years, and finally new backup architecture, including block-copy generic engine and backup-top filter landed upstream, great thanks to reviewers and especially to Max Reitz! I also have plans of moving other block-jobs onto block-copy, so that we finally

[PATCH] qemu-img: add seek and -n option to dd command

2021-01-28 Thread Peter Lieven
Signed-off-by: Peter Lieven diff --git a/docs/tools/qemu-img.rst b/docs/tools/qemu-img.rst index b615aa8419..7d4564c2b8 100644 --- a/docs/tools/qemu-img.rst +++ b/docs/tools/qemu-img.rst @@ -209,6 +209,10 @@ Parameters to dd subcommand: .. program:: qemu-img-dd +.. option:: -n + + Skip the

Re: [PULL 0/8] Block layer patches

2021-01-28 Thread Peter Maydell
On Wed, 27 Jan 2021 at 19:58, Kevin Wolf wrote: > > The following changes since commit bf159f0bdc7b8e7aa8342dedb3829ca744c1b612: > > Merge remote-tracking branch > 'remotes/edgar/tags/edgar/xilinx-next-2021-01-27.for-upstream' into staging > (2021-01-27 17:40:25 +) > > are available in

RE: [PATCH v4] blockjob: Fix crash with IOthread when block commit after snapshot

2021-01-28 Thread 仇大玉
Any comments? -Original Message- From: 08005...@163.com <08005...@163.com> Sent: 2021年1月28日 9:31 To: kw...@redhat.com; mre...@redhat.com; js...@redhat.com Cc: qemu-block@nongnu.org; qemu-de...@nongnu.org; 仇大玉 Subject: [PATCH v4] blockjob: Fix crash with IOthread when block commit after

Re: [PATCH v2 15/36] block: use topological sort for permission update

2021-01-28 Thread Vladimir Sementsov-Ogievskiy
27.01.2021 21:38, Kevin Wolf wrote: Am 27.11.2020 um 15:45 hat Vladimir Sementsov-Ogievskiy geschrieben: Rewrite bdrv_check_perm(), bdrv_abort_perm_update() and bdrv_set_perm() to update nodes in topological sort order instead of simple DFS. With topologically sorted nodes, we update a node