Re: [PATCH] iotests/210: Fix reference output

2020-12-15 Thread Vladimir Sementsov-Ogievskiy
14.12.2020 20:51, Max Reitz wrote: Commit 8b1170012b1 has added a global maximum disk length for the block layer, so the error message when creating an overly large disk has changed. Fixes: 8b1170012b1de6649c66ac1887f4df7e312abf3b ("block: introduce BDRV_MAX_LENGTH") Signed-off-by: Max R

Re: [PATCH v4] file-posix: detect the lock using the real file

2020-12-15 Thread Daniel P . Berrangé
On Tue, Dec 15, 2020 at 03:09:28PM +0800, Li Feng wrote: > This patch addresses this issue: > When accessing a volume on an NFS filesystem without supporting the file lock, > tools, like qemu-img, will complain "Failed to lock byte 100". > > In the original code, the qemu_has_ofd_lock will test th

Re: [PATCH v4] file-posix: detect the lock using the real file

2020-12-15 Thread Li Feng
Daniel P. Berrangé 于2020年12月15日周二 下午6:08写道: > > On Tue, Dec 15, 2020 at 03:09:28PM +0800, Li Feng wrote: > > This patch addresses this issue: > > When accessing a volume on an NFS filesystem without supporting the file > > lock, > > tools, like qemu-img, will complain "Failed to lock byte 100". >

[PATCH v5] file-posix: detect the lock using the real file

2020-12-15 Thread Li Feng
This patch addresses this issue: When accessing a volume on an NFS filesystem without supporting the file lock, tools, like qemu-img, will complain "Failed to lock byte 100". In the original code, the qemu_has_ofd_lock will test the lock on the "/dev/null" pseudo-file. Actually, the file.locking i

Re: [PATCH v5] file-posix: detect the lock using the real file

2020-12-15 Thread Daniel P . Berrangé
On Tue, Dec 15, 2020 at 06:53:56PM +0800, Li Feng wrote: > This patch addresses this issue: > When accessing a volume on an NFS filesystem without supporting the file lock, > tools, like qemu-img, will complain "Failed to lock byte 100". > > In the original code, the qemu_has_ofd_lock will test th

Re: [PATCH] iotests/210: Fix reference output

