[PATCH v4 30/32] qdev: Rename qdev_get_prop_ptr() to object_field_prop_ptr()

2020-12-11 Thread Eduardo Habkost
The function will be moved to common QOM code, as it is not specific to TYPE_DEVICE anymore. Reviewed-by: Stefan Berger Signed-off-by: Eduardo Habkost --- Changes v1 -> v2: * Rename to object_field_prop_ptr() instead of object_static_prop_ptr() --- Cc: Stefan Berger Cc: Stefano Stabellini Cc:

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

2020-12-11 Thread Eduardo Habkost
Every single qdev property setter function manually checks dev->realized. We can just check dev->realized inside qdev_property_set() instead. The check is being added as a separate function (qdev_prop_allow_set()) because it will become a callback later. Reviewed-by: Stefan Berger

[PATCH v4 09/32] qdev: Make qdev_get_prop_ptr() get Object* arg

2020-12-11 Thread Eduardo Habkost
Make the code more generic and not specific to TYPE_DEVICE. Reviewed-by: Marc-André Lureau Reviewed-by: Cornelia Huck #s390 parts Signed-off-by: Eduardo Habkost --- Changes v1 -> v2: - Fix build error with CONFIG_XEN I took the liberty of keeping the Reviewed-by line from Marc-André as the

Re: [PATCH 19/20] block: Use GString instead of QString to build filenames

2020-12-11 Thread Vladimir Sementsov-Ogievskiy
11.12.2020 20:11, Markus Armbruster wrote: QString supports modifying its string, but it's quite limited: you can only append. Just one caller remains: bdrv_parse_filename_strip_prefix() uses it just for building an initial string. Change it to do build the initial string with GString. This

[PATCH v4 14/16] block/io: support int64_t bytes in bdrv_co_p{read, write}v_part()

2020-12-11 Thread Vladimir Sementsov-Ogievskiy via
We are generally moving to int64_t for both offset and bytes parameters on all io paths. Main motivation is realization of 64-bit write_zeroes operation for fast zeroing large disk chunks, up to the whole disk. We chose signed type, to be consistent with off_t (which is signed) and with

[PATCH v4 13/16] block/io: support int64_t bytes in bdrv_aligned_preadv()

2020-12-11 Thread Vladimir Sementsov-Ogievskiy
We are generally moving to int64_t for both offset and bytes parameters on all io paths. Main motivation is realization of 64-bit write_zeroes operation for fast zeroing large disk chunks, up to the whole disk. We chose signed type, to be consistent with off_t (which is signed) and with

[PATCH v4 08/16] block: use int64_t as bytes type in tracked requests

2020-12-11 Thread Vladimir Sementsov-Ogievskiy
We are generally moving to int64_t for both offset and bytes parameters on all io paths. Main motivation is realization of 64-bit write_zeroes operation for fast zeroing large disk chunks, up to the whole disk. We chose signed type, to be consistent with off_t (which is signed) and with

[PATCH v4 07/16] block/io: improve bdrv_check_request: check qiov too

2020-12-11 Thread Vladimir Sementsov-Ogievskiy
Operations with qiov add more restrictions on bytes, let's cover it. Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/io.c | 46 +++--- 1 file changed, 39 insertions(+), 7 deletions(-) diff --git a/block/io.c b/block/io.c index

[PATCH v4 12/16] block/io: support int64_t bytes in bdrv_co_do_copy_on_readv()

2020-12-11 Thread Vladimir Sementsov-Ogievskiy
We are generally moving to int64_t for both offset and bytes parameters on all io paths. Main motivation is realization of 64-bit write_zeroes operation for fast zeroing large disk chunks, up to the whole disk. We chose signed type, to be consistent with off_t (which is signed) and with

[PATCH v4 11/16] block/io: support int64_t bytes in bdrv_aligned_pwritev()

