Re: [PATCH v2 0/2] fix crash if try to migrate during backup

2021-09-13 Thread Hanna Reitz
On 11.09.21 14:00, Vladimir Sementsov-Ogievskiy wrote: v2: 01: check that migration fails 02: Add Hanna's r-b Vladimir Sementsov-Ogievskiy (2): tests: add migrate-during-backup block: bdrv_inactivate_recurse(): check for permissions and fix crash block.c

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

2021-09-13 Thread Hanna Reitz
On 20.07.21 13:38, Vladimir Sementsov-Ogievskiy wrote: 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

Re: [PATCH v2 03/17] iotests: drop qemu_img_verbose() helper

2021-09-13 Thread Hanna Reitz
On 20.07.21 13:38, Vladimir Sementsov-Ogievskiy wrote: 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 Sem

Re: [PATCH v2 04/17] iotests.py: rewrite default luks support in qemu_img

2021-09-13 Thread Hanna Reitz
On 20.07.21 13:38, Vladimir Sementsov-Ogievskiy wrote: 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 --- tests/qemu-iotests/iotests.py | 36 +++

Re: [PATCH v2 06/17] iotest 065: explicit compression type

2021-09-13 Thread Hanna Reitz
On 20.07.21 13:38, Vladimir Sementsov-Ogievskiy wrote: 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 Se

Re: [PATCH v2] include/block.h: remove outdated comment

2021-09-13 Thread Kevin Wolf
Am 03.09.2021 um 13:38 hat Emanuele Giuseppe Esposito geschrieben: > There are a couple of errors in bdrv_drained_begin header comment: > - block_job_pause does not exist anymore, it has been replaced > with job_pause in b15de82867 > - job_pause is automatically invoked as a .drained_begin callba

Re: [PATCH v2 07/17] iotests.py: filter out successful output of qemu-img crate

2021-09-13 Thread Hanna Reitz
Subject: s/crate/create/ On 20.07.21 13:38, Vladimir Sementsov-Ogievskiy wrote: The only "feature" of this "Formatting ..." line is that we have to update it every time we add new option. Let's drop it. Sounds good to me. Signed-off-by: Vladimir Sementsov-Ogievskiy --- tests/qemu-iotests/

Re: [PATCH v2 08/17] iotests.py: filter compression type out

2021-09-13 Thread Hanna Reitz
On 20.07.21 13:38, Vladimir Sementsov-Ogievskiy wrote: 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

Re: [PATCH v2 14/17] iotests: bash tests: filter compression type

2021-09-13 Thread Hanna Reitz
On 20.07.21 13:38, Vladimir Sementsov-Ogievskiy wrote: 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 sp

[PATCH v2] vmdk: allow specification of tools version

2021-09-13 Thread Thomas Weißschuh
VMDK files support an attribute that represents the version of the guest tools that are installed on the disk. This attribute is used by vSphere before a machine has been started to determine if the VM has the guest tools installed. This is important when configuring "Operating system customization

Re: [RFC PATCH 3/4] include/sysemu/block-backend: split header into I/O and graph API

2021-09-13 Thread Stefan Hajnoczi
On Wed, Sep 08, 2021 at 09:10:20AM -0400, Emanuele Giuseppe Esposito wrote: > diff --git a/include/sysemu/block-backend-graph.h > b/include/sysemu/block-backend-graph.h > new file mode 100644 > index 00..3310987b16 > --- /dev/null > +++ b/include/sysemu/block-backend-graph.h > @@ -0,0 +1,1

[PATCH] qemu-img: Add -F shorthand to convert

2021-09-13 Thread Eric Blake
Although we have long supported 'qemu-img convert -o backing_file=foo,backing_fmt=bar', the fact that we have a shortcut -B for backing_file but none for backing_fmt has made it more likely that users accidentally run into: qemu-img: warning: Deprecated use of backing file without explicit backing

Re: [PATCH v2 17/17] iotests: declare lack of support for compresion_type in IMGOPTS

2021-09-13 Thread Hanna Reitz
On 20.07.21 13:38, Vladimir Sementsov-Ogievskiy wrote: 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 --- tests/qemu-iotests/031 | 5 +++-- tests/qemu-iotests/051 | 5 +++-- test

Re: [RFC PATCH 3/4] include/sysemu/block-backend: split header into I/O and graph API

