Re: [Qemu-block] [PATCH 5/5] nbd/server: refactor nbd_trip: split out nbd_handle_request

2018-03-09 Thread Eric Blake
On 03/08/2018 12:46 PM, Vladimir Sementsov-Ogievskiy wrote: Split out request handling logic. Signed-off-by: Vladimir Sementsov-Ogievskiy --- nbd/server.c | 129 +++ 1 file changed, 67 insertions(+), 62

Re: [Qemu-block] [PATCH 4/5] nbd/server: refactor nbd_trip: cmd_read and generic reply

2018-03-09 Thread Eric Blake
On 03/08/2018 12:46 PM, Vladimir Sementsov-Ogievskiy wrote: nbd_trip has difficult logic of sending reply: it tries to use one code path for all replies. It is ok for simple replies, but is not comfortable for structured replies. Also, two types of error (and corresponding message in local_err)

[Qemu-block] [PATCH 4/5] block/blkreplay: Remove protocol-related fields

2018-03-09 Thread Fabiano Rosas
The blkreplay driver is not a protocol so it should implement bdrv_open instead of bdrv_file_open and not provide a protocol_name. Attempts to invoke this driver using protocol syntax (i.e. blkreplay:) will now fail gracefully: $ qemu-img info blkreplay:foo qemu-img: Could not open

[Qemu-block] [PATCH 3/5] block/throttle: Remove protocol-related fields

2018-03-09 Thread Fabiano Rosas
The throttle driver is not a protocol so it should implement bdrv_open instead of bdrv_file_open and not provide a protocol_name. Attempts to invoke this driver using protocol syntax (i.e. throttle:) will now fail gracefully: $ qemu-img info throttle:foo qemu-img: Could not open

[Qemu-block] [PATCH 1/5] block/replication: Remove protocol_name field

2018-03-09 Thread Fabiano Rosas
The replication driver is only selected explicitly (via driver=replication,mode=primary,...) so it is not a protocol driver. This patch removes the protocol_name field from the brdv_replication structure so that attempts to invoke this driver using protocol syntax (i.e. replication:) will fail

[Qemu-block] [PATCH 0/5] block: Ensure non-protocol drivers can only be selected explicitly

2018-03-09 Thread Fabiano Rosas
Block drivers can be selected by either protocol syntax: :[:options] or explicitly: driver=[,option=...] For the protocol syntax to work, drivers should set the protocol_name field of the BlockDriver structure and provide bdrv_file_open and bdrv_parse_filename implementations. Conversely,

[Qemu-block] [PATCH 2/5] block/quorum: Remove protocol-related fields

2018-03-09 Thread Fabiano Rosas
The quorum driver is not a protocol so it should implement bdrv_open instead of bdrv_file_open and not provide a protocol_name. Attempts to invoke this driver using protocol syntax (i.e. quorum:) will now fail gracefully: $ qemu-img info quorum:foo qemu-img: Could not open 'quorum:foo':

[Qemu-block] [PATCH 5/5] include/block/block_int: Document protocol related functions

2018-03-09 Thread Fabiano Rosas
Clarify that for protocols the brdv_file_open function is used instead of bdrv_open and that protocol_name is expected to be set. Signed-off-by: Fabiano Rosas --- include/block/block_int.h | 6 ++ 1 file changed, 6 insertions(+) diff --git

Re: [Qemu-block] [PATCH 4/7] qed: Support .bdrv_co_create

2018-03-09 Thread Eric Blake
On 03/09/2018 03:46 PM, Kevin Wolf wrote: This adds the .bdrv_co_create driver callback to qed, which enables image creation over QMP. Signed-off-by: Kevin Wolf --- qapi/block-core.json | 25 ++- block/qed.c | 204

Re: [Qemu-block] [PATCH 3/7] qcow: Support .bdrv_co_create

2018-03-09 Thread Eric Blake
On 03/09/2018 03:46 PM, Kevin Wolf wrote: This adds the .bdrv_co_create driver callback to qcow, which enables image creation over QMP. Signed-off-by: Kevin Wolf --- qapi/block-core.json | 21 +- block/qcow.c | 196

Re: [Qemu-block] [PATCH 3/5] nbd/server: fix: check client->closing before reply sending

2018-03-09 Thread Eric Blake
On 03/08/2018 12:46 PM, Vladimir Sementsov-Ogievskiy wrote: Signed-off-by: Vladimir Sementsov-Ogievskiy --- It's like an RFC. I'm not sure, but this place looks like a bug. Shouldn't we chack client-closing even before nbd_client_receive_next_request() call?

Re: [Qemu-block] [PATCH 4/6] luks: Turn invalid assertion into check

2018-03-09 Thread Kevin Wolf
Am 09.03.2018 um 21:19 hat Eric Blake geschrieben: > On 03/09/2018 11:27 AM, Kevin Wolf wrote: > > The .bdrv_getlength implementation of the crypto block driver asserted > > that the payload offset isn't after EOF. This is an invalid assertion to > > make as the image file could be corrupted.