2020-12-11 Thread Vladimir Sementsov-Ogievskiy
We are generally moving to int64_t for both offset and bytes parameters on all io paths. Main motivation is realization of 64-bit write_zeroes operation for fast zeroing large disk chunks, up to the whole disk. We chose signed type, to be consistent with off_t (which is signed) and with

[PATCH v4 16/16] block/io: use int64_t bytes in copy_range

2020-12-11 Thread Vladimir Sementsov-Ogievskiy
We are generally moving to int64_t for both offset and bytes parameters on all io paths. Main motivation is realization of 64-bit write_zeroes operation for fast zeroing large disk chunks, up to the whole disk. We chose signed type, to be consistent with off_t (which is signed) and with

[PATCH v4 05/16] block/io: bdrv_pad_request(): support qemu_iovec_init_extended failure

2020-12-11 Thread Vladimir Sementsov-Ogievskiy
Make bdrv_pad_request() honest: return error if qemu_iovec_init_extended() failed. Update also bdrv_padding_destroy() to clean the structure for safety. Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/io.c | 45 +++-- 1 file changed, 31

[PATCH v4 10/16] block/io: support int64_t bytes in bdrv_co_do_pwrite_zeroes()

2020-12-11 Thread Vladimir Sementsov-Ogievskiy
We are generally moving to int64_t for both offset and bytes parameters on all io paths. Main motivation is realization of 64-bit write_zeroes operation for fast zeroing large disk chunks, up to the whole disk. We chose signed type, to be consistent with off_t (which is signed) and with

[PATCH v4 09/16] block/io: use int64_t bytes in driver wrappers

2020-12-11 Thread Vladimir Sementsov-Ogievskiy
We are generally moving to int64_t for both offset and bytes parameters on all io paths. Main motivation is realization of 64-bit write_zeroes operation for fast zeroing large disk chunks, up to the whole disk. We chose signed type, to be consistent with off_t (which is signed) and with

[PATCH v4 15/16] block/io: support int64_t bytes in read/write wrappers

2020-12-11 Thread Vladimir Sementsov-Ogievskiy
We are generally moving to int64_t for both offset and bytes parameters on all io paths. Main motivation is realization of 64-bit write_zeroes operation for fast zeroing large disk chunks, up to the whole disk. We chose signed type, to be consistent with off_t (which is signed) and with

[PATCH v4 06/16] block/throttle-groups: throttle_group_co_io_limits_intercept(): 64bit bytes

2020-12-11 Thread Vladimir Sementsov-Ogievskiy
The function is called from 64bit io handlers, and bytes is just passed to throttle_account() which is 64bit too (unsigned though). So, let's convert intermediate argument to 64bit too. This patch is a first in the 64-bit-blocklayer series, so we are generally moving to int64_t for both offset

[PATCH v4 02/16] util/iov: make qemu_iovec_init_extended() honest

2020-12-11 Thread Vladimir Sementsov-Ogievskiy
Actually, we can't extend the io vector in all cases. Handle possible MAX_IOV and size_t overflows. For now add assertion to callers (actually they rely on success anyway) and fix them in the following patch. Add also some additional good assertions to qemu_iovec_init_slice() while being here.

[PATCH v4 03/16] block: fix theoretical overflow in bdrv_init_padding()

2020-12-11 Thread Vladimir Sementsov-Ogievskiy
Calculation of sum may theoretically overflow, so use 64bit type and add some good assertions. Use int64_t constantly. Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/io.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/block/io.c b/block/io.c index

[PATCH v4 04/16] block/io: refactor bdrv_pad_request(): move bdrv_pad_request() up

2020-12-11 Thread Vladimir Sementsov-Ogievskiy
Prepare to the following patch when bdrv_pad_request() will be able to fail. Update the comments. Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/io.c | 25 +++-- 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/block/io.c b/block/io.c index

Re: [PATCH 10/20] block: Avoid qobject_get_try_str()

