[libnbd PATCH 11/13] api: Add three functions for controlling extended headers

2021-12-03 Thread Eric Blake
The new NBD_OPT_EXTENDED_HEADERS feature is worth using by default, but there may be cases where the user explicitly wants to stick with the older 32-bit headers. nbd_set_request_extended_headers() will let the client override the default, nbd_get_request_extended_headers() determines the current

[libnbd PATCH 10/13] api: Add [aio_]nbd_block_status_64

2021-12-03 Thread Eric Blake
Overcome the inherent 32-bit limitation of our existing nbd_block_status command by adding a 64-bit variant. The command sent to the server does not change, but the user's callback is now handed 64-bit information regardless of whether the server replies with 32- or 64-bit extents. Unit tests

[libnbd PATCH 12/13] generator: Actually request extended headers

2021-12-03 Thread Eric Blake
This is the culmination of the previous patches preparation work for using extended headers when possible. The new states in the state machine are copied extensively from our handling of OPT_STRUCTURED_REPLY. At the same time I posted this patch, I had patches for qemu-nbd to support extended

[libnbd PATCH 03/13] protocol: Add definitions for extended headers

2021-12-03 Thread Eric Blake
Add the magic numbers and new structs necessary to implement the NBD protocol extension of extended headers providing 64-bit lengths. --- lib/nbd-protocol.h | 61 ++ 1 file changed, 51 insertions(+), 10 deletions(-) diff --git a/lib/nbd-protocol.h

[libnbd PATCH 13/13] interop: Add test of 64-bit block status

2021-12-03 Thread Eric Blake
Prove that we can round-trip a block status request larger than 4G through a new-enough qemu-nbd. Also serves as a unit test of our shim for converting internal 64-bit representation back to the older 32-bit nbd_block_status callback interface. --- interop/Makefile.am | 6 ++

[libnbd PATCH 05/13] protocol: Prepare to receive 64-bit replies

2021-12-03 Thread Eric Blake
Support receiving headers for 64-bit replies if extended headers were negotiated. We already insist that the server not send us too much payload in one reply, so we can exploit that and merge the 64-bit length back into a normalized 32-bit field for the rest of the payload length calculations.

[libnbd PATCH 09/13] block_status: Accept 64-bit extents during block status

2021-12-03 Thread Eric Blake
Support a server giving us a 64-bit extent. Note that the protocol says a server should not give a 64-bit answer when extended headers are not negotiated, but since the client's size is merely a hint, it is possible for a server to have a 64-bit answer even when the original query was 32 bits.

[libnbd PATCH 07/13] generator: Add struct nbd_extent in prep for 64-bit extents

2021-12-03 Thread Eric Blake
The existing nbd_block_status() callback is permanently stuck with an array of uint32_t pairs (len/2 extents), and exposing 64-bit extents requires a new API. Before we get there, we first need a way to express a struct containing uint64_t length and uint32_t flags across the various language

[libnbd PATCH 04/13] protocol: Prepare to send 64-bit requests