[Qemu-block] [PATCH 7/7] vpc: Support .bdrv_co_create

2018-03-09 Thread Kevin Wolf
This adds the .bdrv_co_create driver callback to vpc, which enables image creation over QMP. Signed-off-by: Kevin Wolf --- qapi/block-core.json | 33 ++- block/vpc.c | 152 ++- 2 files changed, 147

[Qemu-block] [PATCH 6/7] vhdx: Support .bdrv_co_create

2018-03-09 Thread Kevin Wolf
This adds the .bdrv_co_create driver callback to vhdx, which enables image creation over QMP. Signed-off-by: Kevin Wolf --- qapi/block-core.json | 37 ++- block/vhdx.c | 174 ++- 2 files changed, 167

[Qemu-block] [PATCH 0/7] block: .bdrv_co_create for format drivers

2018-03-09 Thread Kevin Wolf
This series adds a .bdrv_co_create implementation to almost all format drivers that support creating images where its still missing. The only exception is VMDK because its support for extents will make the QAPI design a bit more complicated. The other format driver not covered in this series are

[Qemu-block] [PATCH 4/7] qed: Support .bdrv_co_create

2018-03-09 Thread Kevin Wolf
This adds the .bdrv_co_create driver callback to qed, which enables image creation over QMP. Signed-off-by: Kevin Wolf --- qapi/block-core.json | 25 ++- block/qed.c | 204 ++- 2 files changed, 162 insertions(+), 67

[Qemu-block] [PATCH 3/7] qcow: Support .bdrv_co_create

2018-03-09 Thread Kevin Wolf
This adds the .bdrv_co_create driver callback to qcow, which enables image creation over QMP. Signed-off-by: Kevin Wolf --- qapi/block-core.json | 21 +- block/qcow.c | 196 ++- 2 files changed, 150 insertions(+), 67

[Qemu-block] [PATCH 1/7] parallels: Support .bdrv_co_create

2018-03-09 Thread Kevin Wolf
This adds the .bdrv_co_create driver callback to parallels, which enables image creation over QMP. Signed-off-by: Kevin Wolf --- qapi/block-core.json | 18 - block/parallels.c| 199 ++- 2 files changed, 168

[Qemu-block] [PATCH 5/7] vdi: Support .bdrv_co_create

2018-03-09 Thread Kevin Wolf
This adds the .bdrv_co_create driver callback to vdi, which enables image creation over QMP. Signed-off-by: Kevin Wolf --- qapi/block-core.json | 21 ++- block/vdi.c | 169 ++- 2 files changed, 148 insertions(+), 42

[Qemu-block] [PATCH 2/7] qemu-iotests: Enable write tests for parallels

2018-03-09 Thread Kevin Wolf
Originally we added parallels as a read-only format to qemu-iotests where we did just some tests with a binary image. Since then, write and image creation support has been added to the driver, so we can now enable it in _supported_fmt generic. The driver doesn't support migration yet, though, so

Re: [Qemu-block] [PATCH 6/6] qemu-iotests: Test luks QMP image creation

2018-03-09 Thread Eric Blake
On 03/09/2018 11:27 AM, Kevin Wolf wrote: Signed-off-by: Kevin Wolf --- tests/qemu-iotests/208 | 211 +++ tests/qemu-iotests/208.out | 136 tests/qemu-iotests/common.rc | 2 +-

Re: [Qemu-block] [PATCH 5/6] luks: Catch integer overflow for huge sizes

2018-03-09 Thread Eric Blake
On 03/09/2018 11:27 AM, Kevin Wolf wrote: When you request an image size close to UINT64_MAX, the addition of the crypto header may cause an integer overflow. Catch it instead of silently truncating the image size. Signed-off-by: Kevin Wolf --- block/crypto.c | 5 + 1

Re: [Qemu-block] [PATCH 4/6] luks: Turn invalid assertion into check

2018-03-09 Thread Eric Blake
On 03/09/2018 11:27 AM, Kevin Wolf wrote: The .bdrv_getlength implementation of the crypto block driver asserted that the payload offset isn't after EOF. This is an invalid assertion to make as the image file could be corrupted. Instead, check it and return -EIO if the file is too small for the

Re: [Qemu-block] [PATCH 3/6] luks: Support .bdrv_co_create

2018-03-09 Thread Eric Blake
On 03/09/2018 11:27 AM, Kevin Wolf wrote: This adds the .bdrv_co_create driver callback to luks, which enables image creation over QMP. Signed-off-by: Kevin Wolf --- qapi/block-core.json | 17 - block/crypto.c | 34 ++

Re: [Qemu-block] [PATCH v3 0/7] block: Handle null backing link

2018-03-09 Thread Eric Blake
On 02/24/2018 09:40 AM, Max Reitz wrote: Currently, we try to rewrite every occurrence of "backing": null into "backing": "" in qmp_blockdev_add(). However, that breaks using the same "backing": null construction in json:{} file names (which do not go through qmp_blockdev_add()). Currently,