2020-12-11 Thread Vladimir Sementsov-Ogievskiy
11.12.2020 20:11, Markus Armbruster wrote: I'm about to remove qobject_get_try_str(). Use qstring_get_str() instead. Safe because the argument is known to be a QString here. Cc: Kevin Wolf Cc: Max Reitz Cc:qemu-block@nongnu.org Signed-off-by: Markus Armbruster Reviewed-by: Vladimir

[PATCH v4 00/16] 64bit block-layer: part I

2020-12-11 Thread Vladimir Sementsov-Ogievskiy
Hi all! We want 64bit write-zeroes, and for this, convert all io functions to 64bit. We chose signed type, to be consistent with off_t (which is signed) and with possibility for signed return type (where negative value means error). Please refer to initial cover-letter

[PATCH v4 01/16] block: refactor bdrv_check_request: add errp

2020-12-11 Thread Vladimir Sementsov-Ogievskiy
It's better to pass _abort than just assert that result is 0: on crash, we'll immediately see the reason in the backtrace. Signed-off-by: Vladimir Sementsov-Ogievskiy --- include/block/block_int.h| 2 +- block/file-posix.c | 2 +- block/io.c | 29

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

2020-12-11 Thread Vladimir Sementsov-Ogievskiy
11.12.2020 20:21, Max Reitz wrote: On 04.12.20 23:07, Vladimir Sementsov-Ogievskiy 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

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

2020-12-11 Thread Max Reitz
On 04.12.20 23:07, Vladimir Sementsov-Ogievskiy 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 block-stream

[PATCH 10/20] block: Avoid qobject_get_try_str()

2020-12-11 Thread Markus Armbruster
I'm about to remove qobject_get_try_str(). Use qstring_get_str() instead. Safe because the argument is known to be a QString here. Cc: Kevin Wolf Cc: Max Reitz Cc: qemu-block@nongnu.org Signed-off-by: Markus Armbruster --- block.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)

[PATCH 19/20] block: Use GString instead of QString to build filenames

2020-12-11 Thread Markus Armbruster
QString supports modifying its string, but it's quite limited: you can only append. Just one caller remains: bdrv_parse_filename_strip_prefix() uses it just for building an initial string. Change it to do build the initial string with GString. This is another step towards making QString

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

2020-12-11 Thread Max Reitz
On 11.12.20 18:42, Vladimir Sementsov-Ogievskiy wrote: 11.12.2020 20:24, Max Reitz wrote: On 11.12.20 17:50, Vladimir Sementsov-Ogievskiy wrote: 11.12.2020 19:05, Max Reitz wrote: On 04.12.20 23:07, Vladimir Sementsov-Ogievskiy wrote: The code already don't freeze base node and we try to

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

2020-12-11 Thread Vladimir Sementsov-Ogievskiy
11.12.2020 20:24, Max Reitz wrote: On 11.12.20 17:50, Vladimir Sementsov-Ogievskiy wrote: 11.12.2020 19:05, Max Reitz wrote: On 04.12.20 23:07, Vladimir Sementsov-Ogievskiy wrote: The code already don't freeze base node and we try to make it prepared for the situation when base node is

[PULL 33/34] block: Fix locking in qmp_block_resize()

2020-12-11 Thread Kevin Wolf
The drain functions assume that we hold the AioContext lock of the drained block node. Make sure to actually take the lock. Cc: qemu-sta...@nongnu.org Fixes: eb94b81a94bce112e6b206df846c1551aaf6cab6 Signed-off-by: Kevin Wolf Message-Id: <20201203172311.68232-3-kw...@redhat.com> Reviewed-by:

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

2020-12-11 Thread Max Reitz
On 11.12.20 17:50, Vladimir Sementsov-Ogievskiy wrote: 11.12.2020 19:05, Max Reitz wrote: On 04.12.20 23:07, Vladimir Sementsov-Ogievskiy wrote: 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

[PULL 28/34] block/file-posix: fix workaround in raw_do_pwrite_zeroes()