2021-12-03 Thread Eric Blake
Support sending 64-bit requests if extended headers were negotiated. At this point, h->extended_headers is permanently false (we can't enable it until all other aspects of the protocol have likewise been converted). --- lib/internal.h | 12 ---

[libnbd PATCH 02/13] block_status: Refactor array storage

2021-12-03 Thread Eric Blake
For 32-bit block status, we were able to cheat and use an array with an odd number of elements, with array[0] holding the context id, and passing [1] to the user's callback. But once we have 64-bit extents, we can no longer abuse array element 0 like that. Split out a new state to receive the

[PATCH 12/14] nbd/client: Accept 64-bit block status chunks

2021-12-03 Thread Eric Blake
Because we use NBD_CMD_FLAG_REQ_ONE with NBD_CMD_BLOCK_STATUS, a client in narrow mode should not be able to provoke a server into sending a block status result larger than the client's 32-bit request. But in extended mode, a 64-bit status request must be able to handle a 64-bit status result,

[PATCH 13/14] nbd/client: Request extended headers during negotiation

2021-12-03 Thread Eric Blake
All the pieces are in place for a client to finally request extended headers. Note that we must not request extended headers when qemu-nbd is used to connect to the kernel module (as nbd.ko does not expect them), but there is no harm in all other clients requesting them. Extended headers do not

[libnbd PATCH 01/13] golang: Simplify nbd_block_status callback array copy

2021-12-03 Thread Eric Blake
In the block status callback glue code, we need to copy a C uint32_t[] into a golang []uint32. The copy is necessary since the lifetime of the C array is not guaranteed to outlive whatever the Go callback may have done with what it was handed; copying ensures that the user's Go code doesn't have

[libnbd PATCH 08/13] block_status: Track 64-bit extents internally

2021-12-03 Thread Eric Blake
When extended headers are in use, the server can send us 64-bit extents, even for a 32-bit query (if the server knows the entire image is data, for example). For maximum flexibility, we are thus better off storing 64-bit lengths internally, even if we have to convert it back to 32-bit lengths

[libnbd PATCH 06/13] protocol: Accept 64-bit holes during pread

2021-12-03 Thread Eric Blake
Even though we don't allow the user to request NBD_CMD_READ with more than 64M (and even if we did, our API signature caps us at SIZE_MAX, which is 32 bits on a 32-bit machine), the NBD extension to allow 64-bit requests implies that for symmetry we have to be able to support 64-bit holes over the

[libnbd PATCH 00/13] libnbd patches for NBD_OPT_EXTENDED_HEADERS

2021-12-03 Thread Eric Blake
Available here: https://repo.or.cz/libnbd/ericb.git/shortlog/refs/tags/exthdr-v1 I also want to do followup patches to teach 'nbdinfo --map' and 'nbdcopy' to utilize 64-bit extents. Eric Blake (13): golang: Simplify nbd_block_status callback array copy block_status: Refactor array storage

[PATCH 14/14] do not apply: nbd/server: Send 64-bit hole chunk

2021-12-03 Thread Eric Blake
Since we cap NBD_CMD_READ requests to 32M, we never have a reason to send a 64-bit chunk type for a hole; but it is worth producing these for interoperability testing of clients that want extended headers. --- nbd/server.c | 18 ++ 1 file changed, 14 insertions(+), 4 deletions(-)

[PATCH 10/14] nbd/client: Initial support for extended headers

2021-12-03 Thread Eric Blake
Update the client code to be able to send an extended request, and parse an extended header from the server. Note that since we reject any structured reply with a too-large payload, we can always normalize a valid header back into the compact form, so that the caller need not deal with two

[PATCH 11/14] nbd/client: Accept 64-bit hole chunks

2021-12-03 Thread Eric Blake
Although our read requests are sized such that servers need not send an extended hole chunk, we still have to be prepared for it to be fully compliant if we request extended headers. We can also tolerate a non-compliant server sending the new chunk even when it should not. Signed-off-by: Eric

[PATCH 09/14] nbd/server: Support 64-bit block status

2021-12-03 Thread Eric Blake
The previous patch handled extended headers by truncating large block status requests from the client back to 32 bits. But this is not ideal; for cases where we can truly determine the status of the entire image quickly (for example, when reporting the entire image as non-sparse because we lack

[PATCH 05/14] nbd/server: Prepare for alternate-size headers

2021-12-03 Thread Eric Blake
An upcoming NBD extension wants to add the ability to do 64-bit requests. As part of that extension, the size of the reply headers will change in order to permit a 64-bit length in the reply for symmetry [*]. Additionally, where the reply header is currently 16 bytes for simple reply, and 20

[PATCH 07/14] nbd: Add types for extended headers

2021-12-03 Thread Eric Blake
Add the constants and structs necessary for later patches to start implementing the NBD_OPT_EXTENDED_HEADERS extension in both the client and server. This patch does not change any existing behavior, but merely sets the stage. This patch does not change the status quo that neither the client nor

[PATCH 08/14] nbd/server: Initial support for extended headers

2021-12-03 Thread Eric Blake
We have no reason to send NBD_REPLY_TYPE_OFFSET_HOLE_EXT since we already cap NBD_CMD_READ to 32M. For NBD_CMD_WRITE_ZEROES and NBD_CMD_TRIM, the block layer already supports 64-bit operations without any effort on our part. For NBD_CMD_BLOCK_STATUS, the client's length is a hint; the easiest

[PATCH 06/14] nbd: Prepare for 64-bit requests

2021-12-03 Thread Eric Blake
Widen the length field of NBDRequest to 64-bits, although we can assert that all current uses are still under 32 bits. Move the request magic number to nbd.h, to live alongside the reply magic number. Add a bool that will eventually track whether the client successfully negotiated extended

[PATCH 04/14] nbd/client: Add safety check on chunk payload length

2021-12-03 Thread Eric Blake
Our existing use of structured replies either reads into a qiov capped at 32M (NBD_CMD_READ) or caps allocation to 1000 bytes (see NBD_MAX_MALLOC_PAYLOAD in block/nbd.c). But the existing length checks are rather late; if we encounter a buggy (or malicious) server that sends a super-large payload

[PATCH 01/14] nbd/server: Minor cleanups

2021-12-03 Thread Eric Blake
Spelling fixes, grammar improvements and consistent spacing, noticed while preparing other patches in this file. Signed-off-by: Eric Blake --- nbd/server.c | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/nbd/server.c b/nbd/server.c index

[PATCH 00/14] qemu patches for NBD_OPT_EXTENDED_HEADERS

2021-12-03 Thread Eric Blake
Available at https://repo.or.cz/qemu/ericb.git/shortlog/refs/tags/exthdr-v1 Patch 14 is optional; I'm including it now because I tested with it, but I'm also okay with dropping it based on RFC discussion. Eric Blake (14): nbd/server: Minor cleanups qemu-io: Utilize 64-bit status during map

[PATCH 03/14] qemu-io: Allow larger write zeroes under no fallback

2021-12-03 Thread Eric Blake
When writing zeroes can fall back to a slow write, permitting an overly large request can become an amplification denial of service attack in triggering a large amount of work from a small request. But the whole point of the no fallback flag is to quickly determine if writing an entire device to

[PATCH 02/14] qemu-io: Utilize 64-bit status during map

2021-12-03 Thread Eric Blake
The block layer has supported 64-bit block status from drivers since commit 86a3d5c688 ("block: Add .bdrv_co_block_status() callback", v2.12) and friends, with individual driver callbacks responsible for capping things where necessary. Artificially capping things below 2G in the qemu-io 'map'

[PATCH] spec: Add NBD_OPT_EXTENDED_HEADERS

2021-12-03 Thread Eric Blake
Add a new negotiation feature where the client and server agree to use larger packet headers on every packet sent during transmission phase. This has two purposes: first, it makes it possible to perform operations like trim, write zeroes, and block status on more than 2^32 bytes in a single

RFC for NBD protocol extension: extended headers

2021-12-03 Thread Eric Blake
In response to this mail, I will be cross-posting a series of patches to multiple projects as a proof-of-concept implementation and request for comments on a new NBD protocol extension, called NBD_OPT_EXTENDED_HEADERS. With this in place, it will be possible for clients to request 64-bit zero,

Re: [RFC PATCH 2/2] qemu-img convert: Fix sparseness detection

2021-12-03 Thread Vladimir Sementsov-Ogievskiy
03.12.2021 14:17, Peter Lieven wrote: Am 19.05.21 um 18:48 schrieb Kevin Wolf: Am 19.05.2021 um 15:24 hat Peter Lieven geschrieben: Am 20.04.21 um 18:52 schrieb Vladimir Sementsov-Ogievskiy: 20.04.2021 18:04, Kevin Wolf wrote: Am 20.04.2021 um 16:31 hat Vladimir Sementsov-Ogievskiy

[PATCH 07/14] block: document connection between child roles and bs->backing/bs->file

2021-12-03 Thread Vladimir Sementsov-Ogievskiy
Make the informal rules formal. In further commit we'll add corresponding assertions. Signed-off-by: Vladimir Sementsov-Ogievskiy --- include/block/block.h | 42 ++ 1 file changed, 42 insertions(+) diff --git a/include/block/block.h

[PATCH 14/14] block/snapshot: drop indirection around bdrv_snapshot_fallback_ptr

2021-12-03 Thread Vladimir Sementsov-Ogievskiy
Now the indirection is not actually used, we can safely reduce it to simple pointer. Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/snapshot.c | 39 +-- 1 file changed, 17 insertions(+), 22 deletions(-) diff --git a/block/snapshot.c b/block/snapshot.c

[PATCH 08/14] block/snapshot: stress that we fallback to primary child

2021-12-03 Thread Vladimir Sementsov-Ogievskiy
Actually what we chose is a primary child. Let's stress it in the code. We are going to drop indirect pointer logic here in future. Actually this commit simplifies the future work: we drop use of indirection in the assertion now. Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/snapshot.c

[PATCH 06/14] test-bdrv-graph-mod: fix filters to be filters

2021-12-03 Thread Vladimir Sementsov-Ogievskiy
bdrv_pass_through is used as filter, even all node variables has corresponding names. We want to append it, so it should be backing-child-based filter like mirror_top. So, in test_update_perm_tree, first child should be DATA, as we don't want filters with two filtered children.

[PATCH 12/14] Revert "block: Pass BdrvChild ** to replace_child_noperm"

2021-12-03 Thread Vladimir Sementsov-Ogievskiy
That's a preparation to previously reverted "block: Let replace_child_noperm free children". Drop it too, we don't need it for a new approach. This reverts commit be64bbb0149748f3999c49b13976aafb8330ea86. Signed-off-by: Vladimir Sementsov-Ogievskiy --- block.c | 23 +++ 1

[PATCH 04/14] test-bdrv-graph-mod: update test_parallel_perm_update test case

2021-12-03 Thread Vladimir Sementsov-Ogievskiy
test_parallel_perm_update() does two things that we are going to restrict in the near future: 1. It updates bs->file field by hand. bs->file will be managed automatically by generic code (together with bs->children list). Let's better refactor our "tricky" bds to have own state where one

[PATCH 03/14] block/blklogwrites: don't care to remove bs->file child on failure

2021-12-03 Thread Vladimir Sementsov-Ogievskiy
We don't need to remove bs->file, generic layer takes care of it. No other driver cares to remove bs->file on failure by hand. Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/blklogwrites.c | 4 1 file changed, 4 deletions(-) diff --git a/block/blklogwrites.c b/block/blklogwrites.c

[PATCH 02/14] block: introduce bdrv_open_file_child() helper

2021-12-03 Thread Vladimir Sementsov-Ogievskiy
Almost all drivers call bdrv_open_child() similarly. Let's create a helper for this. The only not updated driver that call bdrv_open_child() to set bs->file is raw-format, as it sometimes want to have filtered child but don't set drv->is_filter to true. Possibly we should implement

[PATCH 13/14] block: Manipulate bs->file / bs->backing pointers in .attach/.detach

2021-12-03 Thread Vladimir Sementsov-Ogievskiy
bs->file and bs->backing are a kind of duplication of part of bs->children. But very useful diplication, so let's not drop them at all:) We should manage bs->file and bs->backing in same place, where we manage bs->children, to keep them in sync. Moreover, generic io paths are unprepared to

[PATCH 05/14] tests-bdrv-drain: bdrv_replace_test driver: declare supports_backing

2021-12-03 Thread Vladimir Sementsov-Ogievskiy
We do add COW child to the node. In future we are going to forbid adding COW child to the node that doesn't support backing. So, fix it here now. Don't worry about setting bs->backing itself: it further commit we'll update the block-layer to automatically set/unset this field in generic code.

[PATCH 11/14] Revert "block: Restructure remove_file_or_backing_child()"

2021-12-03 Thread Vladimir Sementsov-Ogievskiy
That's a preparation to previously reverted "block: Let replace_child_noperm free children". Drop it too, we don't need it for a new approach. This reverts commit 562bda8bb41879eeda0bd484dd3d55134579b28e. Signed-off-by: Vladimir Sementsov-Ogievskiy --- block.c | 21 + 1

[PATCH 09/14] Revert "block: Let replace_child_noperm free children"

2021-12-03 Thread Vladimir Sementsov-Ogievskiy
We are going to reimplement this behavior (clear bs->file / bs->backing pointers automatically when child->bs is cleared) in a nicer way. This reverts commit b0a9f6fed3d80de610dcd04a7e66f9f30a04174f. Signed-off-by: Vladimir Sementsov-Ogievskiy --- block.c | 102

[PATCH 10/14] Revert "block: Let replace_child_tran keep indirect pointer"

2021-12-03 Thread Vladimir Sementsov-Ogievskiy
That's a preparation to previously reverted "block: Let replace_child_noperm free children". Drop it too, we don't need it for a new approach. This reverts commit 82b54cf51656bf3cd5ed1ac549e8a1085a0e3290. Signed-off-by: Vladimir Sementsov-Ogievskiy --- block.c | 83

[PATCH 00/14] block: cleanup backing and file handling

2021-12-03 Thread Vladimir Sementsov-Ogievskiy
Hi all! I started this as a follow-up to "block: Attempt on fixing 030-reported errors" by Hanna. In Hanna's series I really like how bs->children handling moved to .attach/.detach handlers. .file and .backing are kind of "shortcuts" or "links" to some elementes of this list, they duplicate the

[PATCH 01/14] block: BlockDriver: add .filtered_child_is_backing field

2021-12-03 Thread Vladimir Sementsov-Ogievskiy
Unfortunately not all filters use .file child as filtered child. Two exclusions are mirror_top and commit_top. Happily they both are private filters. Bad thing is that this inconsistency is observable through qmp commands query-block / query-named-block-nodes. So, could we just change mirror_top

[PATCH v4 12/19] iotests: massive use _qcow2_dump_header

2021-12-03 Thread Vladimir Sementsov-Ogievskiy
We are going to add filtering in _qcow2_dump_header and want all tests use it. The patch is generated by commands: cd tests/qemu-iotests sed -ie 's/$PYTHON qcow2.py "$TEST_IMG" dump-header\($\| \)/_qcow2_dump_header\1/' ??? tests/* (the difficulty is to avoid converting dump-header-exts)

[PATCH v4 01/19] iotests.py: img_info_log(): rename imgopts argument

2021-12-03 Thread Vladimir Sementsov-Ogievskiy
We are going to support IMGOPTS environment variable like in bash tests. Corresponding global variable in iotests.py should be called imgopts. So to not interfere with function argument, rename it in advance. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz ---

[PATCH v4 06/19] iotest 065: explicit compression type

2021-12-03 Thread Vladimir Sementsov-Ogievskiy
The test checks different options. It of course fails if set IMGOPTS='compression_type=zstd'. So, let's be explicit in what compression type we want and independent of IMGOPTS. Test both existing compression types. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Hanna Reitz ---

[PATCH v4 15/19] iotests 60: more accurate set dirty bit in qcow2 header

2021-12-03 Thread Vladimir Sementsov-Ogievskiy
Don't touch other incompatible bits, like compression-type. This makes the test pass with IMGOPTS='compression_type=zstd'. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- tests/qemu-iotests/060 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH v4 16/19] iotest 214: explicit compression type

2021-12-03 Thread Vladimir Sementsov-Ogievskiy
The test-case "Corrupted size field in compressed cluster descriptor" heavily depends on zlib compression type. So, make it explicit. This way test passes with IMGOPTS='compression_type=zstd'. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- tests/qemu-iotests/214 | 2 +-

[PATCH v4 13/19] iotest 39: use _qcow2_dump_header

2021-12-03 Thread Vladimir Sementsov-Ogievskiy
_qcow2_dump_header has filter for compression type, so this change makes test pass with IMGOPTS='compression_type=zstd'. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- tests/qemu-iotests/039 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH v4 14/19] iotests: bash tests: filter compression type

2021-12-03 Thread Vladimir Sementsov-Ogievskiy
We want iotests pass with both the default zlib compression and with IMGOPTS='compression_type=zstd'. Actually the only test that is interested in real compression type in test output is 287 (test for qcow2 compression type), so implement specific option for it. Signed-off-by: Vladimir

[PATCH v4 04/19] iotests.py: rewrite default luks support in qemu_img

2021-12-03 Thread Vladimir Sementsov-Ogievskiy
Move the logic to more generic qemu_img_pipe_and_status(). Also behave better when we have several -o options. And reuse argument parser of course. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Hanna Reitz --- tests/qemu-iotests/iotests.py | 36 +-- 1

[PATCH v4 19/19] iotests: specify some unsupported_imgopts for python iotests

2021-12-03 Thread Vladimir Sementsov-Ogievskiy
We support IMGOPTS for python iotests now. Still a lot of tests are unprepared to common IMGOPTS that are used with bash iotests. So we should define corresponding unsupported_imgopts. Signed-off-by: Vladimir Sementsov-Ogievskiy --- tests/qemu-iotests/044 | 3 ++-

[PATCH v4 10/19] qcow2: simple case support for downgrading of qcow2 images with zstd

2021-12-03 Thread Vladimir Sementsov-Ogievskiy
If image doesn't have any compressed cluster we can easily switch to zlib compression, which may allow to downgrade the image. That's mostly needed to support IMGOPTS='compression_type=zstd' in some iotests which do qcow2 downgrade. While being here also fix checkpatch complain against '#' in

[PATCH v4 11/19] iotests/common.rc: introduce _qcow2_dump_header helper

2021-12-03 Thread Vladimir Sementsov-Ogievskiy
We'll use it in tests instead of explicit qcow2.py. Then we are going to add some filtering in _qcow2_dump_header. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- tests/qemu-iotests/common.rc | 10 ++ 1 file changed, 10 insertions(+) diff --git

[PATCH v4 09/19] iotest 302: use img_info_log() helper

2021-12-03 Thread Vladimir Sementsov-Ogievskiy
Instead of qemu_img_log("info", ..) use generic helper img_info_log(). img_info_log() has smarter logic. For example it use filter_img_info() to filter output, which in turns filter a compression type. So it will help us in future when we implement a possibility to use zstd compression by default

[PATCH v4 07/19] iotests.py: filter out successful output of qemu-img create

2021-12-03 Thread Vladimir Sementsov-Ogievskiy
The only "feature" of this "Formatting ..." line is that we have to update it every time we add new option. Let's drop it. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Hanna Reitz --- tests/qemu-iotests/149.out| 21 - tests/qemu-iotests/237.out| 3 ---

[PATCH v4 17/19] iotests: declare lack of support for compresion_type in IMGOPTS

2021-12-03 Thread Vladimir Sementsov-Ogievskiy
compression_type can't be used if we want to create image with compat=0.10. So, skip these tests, not many of them. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Hanna Reitz --- tests/qemu-iotests/031 | 5 +++-- tests/qemu-iotests/051 | 5 +++-- tests/qemu-iotests/061 | 6 +-

[PATCH v4 05/19] iotest 303: explicit compression type

2021-12-03 Thread Vladimir Sementsov-Ogievskiy
The test prints qcow2 header fields which depends on chosen compression type. So, let's be explicit in what compression type we want and independent of IMGOPTS. Test both existing compression types. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- tests/qemu-iotests/303

[PATCH v4 02/19] iotests.py: qemu_img*("create"): support IMGOPTS='compression_type=zstd'

2021-12-03 Thread Vladimir Sementsov-Ogievskiy
Adding support of IMGOPTS (like in bash tests) allows user to pass a lot of different options. Still, some may require additional logic. Now we want compression_type option, so add some smart logic around it: ignore compression_type=zstd in IMGOPTS, if test want qcow2 in compatibility mode. As

[PATCH v4 08/19] iotests.py: filter compression type out

2021-12-03 Thread Vladimir Sementsov-Ogievskiy
We want iotests pass with both the default zlib compression and with IMGOPTS='compression_type=zstd'. Actually the only test that is interested in real compression type in test output is 287 (test for qcow2 compression type) and it's in bash. So for now we can safely filter out compression type

[PATCH v4 00/19] iotests: support zstd

2021-12-03 Thread Vladimir Sementsov-Ogievskiy
These series makes tests pass with IMGOPTS='compression_type=zstd' Also, python iotests start to support IMGOPTS (they didn't before). v4: 18,19: new: add unsupported_imgopts as suggested by Hanna. Vladimir Sementsov-Ogievskiy (19): iotests.py: img_info_log(): rename imgopts argument

[PATCH v4 18/19] iotests.py: implement unsupported_imgopts

2021-12-03 Thread Vladimir Sementsov-Ogievskiy
We have added support for some addition IMGOPTS in python iotests like in bash iotests. Similarly to bash iotests, we want a way to skip some tests which can't work with specific IMGOPTS. Globally for python iotests we now don't support things like 'data_file=$TEST_IMG.ext_data_file' in IMGOPTS,

[PATCH v4 03/19] iotests: drop qemu_img_verbose() helper

2021-12-03 Thread Vladimir Sementsov-Ogievskiy
qemu_img_verbose() has a drawback of not going through generic qemu_img_pipe_and_status(). qemu_img_verbose() is not very popular, so update the only two users to qemu_img_log() and drop qemu_img_verbose() at all. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Hanna Reitz ---

[PATCH 2/3] iotests/testrunner.py: move updating last_elapsed to run_tests

2021-12-03 Thread Vladimir Sementsov-Ogievskiy
We are going to use do_run_test() in multiprocessing environment, where we'll not be able to change original runner object. Happily, the only thing we change is that last_elapsed and it's simple to do it in run_tests() instead. All other accesses to self in do_runt_test() and in run_test() are

[PATCH 3/3] iotests: check: multiprocessing support

2021-12-03 Thread Vladimir Sementsov-Ogievskiy
Add -j parameter, to run tests in several jobs simultaneously. For realization - simply utilize multiprocessing.Pool class. Notes: 1. Of course, tests can't run simultaneously in same TEST_DIR. So, use subdirectories TEST_DIR/testname/ and SOCK_DIR/testname/ instead of simply TEST_DIR and

[PATCH 1/3] iotests/testrunner.py: add doc string for run_test()

2021-12-03 Thread Vladimir Sementsov-Ogievskiy
We are going to modify these methods and will add more documentation in further commit. As a preparation add basic documentation. Signed-off-by: Vladimir Sementsov-Ogievskiy --- tests/qemu-iotests/testrunner.py | 13 + 1 file changed, 13 insertions(+) diff --git

[PATCH 0/3] iotests: multiprocessing!!

2021-12-03 Thread Vladimir Sementsov-Ogievskiy
Hi all! Finally, I can not stand it any longer. So, I'm happy to present multiprocessing support for iotests test runner. testing on tmpfs: Before: time check -qcow2 ... real12m28.095s user9m53.398s sys 2m55.548s After: time check -qcow2 -j 12 ... real2m12.136s user

Re: [RFC PATCH 2/2] qemu-img convert: Fix sparseness detection

2021-12-03 Thread Peter Lieven
Am 19.05.21 um 18:48 schrieb Kevin Wolf: > Am 19.05.2021 um 15:24 hat Peter Lieven geschrieben: >> Am 20.04.21 um 18:52 schrieb Vladimir Sementsov-Ogievskiy: >>> 20.04.2021 18:04, Kevin Wolf wrote: Am 20.04.2021 um 16:31 hat Vladimir Sementsov-Ogievskiy geschrieben: > 15.04.2021 18:22,