Re: [Qemu-block] [PATCH 2/6] luks: Create block_crypto_co_create_generic()

2018-03-09 Thread Eric Blake
On 03/09/2018 11:27 AM, Kevin Wolf wrote: Everything that refers to the protocol layer or QemuOpts is moved out of block_crypto_create_generic(), so that the remaining function is suitable to be called by a .bdrv_co_create implementation. LUKS is the only driver that actually implements the old

Re: [Qemu-block] [Qemu-devel] [PATCH 3/5] migration/block: rename MAX_INFLIGHT_IO to MAX_IO_BUFFERS

2018-03-09 Thread Peter Lieven
Am 09.03.2018 um 15:58 schrieb Dr. David Alan Gilbert: > * Peter Lieven (p...@kamp.de) wrote: >> this actually limits (as the original commit mesage suggests) the >> number of I/O buffers that can be allocated and not the number >> of parallel (inflight) I/O requests. >> >> Signed-off-by: Peter

Re: [Qemu-block] [PATCH v2 2/5] nbd/server: fix sparse read

2018-03-09 Thread Eric Blake
On 03/08/2018 12:46 PM, Vladimir Sementsov-Ogievskiy wrote: In case of io error in nbd_co_send_sparse_read we should not "goto reply:", as it is fatal error and common behavior is disconnect in this case. We should not try to send client an s/send/send the/ error reply, representing

Re: [Qemu-block] [PATCH 1/6] luks: Separate image file creation from formatting

2018-03-09 Thread Eric Blake
On 03/09/2018 11:27 AM, Kevin Wolf wrote: The crypto driver used to create the image file in a callback from the crypto subsystem. If we want to implement .bdrv_co_create, this needs to go away because that callback will get a reference to an already existing block node. Move the image file

Re: [Qemu-block] [PATCH 0/9] nbd block status base:allocation

2018-03-09 Thread Vladimir Sementsov-Ogievskiy
09.03.2018 22:08, Eric Blake wrote: On 02/15/2018 07:51 AM, Vladimir Sementsov-Ogievskiy wrote: Hi all. Here is minimal realization of base:allocation context of NBD block-status extension, which allows to get block status through NBD. Vladimir Sementsov-Ogievskiy (9):    nbd/server: add

Re: [Qemu-block] [Qemu-devel] [PATCH 0/5] nbd server fixing and refactoring before BLOCK_STATUS

2018-03-09 Thread Eric Blake
On 03/09/2018 10:41 AM, Eric Blake wrote: On 03/08/2018 12:46 PM, Vladimir Sementsov-Ogievskiy wrote: 01 and 02 are splitted and updated "[PATCH] nbd/server: fix space read", others are new. Vladimir Sementsov-Ogievskiy (5):    nbd/server: move nbd_co_send_structured_error up    nbd/server:

Re: [Qemu-block] [PATCH 0/9] nbd block status base:allocation

2018-03-09 Thread Eric Blake
On 02/15/2018 07:51 AM, Vladimir Sementsov-Ogievskiy wrote: Hi all. Here is minimal realization of base:allocation context of NBD block-status extension, which allows to get block status through NBD. Vladimir Sementsov-Ogievskiy (9): nbd/server: add nbd_opt_invalid helper nbd: change

Re: [Qemu-block] [PATCH 7/9] iotests.py: tiny refactor: move system imports up

2018-03-09 Thread Vladimir Sementsov-Ogievskiy
16.02.2018 23:44, Eric Blake wrote: On 02/15/2018 07:51 AM, Vladimir Sementsov-Ogievskiy wrote: Signed-off-by: Vladimir Sementsov-Ogievskiy ---   tests/qemu-iotests/iotests.py | 5 +++--   1 file changed, 3 insertions(+), 2 deletions(-) What breaks if they aren't

Re: [Qemu-block] [PATCH 6/9] nbd: BLOCK_STATUS for standard get_block_status function: client part

2018-03-09 Thread Vladimir Sementsov-Ogievskiy
16.02.2018 23:40, Eric Blake wrote: On 02/15/2018 07:51 AM, Vladimir Sementsov-Ogievskiy wrote: Minimal realization: only one extent in server answer is supported. Flag NBD_CMD_FLAG_REQ_ONE is used to force this behavior. [...] +    memcpy(extent, payload, sizeof(*extent)); +   

Re: [Qemu-block] [PULL 0/7] Block patches

2018-03-09 Thread Peter Maydell
On 9 March 2018 at 13:19, Stefan Hajnoczi wrote: > The following changes since commit 0ab4537f08e09b13788db67efd760592fb7db769: > > Merge remote-tracking branch > 'remotes/stefanberger/tags/pull-tpm-2018-03-07-1' into staging (2018-03-08 > 12:56:39 +) > > are

[Qemu-block] [PATCH 6/6] qemu-iotests: Test luks QMP image creation