2020-12-11 Thread Kevin Wolf
From: Vladimir Sementsov-Ogievskiy We should not set overlap_bytes: 1. Don't worry: it is calculated by bdrv_mark_request_serialising() and will be equal to or greater than bytes anyway. 2. If the request was already aligned up to some greater alignment, than we may break things: we

[PULL 21/34] iotests: Give access to the qemu-storage-daemon

2020-12-11 Thread Kevin Wolf
From: Max Reitz Signed-off-by: Max Reitz Message-Id: <20201027190600.192171-18-mre...@redhat.com> Signed-off-by: Kevin Wolf --- tests/qemu-iotests/check | 11 +++ tests/qemu-iotests/common.rc | 17 + 2 files changed, 28 insertions(+) diff --git

[PULL 25/34] file-posix: check the use_lock before setting the file lock

2020-12-11 Thread Kevin Wolf
From: Li Feng The scenario is that when accessing a volume on an NFS filesystem without supporting the file lock, Qemu will complain "Failed to lock byte 100", even when setting the file.locking = off. We should do file lock related operations only when the file.locking is enabled, otherwise,

[PULL 32/34] block: Simplify qmp_block_resize() error paths

2020-12-11 Thread Kevin Wolf
The only thing that happens after the 'out:' label is blk_unref(blk). However, blk = NULL in all of the error cases, so instead of jumping to 'out:', we can just return directly. Cc: qemu-sta...@nongnu.org Signed-off-by: Kevin Wolf Message-Id: <20201203172311.68232-2-kw...@redhat.com>

[PULL 20/34] storage-daemon: Call bdrv_close_all() on exit

2020-12-11 Thread Kevin Wolf
From: Max Reitz Otherwise, exports and block devices are not properly shut down and closed, unless the users explicitly issues blockdev-del and block-export-del commands for each of them. Signed-off-by: Max Reitz Reviewed-by: Kevin Wolf Message-Id: <20201027190600.192171-17-mre...@redhat.com>

[PULL 34/34] block: Fix deadlock in bdrv_co_yield_to_drain()

2020-12-11 Thread Kevin Wolf
If bdrv_co_yield_to_drain() is called for draining a block node that runs in a different AioContext, it keeps that AioContext locked while it yields and schedules a BH in the AioContext to do the actual drain. As long as executing the BH is the very next thing that the event loop of the node's

[PULL 29/34] block/io: bdrv_refresh_limits(): use ERRP_GUARD

2020-12-11 Thread Kevin Wolf
From: Vladimir Sementsov-Ogievskiy This simplifies following commit. Signed-off-by: Vladimir Sementsov-Ogievskiy Message-Id: <20201203222713.13507-3-vsement...@virtuozzo.com> Reviewed-by: Alberto Garcia Signed-off-by: Kevin Wolf --- block/io.c | 7 +++ 1 file changed, 3 insertions(+), 4

[PULL 26/34] iotests/221: Discard image before qemu-img map