2020-12-15 Thread Kevin Wolf
Am 14.12.2020 um 18:51 hat Max Reitz geschrieben: > Commit 8b1170012b1 has added a global maximum disk length for the block > layer, so the error message when creating an overly large disk has > changed. > > Fixes: 8b1170012b1de6649c66ac1887f4df7e312abf3b >("block: introduce BDRV_MAX_LENGT

Re: [PATCH] iotests: Quote $cmd in _send_qemu_cmd

2020-12-15 Thread Kevin Wolf
Am 14.12.2020 um 18:58 hat Max Reitz geschrieben: > With bash 5.1, the output of the following script (which creates an > array with a single element, then takes a single-element slice from that > array, and echos the result) changes: > > a=("double space") > a=${a[@]:0:1} > echo "$a" > >

Re: [PATCH v2 1/4] block: Honor blk_set_aio_context() context requirements

2020-12-15 Thread Kevin Wolf
Am 14.12.2020 um 18:05 hat Sergio Lopez geschrieben: > The documentation for bdrv_set_aio_context_ignore() states this: > > * The caller must own the AioContext lock for the old AioContext of bs, but > it > * must not own the AioContext lock for new_context (unless new_context is the > * same

Re: [PATCH v2 2/4] block: Avoid processing BDS twice in bdrv_set_aio_context_ignore()

2020-12-15 Thread Kevin Wolf
Am 14.12.2020 um 18:05 hat Sergio Lopez geschrieben: > While processing the parents of a BDS, one of the parents may process > the child that's doing the tail recursion, which leads to a BDS being > processed twice. This is especially problematic for the aio_notifiers, > as they might attempt to wo

Re: [PATCH] iotests: Quote $cmd in _send_qemu_cmd

2020-12-15 Thread Max Reitz
On 15.12.20 12:43, Kevin Wolf wrote: Am 14.12.2020 um 18:58 hat Max Reitz geschrieben: With bash 5.1, the output of the following script (which creates an array with a single element, then takes a single-element slice from that array, and echos the result) changes: a=("double space") a=$

[PATCH v4 1/7] qapi/block-core: Add retry option for error action

2020-12-15 Thread Jiahui Cen
Add a new error action 'retry' to support retry on errors. Signed-off-by: Jiahui Cen Signed-off-by: Ying Fang --- blockdev.c | 2 ++ qapi/block-core.json | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/blockdev.c b/blockdev.c index 412354b4b6..47c0e6db52 10064

[PATCH v4 7/7] virtio_blk: Add support for retry on errors

2020-12-15 Thread Jiahui Cen
Insert failed requests into device's list for later retry and handle queued requests to implement retry_request_cb. Signed-off-by: Jiahui Cen Signed-off-by: Ying Fang --- hw/block/virtio-blk.c | 19 --- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/hw/block/virt

[PATCH v4 3/7] block-backend: Add device specific retry callback

2020-12-15 Thread Jiahui Cen
Add retry_request_cb in BlockDevOps to do device specific retry action. Backend's timer would be registered only when the backend is set 'retry' on errors and the device supports retry action. Signed-off-by: Jiahui Cen Signed-off-by: Ying Fang --- block/block-backend.c | 8 in

[PATCH v4 2/7] block-backend: Introduce retry timer

2020-12-15 Thread Jiahui Cen
Add a timer to regularly trigger retry on errors. Signed-off-by: Jiahui Cen Signed-off-by: Ying Fang --- block/block-backend.c | 21 1 file changed, 21 insertions(+) diff --git a/block/block-backend.c b/block/block-backend.c index ce78d30794..fe775ea298 100644 --- a/block/

[PATCH v4 0/7] block: Add retry for werror=/rerror= mechanism

2020-12-15 Thread Jiahui Cen
A VM in the cloud environment may use a virutal disk as the backend storage, and there are usually filesystems on the virtual block device. When backend storage is temporarily down, any I/O issued to the virtual block device will cause an error. For example, an error occurred in ext4 filesystem wou

[PATCH v4 5/7] block-backend: Add timeout support for retry

2020-12-15 Thread Jiahui Cen
Retry should only be triggered when timeout is not reached, so let's check timeout before retry. Device should also reset retry_start_time after successful retry. Signed-off-by: Jiahui Cen Signed-off-by: Ying Fang --- block/block-backend.c | 25 +++- include/sysemu/bloc

[PATCH v4 6/7] block: Add error retry param setting

2020-12-15 Thread Jiahui Cen
Add "retry_interval" and "retry_timeout" parameter for drive and device option. These parameter are valid only when werror/rerror=retry. eg. --drive file=image,rerror=retry,retry_interval=1000,retry_timeout=5000 Signed-off-by: Jiahui Cen Signed-off-by: Ying Fang --- block/block-backend.c

[PATCH v4 4/7] block-backend: Enable retry action on errors

2020-12-15 Thread Jiahui Cen
Enable retry action when backend's retry timer is available. It would trigger the timer to do device specific retry action. Signed-off-by: Jiahui Cen Signed-off-by: Ying Fang --- block/block-backend.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/block/block-backend.c b/block/block

Re: [PATCH v12 0/7] Introduce 'yank' oob qmp command to recover from hanging qemu

2020-12-15 Thread Markus Armbruster
Lukas Straub writes: > Hello Everyone, > So here is v12. > @Marc-André Lureau, We still need an ACK for the chardev patch. Marc-André? Would be good to get this wrapped before Christmas.

Re: [PATCH v2 2/4] block: Avoid processing BDS twice in bdrv_set_aio_context_ignore()

2020-12-15 Thread Sergio Lopez
On Tue, Dec 15, 2020 at 01:12:33PM +0100, Kevin Wolf wrote: > Am 14.12.2020 um 18:05 hat Sergio Lopez geschrieben: > > While processing the parents of a BDS, one of the parents may process > > the child that's doing the tail recursion, which leads to a BDS being > > processed twice. This is especia

Re: [PATCH v5 0/4] hw/block/m25p80: Numonyx: Fix dummy cycles and check for SPI mode on cmds

2020-12-15 Thread Peter Maydell
On Mon, 16 Nov 2020 at 23:13, Joe Komlodi wrote: > > Changelog: > v4 -> v5 > - 3/4: Simplify logic when changing state and checking mode. > - 3/4: numonyx_get_mode -> numonyx_mode > - 4/4: Reword commit message to include QIO mode. > > v3 -> v4 > - 1/4: Patch changed to change names of registe

Re: [PATCH v4 23/32] qdev: Move dev->realized check to qdev_property_set()

2020-12-15 Thread Igor Mammedov
On Mon, 14 Dec 2020 12:24:18 -0500 Eduardo Habkost wrote: > On Mon, Dec 14, 2020 at 03:55:30PM +0100, Igor Mammedov wrote: > > On Fri, 11 Dec 2020 17:05:20 -0500 > > Eduardo Habkost wrote: > > > > > Every single qdev property setter function manually checks > > > dev->realized. We can just c

Re: [PATCH v2 2/4] block: Avoid processing BDS twice in bdrv_set_aio_context_ignore()

2020-12-15 Thread Kevin Wolf
Am 15.12.2020 um 14:15 hat Sergio Lopez geschrieben: > On Tue, Dec 15, 2020 at 01:12:33PM +0100, Kevin Wolf wrote: > > Am 14.12.2020 um 18:05 hat Sergio Lopez geschrieben: > > > While processing the parents of a BDS, one of the parents may process > > > the child that's doing the tail recursion, wh

Re: [PATCH v2 4/4] block: Close block exports in two steps

2020-12-15 Thread Kevin Wolf
Am 14.12.2020 um 18:05 hat Sergio Lopez geschrieben: > There's a cross-dependency between closing the block exports and > draining the block layer. The latter needs that we close all export's > client connections to ensure they won't queue more requests, but the > exports may have coroutines yieldi

Re: [PATCH] iotests: Quote $cmd in _send_qemu_cmd

2020-12-15 Thread Kevin Wolf
Am 15.12.2020 um 13:14 hat Max Reitz geschrieben: > On 15.12.20 12:43, Kevin Wolf wrote: > > Am 14.12.2020 um 18:58 hat Max Reitz geschrieben: > > > With bash 5.1, the output of the following script (which creates an > > > array with a single element, then takes a single-element slice from that > >

Re: [PATCH v3] hw/block/nand: Decommission the NAND museum

2020-12-15 Thread Kevin Wolf
Am 14.12.2020 um 11:02 hat Peter Maydell geschrieben: > On Mon, 14 Dec 2020 at 00:26, Philippe Mathieu-Daudé wrote: > > > > This is the QEMU equivalent of this Linux commit (but 7 years later): > > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=f7025a43a9da2 > > > >

Re: [PATCH] iotests: Quote $cmd in _send_qemu_cmd

2020-12-15 Thread Max Reitz
On 15.12.20 16:49, Kevin Wolf wrote: [...] Ah, looks like you don't even need to quote it like cmd="$1"? Maybe I should learn bash sometime... No, normally you don’t, which is the reason why the "cmd=${$@: x:y}" line wasn’t quoted so far. (Probably a bug in bash that was then fixed in 5.1.

Re: [PATCH] block/nfs: fix int overflow in nfs_client_open_qdict

2020-12-15 Thread Kevin Wolf
Am 10.12.2020 um 10:00 hat Stefano Garzarella geschrieben: > On Wed, Dec 09, 2020 at 01:17:35PM +0100, Peter Lieven wrote: > > nfs_client_open returns the file size in sectors. This effectively > > makes it impossible to open files larger than 1TB. > > > > Fixes: a1a42af422d46812f1f0cebe6b230c2040

Re: [PATCH v3 1/3] docs: generate qemu-storage-daemon-qmp-ref(7) man page

2020-12-15 Thread Kevin Wolf
Am 09.12.2020 um 11:38 hat Stefan Hajnoczi geschrieben: > Although individual qemu-storage-daemon QMP commands are identical to > QEMU QMP commands, qemu-storage-daemon only supports a subset of QEMU's > QMP commands. Generate a manual page of just the commands supported by > qemu-storage-daemon so

Re: [PATCH v11 08/13] block/nvme: Make ZNS-related definitions

2020-12-15 Thread Stefan Hajnoczi
On Wed, Dec 09, 2020 at 07:37:11AM +0100, Klaus Jensen wrote: > CC for Stefan (nvme block driver co-maintainer). > > On Dec 9 05:04, Dmitry Fomichev wrote: > > Define values and structures that are needed to support Zoned > > Namespace Command Set (NVMe TP 4053). > > > > Signed-off-by: Dmitry Fo

Re: [PATCH] hw/block: m25p80: Fix fast read for SST flashes

2020-12-15 Thread Francisco Iglesias
Hello Bin, On [2020 Dec 12] Sat 17:44:27, Bin Meng wrote: > Hi Francisco, > > On Sat, Dec 12, 2020 at 5:24 PM Francisco Iglesias > wrote: > > > > Hi bin, > > > > On [2020 Dec 12] Sat 16:16:59, Bin Meng wrote: > > > Hi Francisco, > > > > > > On Sat, Dec 12, 2020 at 12:11 AM Francisco Iglesias > >

Re: [PATCH v2 2/4] block: Avoid processing BDS twice in bdrv_set_aio_context_ignore()

2020-12-15 Thread Sergio Lopez
On Tue, Dec 15, 2020 at 04:01:19PM +0100, Kevin Wolf wrote: > Am 15.12.2020 um 14:15 hat Sergio Lopez geschrieben: > > On Tue, Dec 15, 2020 at 01:12:33PM +0100, Kevin Wolf wrote: > > > Am 14.12.2020 um 18:05 hat Sergio Lopez geschrieben: > > > > While processing the parents of a BDS, one of the par

Re: [PATCH v2 4/4] block: Close block exports in two steps

2020-12-15 Thread Sergio Lopez
On Tue, Dec 15, 2020 at 04:34:05PM +0100, Kevin Wolf wrote: > Am 14.12.2020 um 18:05 hat Sergio Lopez geschrieben: > > There's a cross-dependency between closing the block exports and > > draining the block layer. The latter needs that we close all export's > > client connections to ensure they won

Re: [PATCH v2 08/36] block: make bdrv_reopen_{prepare, commit, abort} private

2020-12-15 Thread Alberto Garcia
On Fri 27 Nov 2020 03:44:54 PM CET, Vladimir Sementsov-Ogievskiy via wrote: > These functions are called only from bdrv_reopen_multiple() in block.c. > No reason to publish them. > > Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Alberto Garcia Berto

Re: [PATCH v2 09/36] block: return value from bdrv_replace_node()

2020-12-15 Thread Alberto Garcia
On Fri 27 Nov 2020 03:44:55 PM CET, Vladimir Sementsov-Ogievskiy wrote: > Functions with errp argument are not recommened to be void-functions. > Improve bdrv_replace_node(). > > Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Alberto Garcia Berto

[PATCH] block: report errno when flock fcntl fails

2020-12-15 Thread David Edmondson
When a call to fcntl(2) for the purpose of manipulating file locks fails, report the error returned by fcntl. Signed-off-by: David Edmondson --- block/file-posix.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/block/file-posix.c b/block/file-posix.c i

Re: [PATCH v11 00/13] hw/block/nvme: Support Namespace Types and Zoned Namespace Command Set

2020-12-15 Thread Keith Busch
Hi Dmitry, Looks good to me, thanks for sticking with it. Reviewed-by: Keith Busch

[PATCH v15 02/13] block: add API function to insert a node

2020-12-15 Thread Vladimir Sementsov-Ogievskiy
From: Andrey Shinkevich Provide API for insertion a node to backing chain. Suggested-by: Max Reitz Signed-off-by: Andrey Shinkevich Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- include/block/block.h | 2 ++ block.c | 25 + 2 fil

[PATCH v15 00/13] Apply COR-filter to the block-stream permanently

2020-12-15 Thread Vladimir Sementsov-Ogievskiy
Hi all! Here is a new version of cor-filter in block-stream series. Main change is freezing the chain in cor-filter itself. v15: 02: s/ = / = / add Max's r-b 03: add Max's r-b 04: since: 6.0 indent comment add Max's r-b 05: changed commit msg wording document the default

[PATCH v15 04/13] qapi: add filter-node-name to block-stream

2020-12-15 Thread Vladimir Sementsov-Ogievskiy
From: Andrey Shinkevich Provide the possibility to pass the 'filter-node-name' parameter to the block-stream job as it is done for the commit block job. Signed-off-by: Andrey Shinkevich Reviewed-by: Vladimir Sementsov-Ogievskiy [vsementsov: comment indentation, s/Since: 5.2/Since: 6.0/] Revi

[PATCH v15 05/13] qapi: copy-on-read filter: add 'bottom' option

2020-12-15 Thread Vladimir Sementsov-Ogievskiy
From: Andrey Shinkevich Add an option to limit copy-on-read operations to specified sub-chain of backing-chain, to make copy-on-read filter useful for block-stream job. Suggested-by: Max Reitz Suggested-by: Vladimir Sementsov-Ogievskiy Signed-off-by: Andrey Shinkevich Signed-off-by: Vladimir

[PATCH v15 09/13] stream: rework backing-file changing

2020-12-15 Thread Vladimir Sementsov-Ogievskiy
From: Andrey Shinkevich Stream in stream_prepare calls bdrv_change_backing_file() to change backing-file in the metadata of bs. It may use either backing-file parameter given by user or just take filename of base on job start. Backing file format is determined by base on job finish. There are

[PATCH v15 10/13] qapi: block-stream: add "bottom" argument

2020-12-15 Thread Vladimir Sementsov-Ogievskiy
The code already don't freeze base node and we try to make it prepared for the situation when base node is changed during the operation. In other words, block-stream doesn't own base node. Let's introduce a new interface which should replace the current one, which will in better relations with the

[PATCH v15 01/13] copy-on-read: support preadv/pwritev_part functions

2020-12-15 Thread Vladimir Sementsov-Ogievskiy
From: Andrey Shinkevich Add support for the recently introduced functions bdrv_co_preadv_part() and bdrv_co_pwritev_part() to the COR-filter driver. Signed-off-by: Andrey Shinkevich Reviewed-by: Vladimir Sementsov-Ogievskiy --- block/copy-on-read.c | 28 1 file ch

[PATCH v15 07/13] block: include supported_read_flags into BDS structure

2020-12-15 Thread Vladimir Sementsov-Ogievskiy
From: Andrey Shinkevich Add the new member supported_read_flags to the BlockDriverState structure. It will control the flags set for copy-on-read operations. Make the block generic layer evaluate supported read flags before they go to a block driver. Suggested-by: Vladimir Sementsov-Ogievskiy S

[PATCH v15 03/13] copy-on-read: add filter drop function

2020-12-15 Thread Vladimir Sementsov-Ogievskiy
From: Andrey Shinkevich Provide API for the COR-filter removal. Also, drop the filter child permissions for an inactive state when the filter node is being removed. To insert the filter, the block generic layer function bdrv_insert_node() can be used. The new function bdrv_cor_filter_drop() may b

[PATCH v15 08/13] copy-on-read: skip non-guest reads if no copy needed

2020-12-15 Thread Vladimir Sementsov-Ogievskiy
From: Andrey Shinkevich If the flag BDRV_REQ_PREFETCH was set, skip idling read/write operations in COR-driver. It can be taken into account for the COR-algorithms optimization. That check is being made during the block stream job by the moment. Add the BDRV_REQ_PREFETCH flag to the supported_re

[PATCH v15 06/13] iotests: add #310 to test bottom node in COR driver

2020-12-15 Thread Vladimir Sementsov-Ogievskiy
From: Andrey Shinkevich The test case #310 is similar to #216 by Max Reitz. The difference is that the test #310 involves a bottom node to the COR filter driver. Signed-off-by: Andrey Shinkevich Signed-off-by: Vladimir Sementsov-Ogievskiy [vsementsov: detach backing to test reads from top, l

[PATCH v15 13/13] block: apply COR-filter to block-stream jobs

2020-12-15 Thread Vladimir Sementsov-Ogievskiy
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 block-stream job, to reduce the disk overuse (we need control on permissio

Re: [PATCH] block: report errno when flock fcntl fails

2020-12-15 Thread Vladimir Sementsov-Ogievskiy
15.12.2020 22:01, David Edmondson wrote: When a call to fcntl(2) for the purpose of manipulating file locks fails, report the error returned by fcntl. Signed-off-by: David Edmondson Reviewed-by: Vladimir Sementsov-Ogievskiy -- Best regards, Vladimir

[PATCH v15 11/13] iotests: 30: prepare to COR filter insertion by stream job

2020-12-15 Thread Vladimir Sementsov-Ogievskiy
test_stream_parallel run parallel stream jobs, intersecting so that top of one is base of another. It's OK now, but it would be a problem if insert the filter, as one job will want to use another job's filter as above_base node. Correct thing to do is move to new interface: "bottom" argument inste

[PATCH v15 12/13] block/stream: add s->target_bs

2020-12-15 Thread Vladimir Sementsov-Ogievskiy
Add a direct link to target bs for convenience and to simplify following commit which will insert COR filter above target bs. This is a part of original commit written by Andrey. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- block/stream.c | 23 ++-