2018-03-09 Thread Kevin Wolf
Signed-off-by: Kevin Wolf --- tests/qemu-iotests/208 | 211 +++ tests/qemu-iotests/208.out | 136 tests/qemu-iotests/common.rc | 2 +- tests/qemu-iotests/group | 1 + 4 files changed, 349

[Qemu-block] [PATCH 0/6] luks: Implement .bdrv_co_create

2018-03-09 Thread Kevin Wolf
This series implements the .bdrv_co_create callback for luks, adds an image creation test for it and contains some bonus fixes for bugs that the test triggered. Kevin Wolf (6): luks: Separate image file creation from formatting luks: Create block_crypto_co_create_generic() luks: Support

[Qemu-block] [PATCH 4/6] luks: Turn invalid assertion into check

2018-03-09 Thread Kevin Wolf
The .bdrv_getlength implementation of the crypto block driver asserted that the payload offset isn't after EOF. This is an invalid assertion to make as the image file could be corrupted. Instead, check it and return -EIO if the file is too small for the payload offset. Zero length images are

[Qemu-block] [PATCH 3/6] luks: Support .bdrv_co_create

2018-03-09 Thread Kevin Wolf
This adds the .bdrv_co_create driver callback to luks, which enables image creation over QMP. Signed-off-by: Kevin Wolf --- qapi/block-core.json | 17 - block/crypto.c | 34 ++ 2 files changed, 50 insertions(+), 1

[Qemu-block] [PATCH 2/6] luks: Create block_crypto_co_create_generic()

2018-03-09 Thread Kevin Wolf
Everything that refers to the protocol layer or QemuOpts is moved out of block_crypto_create_generic(), so that the remaining function is suitable to be called by a .bdrv_co_create implementation. LUKS is the only driver that actually implements the old interface, and we don't intend to use it in

[Qemu-block] [PATCH v6 2/2] qapi: add block latency histogram interface

2018-03-09 Thread Vladimir Sementsov-Ogievskiy
Set (and clear) histogram through new command block-latency-histogram-set and show new statistics in query-blockstats results. Signed-off-by: Vladimir Sementsov-Ogievskiy --- qapi/block-core.json | 111 ++- block/qapi.c

[Qemu-block] [PATCH v6 0/2] block latency histogram