2020-12-11 Thread Kevin Wolf
From: Max Reitz See the new comment for why this should be done. I do not have a reproducer on master, but when using FUSE block exports, this test breaks depending on the underlying filesystem (for me, it works on tmpfs, but fails on xfs, because the block allocated by file-posix has 16 kB

[PULL 24/34] iotests/308: Add test for FUSE exports

2020-12-11 Thread Kevin Wolf
From: Max Reitz We have good coverage of the normal I/O paths now, but what remains is a test that tests some more special cases: Exporting an image on itself (thus turning a formatted image into a raw one), some error cases, and non-writable and non-growable exports. Signed-off-by: Max Reitz

[PULL 18/34] iotests: Let _make_test_img guess $TEST_IMG_FILE

2020-12-11 Thread Kevin Wolf
From: Max Reitz When most iotests want to create a test image that is named differently from the default $TEST_IMG, they do something like this: TEST_IMG="$TEST_IMG.base" _make_test_img $options This works fine with the "file" protocol, but not so much for anything else: _make_test_img

[PULL 15/34] iotests: Derive image names from $TEST_IMG

2020-12-11 Thread Kevin Wolf
From: Max Reitz Avoid creating images with custom filenames in $TEST_DIR, because non-file protocols may want to keep $TEST_IMG (and all other test images) in some other directory. Signed-off-by: Max Reitz Reviewed-by: Kevin Wolf Message-Id: <20201027190600.192171-12-mre...@redhat.com>

[PULL 14/34] iotests/046: Avoid renaming images

2020-12-11 Thread Kevin Wolf
From: Max Reitz This generally does not work on non-file protocols. It is better to create the image with the final name from the start, and most tests do this already. Let 046 follow suit. Signed-off-by: Max Reitz Reviewed-by: Kevin Wolf Message-Id:

[PULL 13/34] iotests: Use convert -n in some cases

2020-12-11 Thread Kevin Wolf
From: Max Reitz qemu-img convert (without -n) can often be replaced by a combination of _make_test_img + qemu-img convert -n. Doing so allows converting to protocols that do not allow direct file creation, such as FUSE exports. The only problem is that for formats other than qcow2 and qed

[PATCH 00/20] Immutable QString, and also one JSON writer less

2020-12-11 Thread Markus Armbruster
Based-on: <20201210161452.2813491-1-arm...@redhat.com> Cc: Daniel P. Berrangé Cc: Dr. David Alan Gilbert Cc: Eduardo Habkost Cc: Juan Quintela Cc: Kevin Wolf Cc: Marcel Apfelbaum Cc: Max Reitz Cc: Paolo Bonzini Cc: Yuval Shaia Cc: qemu-block@nongnu.org Markus Armbruster (20): hmp:

[PULL 23/34] iotests: Enable fuse for many tests

2020-12-11 Thread Kevin Wolf
From: Max Reitz Many tests (that do not support generic protocols) can run just fine with FUSE-exported images, so allow them to. Note that this is no attempt at being definitely complete. There are some tests that might be modified to run on FUSE, but this patch still skips them. This patch

[PULL 11/34] iotests: Do not needlessly filter _make_test_img

2020-12-11 Thread Kevin Wolf
From: Max Reitz In most cases, _make_test_img does not need a _filter_imgfmt on top. It does that by itself. (The exception is when IMGFMT has been overwritten but TEST_IMG has not. In such cases, we do need a _filter_imgfmt on top to filter the test's original IMGFMT from TEST_IMG.)

[PULL 10/34] fuse: Implement hole detection through lseek

2020-12-11 Thread Kevin Wolf
From: Max Reitz This is a relatively new feature in libfuse (available since 3.8.0, which was released in November 2019), so we have to add a dedicated check whether it is available before making use of it. Signed-off-by: Max Reitz Message-Id: <20201027190600.192171-7-mre...@redhat.com>

[PULL 09/34] fuse: (Partially) implement fallocate()

2020-12-11 Thread Kevin Wolf
From: Max Reitz This allows allocating areas after the (old) EOF as part of a growing resize, writing zeroes, and discarding. Signed-off-by: Max Reitz Message-Id: <20201027190600.192171-6-mre...@redhat.com> Signed-off-by: Kevin Wolf --- block/export/fuse.c | 84

[PULL 19/34] iotests/287: Clean up subshell test image

2020-12-11 Thread Kevin Wolf
From: Max Reitz 287 creates an image in a subshell (thanks to the pipe) to see whether that is possible with compression_type=zstd. If _make_test_img were to modify any global state, this global state would then be lost before we could cleanup the image. When using FUSE as the test protocol,

[PULL 22/34] iotests: Allow testing FUSE exports

2020-12-11 Thread Kevin Wolf
From: Max Reitz This pretends FUSE exports are a kind of protocol. As such, they are always tested under the format node. This is probably the best way to test them, actually, because this will generate more I/O load and more varied patterns. Signed-off-by: Max Reitz Message-Id:

[PULL 05/34] meson: Detect libfuse

2020-12-11 Thread Kevin Wolf
From: Max Reitz Signed-off-by: Max Reitz Message-Id: <20201027190600.192171-2-mre...@redhat.com> Signed-off-by: Kevin Wolf --- meson_options.txt | 2 ++ configure | 7 +++ meson.build | 6 ++ 3 files changed, 15 insertions(+) diff --git a/meson_options.txt

[PULL 30/34] block/io: bdrv_check_byte_request(): drop bdrv_is_inserted()

2020-12-11 Thread Kevin Wolf
From: Vladimir Sementsov-Ogievskiy Move bdrv_is_inserted() calls into callers. We are going to make bdrv_check_byte_request() a clean thing. bdrv_is_inserted() is not about checking the request, it's about checking the bs. So, it should be separate. With this patch we probably change error

[PULL 31/34] block: introduce BDRV_MAX_LENGTH

2020-12-11 Thread Kevin Wolf
From: Vladimir Sementsov-Ogievskiy We are going to modify block layer to work with 64bit requests. And first step is moving to int64_t type for both offset and bytes arguments in all block request related functions. It's mostly safe (when widening signed or unsigned int to int64_t), but

[PULL 27/34] can-host: Fix crash when 'canbus' property is not set

2020-12-11 Thread Kevin Wolf
Providing the 'if' property, but not 'canbus' segfaults like this: #0 0x55b0f14d in can_bus_insert_client (bus=0x0, client=0x56aa9af0) at ../net/can/can_core.c:88 #1 0x559c3803 in can_host_connect (ch=0x56aa9ac0, errp=0x7fffd568) at ../net/can/can_host.c:62 #2

[PULL 16/34] iotests/091: Use _cleanup_qemu instad of "wait"

2020-12-11 Thread Kevin Wolf
From: Max Reitz If the test environment has some other child processes running (like a storage daemon that provides a FUSE export), then "wait" will never finish. Use wait=yes _cleanup_qemu instead. (We need to discard the output so there is no change to the reference output.) Signed-off-by:

[PULL 02/34] block/curl: Use lock guard macros

2020-12-11 Thread Kevin Wolf
From: Gan Qixin Replace manual lock()/unlock() calls with lock guard macros (QEMU_LOCK_GUARD/WITH_QEMU_LOCK_GUARD) in block/curl. Signed-off-by: Gan Qixin Reviewed-by: Paolo Bonzini Message-Id: <20201203075055.127773-3-ganqi...@huawei.com> Signed-off-by: Kevin Wolf --- block/curl.c | 28

[PULL 08/34] fuse: Allow growable exports

2020-12-11 Thread Kevin Wolf
From: Max Reitz These will behave more like normal files in that writes beyond the EOF will automatically grow the export size. As an optimization, keep the RESIZE permission for growable exports so we do not have to take it for every post-EOF write. (This permission is not released when the

[PULL 03/34] block/throttle-groups: Use lock guard macros

2020-12-11 Thread Kevin Wolf
From: Gan Qixin Replace manual lock()/unlock() calls with lock guard macros (QEMU_LOCK_GUARD/WITH_QEMU_LOCK_GUARD) in block/throttle-groups. Signed-off-by: Gan Qixin Message-Id: <20201203075055.127773-4-ganqi...@huawei.com> Signed-off-by: Kevin Wolf --- block/throttle-groups.c | 48

[PULL 04/34] block/iscsi: Use lock guard macros

2020-12-11 Thread Kevin Wolf
From: Gan Qixin Replace manual lock()/unlock() calls with lock guard macros (QEMU_LOCK_GUARD/WITH_QEMU_LOCK_GUARD) in block/iscsi. Signed-off-by: Gan Qixin Message-Id: <20201203075055.127773-5-ganqi...@huawei.com> Signed-off-by: Kevin Wolf --- block/iscsi.c | 50

[PULL 01/34] block/accounting: Use lock guard macros

2020-12-11 Thread Kevin Wolf
From: Gan Qixin Replace manual lock()/unlock() calls with lock guard macros (QEMU_LOCK_GUARD/WITH_QEMU_LOCK_GUARD) in block/accounting. Signed-off-by: Gan Qixin Reviewed-by: Paolo Bonzini Message-Id: <20201203075055.127773-2-ganqi...@huawei.com> Signed-off-by: Kevin Wolf ---

[PULL 17/34] iotests: Restrict some Python tests to file

2020-12-11 Thread Kevin Wolf
From: Max Reitz Most Python tests are restricted to the file protocol (without explicitly saying so), but these are the ones that would break ./check -fuse -qcow2. Signed-off-by: Max Reitz Reviewed-by: Kevin Wolf Message-Id: <20201027190600.192171-14-mre...@redhat.com> Signed-off-by: Kevin

[PULL 12/34] iotests: Do not pipe _make_test_img

2020-12-11 Thread Kevin Wolf
From: Max Reitz Executing _make_test_img as part of a pipe will undo all variable changes it has done. As such, this could not work with FUSE (because we want to remember all of our exports and their qemu instances). Replace the pipe by a temporary file in 071 and 174 (the two tests that can

[PULL 07/34] fuse: Implement standard FUSE operations

2020-12-11 Thread Kevin Wolf
From: Max Reitz This makes the export actually useful instead of only producing errors whenever it is accessed. Signed-off-by: Max Reitz Message-Id: <20201027190600.192171-4-mre...@redhat.com> Signed-off-by: Kevin Wolf --- block/export/fuse.c | 242

[PULL 06/34] fuse: Allow exporting BDSs via FUSE

2020-12-11 Thread Kevin Wolf
From: Max Reitz block-export-add type=fuse allows mounting block graph nodes via FUSE on some existing regular file. That file should then appears like a raw disk image, and accesses to it result in accesses to the exported BDS. Right now, we only implement the necessary block export functions

[PULL 00/34] Block layer patches

2020-12-11 Thread Kevin Wolf
The following changes since commit b785d25e91718a660546a6550f64b3c543af7754: Merge remote-tracking branch 'remotes/bonzini-gitlab/tags/for-upstream' into staging (2020-12-11 13:50:35 +) are available in the Git repository at: git://repo.or.cz/qemu/kevin.git tags/for-upstream for you

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

2020-12-11 Thread Vladimir Sementsov-Ogievskiy
11.12.2020 19:05, Max Reitz wrote: On 04.12.20 23:07, Vladimir Sementsov-Ogievskiy wrote: 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

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

2020-12-11 Thread Max Reitz
On 04.12.20 23:07, Vladimir Sementsov-Ogievskiy wrote: 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 ---

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

2020-12-11 Thread Francisco Iglesias
Hello Bin, On [2020 Dec 11] Fri 23:29:16, Bin Meng wrote: > Hi Francisco, > > On Fri, Dec 11, 2020 at 11:16 PM Francisco Iglesias > wrote: > > > > Hello Bin, > > > > On [2020 Dec 11] Fri 14:07:21, Bin Meng wrote: > > > Hi Francisco, > > > > > > On Fri, Dec 4, 2020 at 7:28 PM Francisco Iglesias

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

2020-12-11 Thread Max Reitz
On 04.12.20 23:07, Vladimir Sementsov-Ogievskiy wrote: 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

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

2020-12-11 Thread Max Reitz
On 04.12.20 23:07, Vladimir Sementsov-Ogievskiy wrote: 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

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

2020-12-11 Thread Bin Meng
Hi Francisco, On Fri, Dec 11, 2020 at 11:16 PM Francisco Iglesias wrote: > > Hello Bin, > > On [2020 Dec 11] Fri 14:07:21, Bin Meng wrote: > > Hi Francisco, > > > > On Fri, Dec 4, 2020 at 7:28 PM Francisco Iglesias > > wrote: > > > > > > Hello Bin, > > > > > > On [2020 Dec 04] Fri 18:52:50, Bin

Re: [PATCH v14 09/13] stream: skip filters when writing backing file name to QCOW2 header

2020-12-11 Thread Max Reitz
On 04.12.20 23:07, Vladimir Sementsov-Ogievskiy wrote: From: Andrey Shinkevich Avoid writing a filter JSON file name and a filter format name to QCOW2 image when the backing file is being changed after the block stream job. It can occur due to a concurrent commit job on the same backing chain.

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

2020-12-11 Thread Francisco Iglesias
Hello Bin, On [2020 Dec 11] Fri 14:07:21, Bin Meng wrote: > Hi Francisco, > > On Fri, Dec 4, 2020 at 7:28 PM Francisco Iglesias > wrote: > > > > Hello Bin, > > > > On [2020 Dec 04] Fri 18:52:50, Bin Meng wrote: > > > Hi Francisco, > > > > > > On Fri, Dec 4, 2020 at 6:46 PM Francisco Iglesias >

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

2020-12-11 Thread Max Reitz
On 04.12.20 23:07, Vladimir Sementsov-Ogievskiy wrote: 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

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

2020-12-11 Thread Vladimir Sementsov-Ogievskiy
11.12.2020 16:20, Max Reitz wrote: On 04.12.20 23:07, Vladimir Sementsov-Ogievskiy wrote: 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

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

2020-12-11 Thread Max Reitz
On 11.12.20 14:10, Vladimir Sementsov-Ogievskiy wrote: 11.12.2020 15:49, Max Reitz wrote: On 04.12.20 23:07, Vladimir Sementsov-Ogievskiy wrote: 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

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

2020-12-11 Thread Max Reitz
On 04.12.20 23:07, Vladimir Sementsov-Ogievskiy wrote: 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

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

2020-12-11 Thread Vladimir Sementsov-Ogievskiy
11.12.2020 15:49, Max Reitz wrote: On 04.12.20 23:07, Vladimir Sementsov-Ogievskiy wrote: 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

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

2020-12-11 Thread Max Reitz
On 04.12.20 23:07, Vladimir Sementsov-Ogievskiy wrote: 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 Reviewed-by: Vladimir Sementsov-Ogievskiy

Re: RFC: don't store backing filename in qcow2 image

2020-12-11 Thread Vladimir Sementsov-Ogievskiy
11.12.2020 12:44, Peter Krempa wrote: On Thu, Dec 10, 2020 at 17:26:52 +0300, Vladimir Sementsov-Ogievskiy wrote: Hi all! Hi, I have an idea, that not storing backing filename in qcow2 image at all may be a good thing. I'll give some reasons and want to know what do you think about it.

Re: [PATCH v14 05/13] qapi: create BlockdevOptionsCor structure for COR driver

2020-12-11 Thread Vladimir Sementsov-Ogievskiy
11.12.2020 11:54, Max Reitz wrote: On 10.12.20 19:30, Vladimir Sementsov-Ogievskiy wrote: 10.12.2020 20:43, Max Reitz wrote: I don’t like this patch’s subject very much, because I find the implementation of the @bottom option to be more noteworthy than the addition of the QAPI structure.

Re: RFC: don't store backing filename in qcow2 image

2020-12-11 Thread Peter Krempa
On Thu, Dec 10, 2020 at 17:26:52 +0300, Vladimir Sementsov-Ogievskiy wrote: > Hi all! Hi, > > I have an idea, that not storing backing filename in qcow2 image at all may > be a good thing. I'll give some reasons and want to know what do you think > about it. > > 1. Libvirt has to manage and

Re: [PATCH v14 05/13] qapi: create BlockdevOptionsCor structure for COR driver

2020-12-11 Thread Max Reitz
On 10.12.20 19:30, Vladimir Sementsov-Ogievskiy wrote: 10.12.2020 20:43, Max Reitz wrote: I don’t like this patch’s subject very much, because I find the implementation of the @bottom option to be more noteworthy than the addition of the QAPI structure. On 04.12.20 23:07, Vladimir