2021-09-13 Thread Stefan Hajnoczi
On Wed, Sep 08, 2021 at 09:10:20AM -0400, Emanuele Giuseppe Esposito wrote: > +/* > + * Graph API. These functions run under the BQL lock. > + * > + * If a function modifies the graph, it uses drain and/or > + * aio_context_acquire/release to be sure it has unique access. > + * > + * All functions

Re: [RFC PATCH 0/4] block layer: split block APIs in graph and I/O

2021-09-13 Thread Stefan Hajnoczi
On Wed, Sep 08, 2021 at 09:10:17AM -0400, Emanuele Giuseppe Esposito wrote: > Currently, block layer APIs like block-backend.h contain a mix of > functions that are either running in the main loop and under the > BQL, or are thread-safe functions and run in iothreads performing I/O. > The functions

Re: [PATCH v2 04/17] iotests.py: rewrite default luks support in qemu_img

2021-09-13 Thread Vladimir Sementsov-Ogievskiy
13.09.2021 14:16, Hanna Reitz wrote: On 20.07.21 13:38, Vladimir Sementsov-Ogievskiy wrote: 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 ---   test

Re: [RFC PATCH 1/4] main-loop.h: introduce qemu_in_main_thread()

2021-09-13 Thread Stefan Hajnoczi
On Wed, Sep 08, 2021 at 09:10:18AM -0400, Emanuele Giuseppe Esposito wrote: > When invoked from the main loop, this function is the same > as qemu_mutex_iothread_locked, and returns true if the BQL is held. > When invoked from iothreads or tests, it returns true only > if the current AioContext is

Re: [RFC PATCH 2/4] migration: block-dirty-bitmap: add missing qemu_mutex_lock_iothread

2021-09-13 Thread Stefan Hajnoczi
On Wed, Sep 08, 2021 at 09:10:19AM -0400, Emanuele Giuseppe Esposito wrote: > init_dirty_bitmap_migration assumes the iothread lock (BQL) > to be held, but instead it isn't. > > Instead of adding the lock to qemu_savevm_state_setup(), > follow the same pattern as the other ->save_setup callbacks >

Re: [RFC PATCH 0/4] block layer: split block APIs in graph and I/O

2021-09-13 Thread Stefan Hajnoczi
Thanks, marking block layers APIs that require the BQL and those that don't is an important step. I have posted comments. Stefan signature.asc Description: PGP signature

Re: [RFC PATCH 4/4] block/block-backend.c: assertions for block-backend

2021-09-13 Thread Stefan Hajnoczi
On Wed, Sep 08, 2021 at 09:10:21AM -0400, Emanuele Giuseppe Esposito wrote: > @@ -1767,12 +1817,14 @@ void blk_drain_all(void) > void blk_set_on_error(BlockBackend *blk, BlockdevOnError on_read_error, >BlockdevOnError on_write_error) > { > +g_assert(qemu_in_main_thread

Re: [PATCH 2/4] hw/sd: add nuvoton MMC

2021-09-13 Thread Peter Maydell
On Wed, 8 Sept 2021 at 00:26, Hao Wu wrote: > > From: Shengtan Mao > > Signed-off-by: Shengtan Mao > Reviewed-by: Hao Wu > Reviewed-by: Chris Rauer > Reviewed-by: Tyrone Ting > --- > hw/arm/npcm7xx.c | 12 +++- > hw/sd/meson.build | 1 + > hw/sd/npcm7xx_sdhci.c

Re: [PATCH 3/4] hw/arm: Attach MMC to quanta-gbs-bmc

2021-09-13 Thread Peter Maydell
On Wed, 8 Sept 2021 at 00:26, Hao Wu wrote: > > From: Shengtan Mao > > Signed-off-by: Shengtan Mao > Reviewed-by: Hao Wu > Reviewed-by: Tyrone Ting > --- > hw/arm/npcm7xx_boards.c | 21 + > 1 file changed, 21 insertions(+) > > diff --git a/hw/arm/npcm7xx_boards.c b/hw/arm/

Re: [PATCH v2 1/3] simplebench: add img_bench_templater.py

2021-09-13 Thread Hanna Reitz
On 24.08.21 12:15, Vladimir Sementsov-Ogievskiy wrote: Add simple grammar-parsing template benchmark. New tool consume test template written in bash with some special grammar injections and produces multiple tests, run them and finally print a performance comparison table of different tests produ

Re: [PATCH 4/4] tests/qtest: add qtests for npcm7xx sdhci

2021-09-13 Thread Peter Maydell
On Wed, 8 Sept 2021 at 00:26, Hao Wu wrote: > > From: Shengtan Mao > > Signed-off-by: Shengtan Mao > Reviewed-by: Hao Wu > Reviewed-by: Chris Rauer > Reviewed-by: Tyrone Ting > --- > tests/qtest/meson.build | 1 + > tests/qtest/npcm7xx_sdhci-test.c | 201 ++

Re: [PATCH 1/4] tests/qtest/libqos: add SDHCI commands

2021-09-13 Thread Peter Maydell
On Wed, 8 Sept 2021 at 00:26, Hao Wu wrote: > > From: Shengtan Mao > > Signed-off-by: Shengtan Mao > Reviewed-by: Hao Wu > Reviewed-by: Chris Rauer > Reviewed-by: Tyrone Ting I think this patch would make more sense placed later in the series, just before the current patch 4 which is the use

Re: [PATCH v2 3/3] qcow2: handle_dependencies(): relax conflict detection

2021-09-13 Thread Hanna Reitz
On 24.08.21 12:15, Vladimir Sementsov-Ogievskiy wrote: There is no conflict and no dependency if we have parallel writes to different subclusters of one cluster when the cluster itself is already allocated. So, relax extra dependency. Measure performance: First, prepare build/qemu-img-old and bu

Re: [PATCH v2 0/3] qcow2: relax subclusters allocation dependencies

2021-09-13 Thread Hanna Reitz
On 24.08.21 12:15, Vladimir Sementsov-Ogievskiy wrote: Hi all! v2: 01: improve documentation 02: add Hanna's and Eric's r-bs, add tiny grammar fix 03: fix test by filtering instead of reducing number of writes Thanks, I’ve fixed the typo in patch 3 and applied the series to my block branch:

Re: [PATCH] nbd/server: Suppress Broken pipe errors on abrupt disconnection

2021-09-13 Thread Kevin Wolf
Am 23.07.2021 um 17:49 hat Eric Blake geschrieben: > On Thu, Jul 22, 2021 at 11:45:52AM +0100, Richard W.M. Jones wrote: > > $ rm -f /tmp/sock /tmp/pid > > $ qemu-img create -f qcow2 /tmp/disk.qcow2 1M > > $ qemu-nbd -t --format=qcow2 --socket=/tmp/sock --pid-file=/tmp/pid > > /tmp/disk.qcow2 & >

Re: [PATCH v3 01/10] qcow2-refcount: improve style of check_refcounts_l2()

2021-09-13 Thread Hanna Reitz
On 24.05.21 16:20, Vladimir Sementsov-Ogievskiy wrote: - don't use same name for size in bytes and in entries - use g_autofree for l2_table - add whitespace - fix block comment style Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Eric Blake --- block/qcow2-refcount.c | 47 +

Re: [PATCH v3 02/10] qcow2: compressed read: simplify cluster descriptor passing

2021-09-13 Thread Hanna Reitz
On 24.05.21 16:20, Vladimir Sementsov-Ogievskiy wrote: Let's pass the whole L2 entry and not bother with L2E_COMPRESSED_OFFSET_SIZE_MASK. It also helps further refactoring that adds generic qcow2_parse_compressed_l2_entry() helper. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Eric

Re: [PATCH] nbd/server: Suppress Broken pipe errors on abrupt disconnection

2021-09-13 Thread Richard W.M. Jones
On Mon, Sep 13, 2021 at 05:07:12PM +0200, Kevin Wolf wrote: > > > if (ret < 0) { > > > -error_prepend(&local_err, "Failed to send reply: "); > > > +if (errno != EPIPE) { > > > +error_prepend(&local_err, "Failed to send reply: "); > > > +} else { > > > +

[PATCH v2] nbd/server: Suppress Broken pipe errors on abrupt disconnection

2021-09-13 Thread Richard W.M. Jones
$ rm -f /tmp/sock /tmp/pid $ qemu-img create -f qcow2 /tmp/disk.qcow2 1M $ qemu-nbd -t --format=qcow2 --socket=/tmp/sock --pid-file=/tmp/pid /tmp/disk.qcow2 & $ nbdsh -u 'nbd+unix:///?socket=/tmp/sock' -c 'h.get_size()' qemu-nbd: Disconnect client, due to: Failed to send reply: Unable to write to

Re: [PATCH v3 03/10] qcow2: introduce qcow2_parse_compressed_l2_entry() helper

2021-09-13 Thread Hanna Reitz
On 24.05.21 16:20, Vladimir Sementsov-Ogievskiy wrote: Add helper to parse compressed l2_entry and use it everywhere instead of open-coding. Note, that in most places we move to precise coffset/csize instead of sector-aligned. Still it should work good enough for updating refcounts. Signed-off-

Re: [PATCH v3 04/10] qcow2-refcount: introduce fix_l2_entry_by_zero()

2021-09-13 Thread Hanna Reitz
On 24.05.21 16:20, Vladimir Sementsov-Ogievskiy wrote: Split fix_l2_entry_by_zero() out of check_refcounts_l2() to be reused in further patch. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Eric Blake --- block/qcow2-refcount.c | 87 +- 1 fi

Re: [PATCH v2 17/17] iotests: declare lack of support for compresion_type in IMGOPTS

2021-09-13 Thread Vladimir Sementsov-Ogievskiy
13.09.2021 15:43, Hanna Reitz wrote: On 20.07.21 13:38, Vladimir Sementsov-Ogievskiy wrote: 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 ---   tests/qemu-iotests/031 | 5 +++--   t