2018-03-09 Thread Vladimir Sementsov-Ogievskiy
v6: Use correct header qapi/qapi-builtin-types.h, to fix build again. Sorry for spam =( v5: Revert to v3 and just add qapi-types.h header. v4: Move block_latency_histogram_set from block/accounting.c to blockdev.c, as it uses qapi type uint64List and this fact breaks build. v3: -

[Qemu-block] [PATCH 1/6] luks: Separate image file creation from formatting

2018-03-09 Thread Kevin Wolf
The crypto driver used to create the image file in a callback from the crypto subsystem. If we want to implement .bdrv_co_create, this needs to go away because that callback will get a reference to an already existing block node. Move the image file creation to block_crypto_create_generic().

[Qemu-block] [PATCH 5/6] luks: Catch integer overflow for huge sizes

2018-03-09 Thread Kevin Wolf
When you request an image size close to UINT64_MAX, the addition of the crypto header may cause an integer overflow. Catch it instead of silently truncating the image size. Signed-off-by: Kevin Wolf --- block/crypto.c | 5 + 1 file changed, 5 insertions(+) diff --git

Re: [Qemu-block] [PATCH 0/5] nbd server fixing and refactoring before BLOCK_STATUS

2018-03-09 Thread Vladimir Sementsov-Ogievskiy
09.03.2018 19:41, Eric Blake wrote: On 03/08/2018 12:46 PM, Vladimir Sementsov-Ogievskiy wrote: 01 and 02 are splitted and updated "[PATCH] nbd/server: fix space read", others are new. Vladimir Sementsov-Ogievskiy (5):    nbd/server: move nbd_co_send_structured_error up    nbd/server: fix

Re: [Qemu-block] [PATCH v4 0/2] block latency histogram

2018-03-09 Thread Vladimir Sementsov-Ogievskiy
09.03.2018 19:37, Eric Blake wrote: On 03/09/2018 10:31 AM, Vladimir Sementsov-Ogievskiy wrote: 09.03.2018 18:40, Eric Blake wrote: On 03/09/2018 09:33 AM, Vladimir Sementsov-Ogievskiy wrote: v4: Move block_latency_histogram_set from block/accounting.c to blockdev.c, as it uses qapi type

Re: [Qemu-block] [PATCH 1/5] nbd/server: move nbd_co_send_structured_error up

2018-03-09 Thread Eric Blake
On 03/08/2018 12:46 PM, Vladimir Sementsov-Ogievskiy wrote: To be reused in nbd_co_send_sparse_read() in the following patch. Signed-off-by: Vladimir Sementsov-Ogievskiy --- nbd/server.c | 48 1 file changed, 24

Re: [Qemu-block] [PATCH v4 0/2] block latency histogram

2018-03-09 Thread Eric Blake
On 03/09/2018 10:31 AM, Vladimir Sementsov-Ogievskiy wrote: 09.03.2018 18:40, Eric Blake wrote: On 03/09/2018 09:33 AM, Vladimir Sementsov-Ogievskiy wrote: v4: Move block_latency_histogram_set from block/accounting.c to blockdev.c, as it uses qapi type uint64List and this fact breaks build.

[Qemu-block] [PULL 54/56] iotests: Skip test for ENOMEM error

2018-03-09 Thread Kevin Wolf
From: Fam Zheng The AFL image is to exercise the code validating image size, which doesn't work on 32 bit or when out of memory (there is a large allocation before the interesting point). So check that and skip the test, instead of faking the result. Signed-off-by: Fam Zheng

[Qemu-block] [PATCH v6 1/2] block/accounting: introduce latency histogram

2018-03-09 Thread Vladimir Sementsov-Ogievskiy
Introduce latency histogram statics for block devices. For each accounted operation type latency region [0, +inf) is divided into subregions by several points. Then, calculate hits for each subregion. Signed-off-by: Vladimir Sementsov-Ogievskiy ---

[Qemu-block] [PULL 47/56] ssh: Support .bdrv_co_create

2018-03-09 Thread Kevin Wolf
This adds the .bdrv_co_create driver callback to ssh, which enables image creation over QMP. Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz --- qapi/block-core.json | 16 +- block/ssh.c | 83

[Qemu-block] [PULL 43/56] sheepdog: Support .bdrv_co_create

2018-03-09 Thread Kevin Wolf
This adds the .bdrv_co_create driver callback to sheepdog, which enables image creation over QMP. Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz --- qapi/block-core.json | 24 - block/sheepdog.c | 243

[Qemu-block] [PULL 40/56] nfs: Use QAPI options in nfs_client_open()

2018-03-09 Thread Kevin Wolf
Using the QAPI visitor to turn all options into QAPI BlockdevOptionsNfs simplifies the code a lot. It will also be useful for implementing the QAPI based .bdrv_co_create callback. Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz --- block/nfs.c | 176

[Qemu-block] [PULL 36/56] rbd: Pass BlockdevOptionsRbd to qemu_rbd_connect()

2018-03-09 Thread Kevin Wolf
With the conversion to a QAPI options object, the function is now prepared to be used in a .bdrv_co_create implementation. Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz --- block/rbd.c | 115 +--- 1

[Qemu-block] [PULL 44/56] ssh: Use QAPI BlockdevOptionsSsh object

2018-03-09 Thread Kevin Wolf
Create a BlockdevOptionsSsh object in connect_to_ssh() and take the options from there. 'host_key_check' is still processed separately because it's not in the schema yet. Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz --- block/ssh.c | 137

Re: [Qemu-block] [PATCH v4 0/2] block latency histogram

2018-03-09 Thread Vladimir Sementsov-Ogievskiy
09.03.2018 18:40, Eric Blake wrote: On 03/09/2018 09:33 AM, Vladimir Sementsov-Ogievskiy wrote: v4: Move block_latency_histogram_set from block/accounting.c to blockdev.c, as it uses qapi type uint64List and this fact breaks build. Was the cross file motion necessary, or could you just fix

Re: [Qemu-block] [PATCH 0/5] nbd server fixing and refactoring before BLOCK_STATUS

2018-03-09 Thread Eric Blake
On 03/08/2018 12:46 PM, Vladimir Sementsov-Ogievskiy wrote: 01 and 02 are splitted and updated "[PATCH] nbd/server: fix space read", others are new. Vladimir Sementsov-Ogievskiy (5): nbd/server: move nbd_co_send_structured_error up nbd/server: fix sparse read nbd/server: fix: check

[Qemu-block] [PULL 34/56] rbd: Factor out qemu_rbd_connect()

2018-03-09 Thread Kevin Wolf
The code to establish an RBD connection is duplicated between open and create. In order to be able to share the code, factor out the code from qemu_rbd_open() as a first step. Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz --- block/rbd.c | 100

Re: [Qemu-block] [Qemu-devel] [PATCH v5 0/2] block latency histogram

2018-03-09 Thread no-reply
Hi, This series failed build test on s390x host. Please find the details below. Type: series Message-id: 20180309160224.78821-1-vsement...@virtuozzo.com Subject: [Qemu-devel] [PATCH v5 0/2] block latency histogram === TEST SCRIPT BEGIN === #!/bin/bash # Testing script will be invoked under the

[Qemu-block] [PULL 33/56] rbd: Fix use after free in qemu_rbd_set_keypairs() error path

2018-03-09 Thread Kevin Wolf
If we want to include the invalid option name in the error message, we can't free the string earlier than that. Cc: qemu-sta...@nongnu.org Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz Reviewed-by: Eric Blake --- block/rbd.c | 3 ++-

[Qemu-block] [PULL 53/56] iotests: Mark all tests executable

2018-03-09 Thread Kevin Wolf
From: Eric Blake The majority of our iotests have the executable bit set; fix the few outliers for consistency. Signed-off-by: Eric Blake Message-id: 20180305161824.7188-1-ebl...@redhat.com Signed-off-by: Max Reitz ---

[Qemu-block] [PULL 50/56] qemu-iotests: Test qcow2 over file image creation with QMP

2018-03-09 Thread Kevin Wolf
Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz --- tests/qemu-iotests/206 | 436 + tests/qemu-iotests/206.out | 209 ++ tests/qemu-iotests/group | 1 + 3 files changed, 646

[Qemu-block] [PULL 49/56] block: Fail bdrv_truncate() with negative size

2018-03-09 Thread Kevin Wolf
Most callers have their own checks, but something like this should also be checked centrally. As it happens, x-blockdev-create can pass negative image sizes to format drivers (because there is no QAPI type that would reject negative numbers) and triggers the check added by this patch.

[Qemu-block] [PULL 52/56] iotests: Test creating overlay when guest running

2018-03-09 Thread Kevin Wolf
From: Fam Zheng Signed-off-by: Fam Zheng Message-id: 20171225025107.23985-1-f...@redhat.com Reviewed-by: Eric Blake Signed-off-by: Max Reitz --- tests/qemu-iotests/153 | 8 +--- tests/qemu-iotests/153.out | 7

[Qemu-block] [PULL 45/56] ssh: QAPIfy host-key-check option

2018-03-09 Thread Kevin Wolf
This makes the host-key-check option available in blockdev-add. Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz --- qapi/block-core.json | 63 +++-- block/ssh.c | 88

[Qemu-block] [PULL 55/56] iotests: Tweak 030 in order to trigger a race condition with parallel jobs

2018-03-09 Thread Kevin Wolf
From: Alberto Garcia This patch tweaks TestParallelOps in iotest 030 so it allocates data in smaller regions (256KB/512KB instead of 512KB/1MB) and the block-stream job in test_stream_commit() only needs to copy data that is at the very end of the image. This way when the

[Qemu-block] [PULL 56/56] qemu-iotests: fix 203 migration completion race

2018-03-09 Thread Kevin Wolf
From: Stefan Hajnoczi There is a race between the test's 'query-migrate' QMP command after the QMP 'STOP' event and completing the migration: The test case invokes 'query-migrate' upon receiving 'STOP'. At this point the migration thread may still be in the process of

[Qemu-block] [PULL 42/56] sheepdog: QAPIfy "redundancy" create option

2018-03-09 Thread Kevin Wolf
The "redundancy" option for Sheepdog image creation is currently a string that can encode one or two integers depending on its format, which at the same time implicitly selects a mode. This patch turns it into a QAPI union and converts the string into such a QAPI object before interpreting the

[Qemu-block] [PULL 20/56] qcow2: Use BlockdevRef in qcow2_co_create()

2018-03-09 Thread Kevin Wolf
Instead of passing a separate BlockDriverState* into qcow2_co_create(), make use of the BlockdevRef that is included in BlockdevCreateOptions. Signed-off-by: Kevin Wolf Reviewed-by: Eric Blake Reviewed-by: Max Reitz ---

[Qemu-block] [PULL 39/56] rbd: Use qemu_rbd_connect() in qemu_rbd_do_create()

2018-03-09 Thread Kevin Wolf
This is almost exactly the same code. The differences are that qemu_rbd_connect() supports BlockdevOptionsRbd.server and that the cache mode is set explicitly. Supporting 'server' is a welcome new feature for image creation. Caching is disabled by default, so leave it that way. Signed-off-by:

[Qemu-block] [PULL 41/56] nfs: Support .bdrv_co_create

2018-03-09 Thread Kevin Wolf
This adds the .bdrv_co_create driver callback to nfs, which enables image creation over QMP. Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz --- qapi/block-core.json | 16 ++- block/nfs.c | 76

[Qemu-block] [PULL 38/56] rbd: Assign s->snap/image_name in qemu_rbd_open()

2018-03-09 Thread Kevin Wolf
Now that the options are already available in qemu_rbd_open() and not only parsed in qemu_rbd_connect(), we can assign s->snap and s->image_name there instead of passing the fields by reference to qemu_rbd_connect(). Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz

[Qemu-block] [PULL 32/56] gluster: Support .bdrv_co_create

2018-03-09 Thread Kevin Wolf
This adds the .bdrv_co_create driver callback to gluster, which enables image creation over QMP. Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz Reviewed-by: Eric Blake --- qapi/block-core.json | 18 ++- block/gluster.c | 135

[Qemu-block] [PULL 29/56] block: x-blockdev-create QMP command

2018-03-09 Thread Kevin Wolf
This adds a synchronous x-blockdev-create QMP command that can create qcow2 images on a given node name. We don't want to block while creating an image, so this is not the final interface in all aspects, but BlockdevCreateOptionsQcow2 and .bdrv_co_create() are what they actually might look like

[Qemu-block] [PULL 19/56] qcow2: Pass BlockdevCreateOptions to qcow2_co_create()

2018-03-09 Thread Kevin Wolf
All of the simple options are now passed to qcow2_co_create() in a BlockdevCreateOptions object. Still missing: node-name and the encryption options. Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz Reviewed-by: Eric Blake ---

[Qemu-block] [PULL 22/56] qcow2: Handle full/falloc preallocation in qcow2_co_create()

2018-03-09 Thread Kevin Wolf
Once qcow2_co_create() can be called directly on an already existing node, we must provide the 'full' and 'falloc' preallocation modes outside of creating the image on the protocol layer. Fortunately, we have preallocated truncate now which can provide this functionality. Signed-off-by: Kevin

[Qemu-block] [PULL 31/56] file-win32: Support .bdrv_co_create

2018-03-09 Thread Kevin Wolf
This adds the .bdrv_co_create driver callback to file-win32, which enables image creation over QMP. Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz Reviewed-by: Eric Blake --- block/file-win32.c | 47

[Qemu-block] [PULL 23/56] util: Add qemu_opts_to_qdict_filtered()

2018-03-09 Thread Kevin Wolf
This allows, given a QemuOpts for a QemuOptsList that was merged from multiple QemuOptsList, to only consider those options that exist in one specific list. Block drivers need this to separate format-layer create options from protocol-level options. Signed-off-by: Kevin Wolf

[Qemu-block] [PULL 27/56] qcow2: Use visitor for options in qcow2_create()

2018-03-09 Thread Kevin Wolf
Instead of manually creating the BlockdevCreateOptions object, use a visitor to parse the given options into the QAPI object. This involves translation from the old command line syntax to the syntax mandated by the QAPI schema. Option names are still checked against qcow2_create_opts, so only the

[Qemu-block] [PULL 24/56] test-qemu-opts: Test qemu_opts_append()

2018-03-09 Thread Kevin Wolf
Basic test for merging two QemuOptsLists. Signed-off-by: Kevin Wolf Reviewed-by: Eric Blake Reviewed-by: Max Reitz --- tests/test-qemu-opts.c | 128 + 1 file changed, 128 insertions(+)

[Qemu-block] [PULL 26/56] qdict: Introduce qdict_rename_keys()

2018-03-09 Thread Kevin Wolf
A few block drivers will need to rename .bdrv_create options for their QAPIfication, so let's have a helper function for that. Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz Reviewed-by: Eric Blake --- include/qapi/qmp/qdict.h | 6

[Qemu-block] [PULL 17/56] qcow2: Rename qcow2_co_create2() to qcow2_co_create()

2018-03-09 Thread Kevin Wolf
The functions originally known as qcow2_create() and qcow2_create2() are now called qcow2_co_create_opts() and qcow2_co_create(), which matches the names of the BlockDriver callbacks that they will implement at the end of this patch series. Signed-off-by: Kevin Wolf

[Qemu-block] [PULL 12/56] qcow2: Check snapshot L1 table in qcow2_snapshot_goto()

2018-03-09 Thread Kevin Wolf
From: Alberto Garcia This function copies a snapshot's L1 table into the active one without validating it first. We now have a function to take care of this, so let's use it. Cc: Eric Blake Signed-off-by: Alberto Garcia Reviewed-by: Eric

[Qemu-block] [PULL 16/56] block/qapi: Add qcow2 create options to schema

2018-03-09 Thread Kevin Wolf
Signed-off-by: Kevin Wolf Reviewed-by: Eric Blake Reviewed-by: Max Reitz --- qapi/block-core.json | 45 - 1 file changed, 44 insertions(+), 1 deletion(-) diff --git a/qapi/block-core.json

[Qemu-block] [PULL 15/56] block/qapi: Introduce BlockdevCreateOptions

2018-03-09 Thread Kevin Wolf
This creates a BlockdevCreateOptions union type that will contain all of the options for image creation. We'll start out with an empty struct type BlockdevCreateNotSupported for all drivers. Signed-off-by: Kevin Wolf Reviewed-by: Eric Blake Reviewed-by: Max

[Qemu-block] [PULL 30/56] file-posix: Support .bdrv_co_create

2018-03-09 Thread Kevin Wolf
This adds the .bdrv_co_create driver callback to file, which enables image creation over QMP. Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz Reviewed-by: Eric Blake --- qapi/block-core.json | 20 - block/file-posix.c | 79

[Qemu-block] [PULL 25/56] test-qemu-opts: Test qemu_opts_to_qdict_filtered()

2018-03-09 Thread Kevin Wolf
Signed-off-by: Kevin Wolf Reviewed-by: Eric Blake Reviewed-by: Max Reitz --- tests/test-qemu-opts.c | 125 + 1 file changed, 125 insertions(+) diff --git a/tests/test-qemu-opts.c

[Qemu-block] [PULL 13/56] qcow2: Check snapshot L1 table in qcow2_snapshot_delete()

2018-03-09 Thread Kevin Wolf
From: Alberto Garcia This function deletes a snapshot from disk, removing its entry from the snapshot table, freeing its L1 table and decreasing the refcounts of all clusters. The L1 table offset and size are however not validated. If we use invalid values in this function

[Qemu-block] [PULL 04/56] qcow2: make qcow2_do_open a coroutine_fn

2018-03-09 Thread Kevin Wolf
From: Paolo Bonzini It is called from qcow2_invalidate_cache in coroutine context (incoming migration runs in a coroutine), so it's cleaner if metadata is always loaded from a coroutine. Signed-off-by: Paolo Bonzini Message-Id:

[Qemu-block] [PULL 06/56] block: convert bdrv_invalidate_cache callback to coroutine_fn

2018-03-09 Thread Kevin Wolf
From: Paolo Bonzini QED's bdrv_invalidate_cache implementation would like to reuse functions that acquire/release the metadata locks. Call it from coroutine context to simplify the logic. Signed-off-by: Paolo Bonzini Message-Id:

[Qemu-block] [PULL 03/56] qcow2: fix flushing after dirty bitmap metadata writes

2018-03-09 Thread Kevin Wolf
From: Paolo Bonzini update_header_sync itself does not need to flush the caches to disk. The only paths that allocate clusters are: - bitmap_list_store with in_place=false, called by update_ext_header_and_dir - store_bitmap_data, called by store_bitmap - store_bitmap,

[Qemu-block] [PULL 14/56] qcow2: Make qemu-img check detect corrupted L1 tables in snapshots

2018-03-09 Thread Kevin Wolf
From: Alberto Garcia 'qemu-img check' cannot detect if a snapshot's L1 table is corrupted. This patch checks the table's offset and size and reports corruption if the values are not valid. This patch doesn't add code to fix that corruption yet, only to detect and report it.

[Qemu-block] [PULL 09/56] qcow2: Check L1 table offset in qcow2_snapshot_load_tmp()

2018-03-09 Thread Kevin Wolf
From: Alberto Garcia This function checks that the size of a snapshot's L1 table is not too large, but it doesn't validate the offset. We now have a function to take care of this, so let's use it. Signed-off-by: Alberto Garcia Reviewed-by: Eric Blake

[Qemu-block] [PULL 10/56] qcow2: Check L1 table parameters in qcow2_expand_zero_clusters()

2018-03-09 Thread Kevin Wolf
From: Alberto Garcia This function iterates over all snapshots of a qcow2 file in order to expand all zero clusters, but it does not validate the snapshots' L1 tables first. We now have a function to take care of this, so let's use it. We can also take the opportunity to

[Qemu-block] [PULL 05/56] qed: make bdrv_qed_do_open a coroutine_fn

2018-03-09 Thread Kevin Wolf
From: Paolo Bonzini It is called from qed_invalidate_cache in coroutine context (incoming migration runs in a coroutine), so it's cleaner if metadata is always loaded from a coroutine. Signed-off-by: Paolo Bonzini Message-Id:

[Qemu-block] [PULL 01/56] block: implement the bdrv_reopen_prepare helper for LUKS driver

2018-03-09 Thread Kevin Wolf
From: "Daniel P. Berrange" If the bdrv_reopen_prepare helper isn't provided, the qemu-img commit command fails to re-open the base layer after committing changes into it. Provide a no-op implementation for the LUKS driver, since there is not any custom work that needs doing

[Qemu-block] [PULL 07/56] block: convert bdrv_check callback to coroutine_fn

2018-03-09 Thread Kevin Wolf
From: Paolo Bonzini Suggested-by: Kevin Wolf Signed-off-by: Paolo Bonzini Message-Id: <1516279431-30424-8-git-send-email-pbonz...@redhat.com> Signed-off-by: Paolo Bonzini Signed-off-by: Kevin Wolf

[Qemu-block] [PULL 02/56] qcow2: introduce qcow2_write_caches and qcow2_flush_caches

2018-03-09 Thread Kevin Wolf
From: Paolo Bonzini They will be used to avoid recursively taking s->lock during bdrv_open or bdrv_check. Signed-off-by: Paolo Bonzini Message-Id: <1516279431-30424-7-git-send-email-pbonz...@redhat.com> Signed-off-by: Paolo Bonzini

[Qemu-block] [PULL 00/56] Block layer patches

2018-03-09 Thread Kevin Wolf
The following changes since commit d9bbfea646e86426d549bd612cd9f91e49aa50c2: Merge remote-tracking branch 'remotes/riscv/tags/riscv-qemu-upstream-v8.2' into staging (2018-03-09 10:58:57 +) are available in the git repository at: git://repo.or.cz/qemu/kevin.git tags/for-upstream for

Re: [Qemu-block] [Qemu-devel] [PATCH v5 0/2] block latency histogram

2018-03-09 Thread no-reply
Hi, This series failed docker-build@min-glib build test. Please find the testing commands and their output below. If you have Docker installed, you can probably reproduce it locally. Type: series Message-id: 20180309160224.78821-1-vsement...@virtuozzo.com Subject: [Qemu-devel] [PATCH v5 0/2]

  1   2   >