[Qemu-block] [PATCH 1/2] qemu-iotests: only enable kvm if the host seems to support it

2019-02-08 Thread Cleber Rosa
There are certainly some improvements to be made with regards to kvm capabilities detection, but this seems good enough for this specific case. Signed-off-by: Cleber Rosa --- tests/qemu-iotests/235 | 5 +++-- tests/qemu-iotests/238 | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) dif

[Qemu-block] [PATCH 2/2] qemu-iotests: add "make check-block" job to Travis

2019-02-08 Thread Cleber Rosa
I usually keep an eye if I'm breaking stuff by looking at Travis (too). So it seems like a good idea to add a job that will do that. A few things deserve a better explanation: * test 233 requires "--enable-gnutls", and fails without it * QEMU seems unable to initialize sound devices on the

[Qemu-block] [PATCH 0/2] qemu-iotests: add a Travis job

2019-02-08 Thread Cleber Rosa
Besides the obvious reasons of testing more, and somewhat for free, running the qemu-iotests along the other tests on Travis also makes sure that changes to shared code such as "scripts/qemu.py" and the like won't break other users of the same code. Cleber Rosa (2): qemu-iotests: only enable kvm

Re: [Qemu-block] [Qemu-devel] [PATCH v3 1/8] ahci-test: Add dependency to qemu-img tool

2019-02-08 Thread Philippe Mathieu-Daudé
On 2/8/19 11:34 PM, John Snow wrote: > On 2/7/19 1:51 PM, Thomas Huth wrote: >> On 2019-02-07 17:50, Philippe Mathieu-Daudé wrote: >>> On 2/5/19 1:18 AM, Philippe Mathieu-Daudé wrote: Since the ahci-test uses qemu-img, add a dependency to build it before using it. This fixes: >>

Re: [Qemu-block] [Qemu-devel] [PATCH v3 1/8] ahci-test: Add dependency to qemu-img tool

2019-02-08 Thread John Snow
On 2/7/19 1:51 PM, Thomas Huth wrote: > On 2019-02-07 17:50, Philippe Mathieu-Daudé wrote: >> On 2/5/19 1:18 AM, Philippe Mathieu-Daudé wrote: >>> Since the ahci-test uses qemu-img, add a dependency to build it >>> before using it. >>> This fixes: >>> >>> $ gmake check-qtest V=1 >>> QTEST_QE

Re: [Qemu-block] [Qemu-devel] [PATCH v3 1/8] qapi: Add default-variant for flat unions

2019-02-08 Thread Max Reitz
On 07.02.19 07:56, Markus Armbruster wrote: > Max Reitz writes: > >> This patch allows specifying a discriminator that is an optional member >> of the base struct. In such a case, a default value must be provided >> that is used when no value is given. >> >> Signed-off-by: Max Reitz >> --- >>

Re: [Qemu-block] [PATCH v3 6/8] block: Try to create well typed json:{} filenames

2019-02-08 Thread Max Reitz
On 06.02.19 21:43, Eric Blake wrote: > On 2/6/19 1:55 PM, Max Reitz wrote: > > In the subject, s/well typed/well-typed/ > >> By applying a health mix of qdict_flatten(), qdict_crumple(), > > s/health/healty/ > >> qdict_stringify_for_keyval(), the keyval input visitor, and the QObject >> output

Re: [Qemu-block] [Qemu-devel] [PATCH v2 01/18] tests/vm: Be verbose while extracting compressed images

2019-02-08 Thread Alex Bennée
Philippe Mathieu-Daudé writes: > Hi Alex, > > Can you queue this patch? Done. > > On 1/29/19 6:53 PM, Philippe Mathieu-Daudé wrote: >> Depending of the host hardware, copying and extracting VM images can >> take up to few minutes. Add verbosity to avoid the user to worry about >> VMs hanging.

Re: [Qemu-block] [PATCH v14 0/3] qcow2: Add list of bitmaps to ImageInfoSpecificQCow2

2019-02-08 Thread Andrey Shinkevich
On 08/02/2019 18:53, Eric Blake wrote: > On 2/8/19 9:37 AM, Andrey Shinkevich wrote: >> >> >> On 08/02/2019 18:25, Eric Blake wrote: >>> On 2/8/19 9:06 AM, Andrey Shinkevich wrote: v14: The test 242 was amended to be safer against changes in the bitmap allocation algorithm be

Re: [Qemu-block] [PATCH v14 0/3] qcow2: Add list of bitmaps to ImageInfoSpecificQCow2

2019-02-08 Thread Andrey Shinkevich
On 08/02/2019 18:53, Eric Blake wrote: > On 2/8/19 9:37 AM, Andrey Shinkevich wrote: >> >> >> On 08/02/2019 18:25, Eric Blake wrote: >>> On 2/8/19 9:06 AM, Andrey Shinkevich wrote: v14: The test 242 was amended to be safer against changes in the bitmap allocation algorithm be

Re: [Qemu-block] [PATCH v14 0/3] qcow2: Add list of bitmaps to ImageInfoSpecificQCow2

2019-02-08 Thread Eric Blake
On 2/8/19 9:37 AM, Andrey Shinkevich wrote: > > > On 08/02/2019 18:25, Eric Blake wrote: >> On 2/8/19 9:06 AM, Andrey Shinkevich wrote: >>> v14: >>> The test 242 was amended to be safer against changes in the bitmap >>> allocation >>> algorithm because the bitmap directory is reallocated on VM s

Re: [Qemu-block] [Qemu-devel] [PATCH] qcow2: Assert that L2 table offsets fit in the L1 table

2019-02-08 Thread Eric Blake
On 2/8/19 9:44 AM, Alberto Garcia wrote: > L1 table entries have a field to store the offset of an L2 table. > The rest of the bits of the entry are currently reserved except from > bit 63, which stores the COPIED flag. > > The offset is always taken from the entry using L1E_OFFSET_MASK to > ensur

Re: [Qemu-block] [Qemu-devel] [PATCH v4 0/6] virtio-blk: add DISCARD and WRITE_ZEROES features

2019-02-08 Thread Pankaj Gupta
> > This series adds the support of DISCARD and WRITE_ZEROES commands > and extends the virtio-blk-test to test WRITE_ZEROES command when > the feature is enabled. > > v4: > - fixed error with mingw compiler in patch 4 > gcc and clang want %lu, but mingw wants %llu for BDRV_REQUEST_MAX_SECTOR

Re: [Qemu-block] [PATCH v14 3/3] qcow2: list of bitmaps new test 242

2019-02-08 Thread Eric Blake
On 2/8/19 9:06 AM, Andrey Shinkevich wrote: > A new test file 242 added to the qemu-iotests set. It checks > the format of qcow2 specific information for the new added > section that lists details of bitmaps. > > Signed-off-by: Andrey Shinkevich > --- > tests/qemu-iotests/242 | 103 +

Re: [Qemu-block] [PATCH v14 0/3] qcow2: Add list of bitmaps to ImageInfoSpecificQCow2

2019-02-08 Thread Vladimir Sementsov-Ogievskiy
08.02.2019 18:25, Eric Blake wrote: > On 2/8/19 9:06 AM, Andrey Shinkevich wrote: >> v14: >> The test 242 was amended to be safer against changes in the bitmap allocation >> algorithm because the bitmap directory is reallocated on VM shutdown. >> Unfortunately, an empty line at the end of the bench

[Qemu-block] [PATCH] qcow2: Assert that L2 table offsets fit in the L1 table

2019-02-08 Thread Alberto Garcia
L1 table entries have a field to store the offset of an L2 table. The rest of the bits of the entry are currently reserved except from bit 63, which stores the COPIED flag. The offset is always taken from the entry using L1E_OFFSET_MASK to ensure that we only use the bits that belong to that field

Re: [Qemu-block] [PATCH v14 0/3] qcow2: Add list of bitmaps to ImageInfoSpecificQCow2

2019-02-08 Thread Andrey Shinkevich
On 08/02/2019 18:25, Eric Blake wrote: > On 2/8/19 9:06 AM, Andrey Shinkevich wrote: >> v14: >> The test 242 was amended to be safer against changes in the bitmap allocation >> algorithm because the bitmap directory is reallocated on VM shutdown. >> Unfortunately, an empty line at the end of the

Re: [Qemu-block] [PATCH RFC 1/1] Stream block job involves copy-on-read filter

2019-02-08 Thread Andrey Shinkevich
On 08/02/2019 16:13, Alberto Garcia wrote: > On Wed 23 Jan 2019 12:54:24 PM CET, Andrey Shinkevich wrote: >> +static BlockDriverState *insert_filter(BlockDriverState *bs, Error **errp) >> +{ >> +BlockDriverState *cor_filter_bs; >> +Error *local_err = NULL; >> + >> +cor_filter_bs = cre

Re: [Qemu-block] [PATCH v14 0/3] qcow2: Add list of bitmaps to ImageInfoSpecificQCow2

2019-02-08 Thread Eric Blake
On 2/8/19 9:06 AM, Andrey Shinkevich wrote: > v14: > The test 242 was amended to be safer against changes in the bitmap allocation > algorithm because the bitmap directory is reallocated on VM shutdown. > Unfortunately, an empty line at the end of the benchmark file 242.out > persists. Easy solut

[Qemu-block] [PATCH v14 2/3] qcow2: Add list of bitmaps to ImageInfoSpecificQCow2

2019-02-08 Thread Andrey Shinkevich
In the 'Format specific information' section of the 'qemu-img info' command output, the supplemental information about existing QCOW2 bitmaps will be shown, such as a bitmap name, flags and granularity: image: /vz/vmprivate/VM1/harddisk.hdd file format: qcow2 virtual size: 64G (68719476736 bytes)

[Qemu-block] [PATCH v14 0/3] qcow2: Add list of bitmaps to ImageInfoSpecificQCow2

2019-02-08 Thread Andrey Shinkevich
v14: The test 242 was amended to be safer against changes in the bitmap allocation algorithm because the bitmap directory is reallocated on VM shutdown. Unfortunately, an empty line at the end of the benchmark file 242.out persists. The version #13 was discussed in email thread with the message ID:

[Qemu-block] [PATCH v14 1/3] bdrv_query_image_info Error parameter added

2019-02-08 Thread Andrey Shinkevich
Inform a user in case qcow2_get_specific_info fails to obtain QCOW2 image specific information. This patch is preliminary to the one "qcow2: Add list of bitmaps to ImageInfoSpecificQCow2". Signed-off-by: Andrey Shinkevich Reviewed-by: Eric Blake Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewe

[Qemu-block] [PATCH v14 3/3] qcow2: list of bitmaps new test 242

2019-02-08 Thread Andrey Shinkevich
A new test file 242 added to the qemu-iotests set. It checks the format of qcow2 specific information for the new added section that lists details of bitmaps. Signed-off-by: Andrey Shinkevich --- tests/qemu-iotests/242 | 103 tests/qemu-iotests/242.out | 165

[Qemu-block] [PATCH] virtio-blk: cleanup using VirtIOBlock *s and VirtIODevice *vdev

2019-02-08 Thread Stefano Garzarella
In several part we still using req->dev or VIRTIO_DEVICE(req->dev) when we have already defined s and vdev pointers: VirtIOBlock *s = req->dev; VirtIODevice *vdev = VIRTIO_DEVICE(s); Signed-off-by: Stefano Garzarella --- hw/block/virtio-blk.c | 22 +- 1 file changed,

Re: [Qemu-block] [RFC PATCH] coroutines: generate wrapper code

2019-02-08 Thread Vladimir Sementsov-Ogievskiy
attached generated file -- Best regards, Vladimir /* * File is generated by scripts/coroutine-wrapper.py */ #include "qemu/osdep.h" #include "block/block_int.h" /* * Wrappers for bdrv_co_check */ typedef struct bdrv_co_check__ArgumentsPack { BlockDriverState *bs; BdrvCheckResult

[Qemu-block] [RFC PATCH] coroutines: generate wrapper code

2019-02-08 Thread Vladimir Sementsov-Ogievskiy
Hi all! We have a very frequent pattern of wrapping a coroutine_fn function to be called from non-coroutine context: - create structure to pack parameters - create function to call original function taking parameters from struct - create wrapper, which in case of non-coroutine context w

[Qemu-block] [PATCH v4 6/6] tests/virtio-blk: add test for WRITE_ZEROES command

2019-02-08 Thread Stefano Garzarella
If the WRITE_ZEROES feature is enabled, we check this command in the test_basic(). Reviewed-by: Michael S. Tsirkin Reviewed-by: Stefan Hajnoczi Acked-by: Thomas Huth Signed-off-by: Stefano Garzarella --- tests/virtio-blk-test.c | 60 + 1 file changed, 6

[Qemu-block] [PATCH v4 4/6] virtio-blk: add DISCARD and WRITE_ZEROES features

2019-02-08 Thread Stefano Garzarella
This patch adds the support of DISCARD and WRITE_ZEROES commands, that have been introduced in the virtio-blk protocol to have better performance when using SSD backend. We support only one segment per request since multiple segments are not widely used and there are no userspace APIs that allow a

[Qemu-block] [PATCH v4 5/6] tests/virtio-blk: change assert on data_size in virtio_blk_request()

2019-02-08 Thread Stefano Garzarella
The size of data in the virtio_blk_request must be a multiple of 512 bytes for IN and OUT requests, or a multiple of the size of struct virtio_blk_discard_write_zeroes for DISCARD and WRITE_ZEROES requests. Reviewed-by: Michael S. Tsirkin Reviewed-by: Stefan Hajnoczi Reviewed-by: Thomas Huth Si

[Qemu-block] [PATCH v4 3/6] virtio-blk: add "discard" and "write-zeroes" properties

2019-02-08 Thread Stefano Garzarella
In order to avoid migration issues, we enable DISCARD and WRITE_ZEROES features only for machine type >= 4.0 As discussed with Michael S. Tsirkin and Stefan Hajnoczi on the list [1], DISCARD operation should not have security implications (eg. page cache attacks), so we can enable it by default.

[Qemu-block] [PATCH v4 2/6] virtio-blk: add host_features field in VirtIOBlock

2019-02-08 Thread Stefano Garzarella
Since configurable features for virtio-blk are growing, this patch adds host_features field in the struct VirtIOBlock. (as in virtio-net) In this way, we can avoid to add new fields for new properties and we can directly set VIRTIO_BLK_F* flags in the host_features. We update "config-wce" and "scs

[Qemu-block] [PATCH v4 0/6] virtio-blk: add DISCARD and WRITE_ZEROES features

2019-02-08 Thread Stefano Garzarella
This series adds the support of DISCARD and WRITE_ZEROES commands and extends the virtio-blk-test to test WRITE_ZEROES command when the feature is enabled. v4: - fixed error with mingw compiler in patch 4 gcc and clang want %lu, but mingw wants %llu for BDRV_REQUEST_MAX_SECTORS. Since is less

[Qemu-block] [PATCH v4 1/6] virtio-blk: add acct_failed param to virtio_blk_handle_rw_error()

2019-02-08 Thread Stefano Garzarella
We add acct_failed param in order to use virtio_blk_handle_rw_error() also when is not required to call block_acct_failed(). (eg. a discard operation is failed) Reviewed-by: Michael S. Tsirkin Reviewed-by: Stefan Hajnoczi Signed-off-by: Stefano Garzarella --- hw/block/virtio-blk.c | 10 ++-

Re: [Qemu-block] [PATCH RFC 1/1] Stream block job involves copy-on-read filter

2019-02-08 Thread Alberto Garcia
On Wed 23 Jan 2019 12:54:24 PM CET, Andrey Shinkevich wrote: > +static BlockDriverState *insert_filter(BlockDriverState *bs, Error **errp) > +{ > +BlockDriverState *cor_filter_bs; > +Error *local_err = NULL; > + > +cor_filter_bs = create_filter_node(bs, errp); > +if (cor_filter_bs =

Re: [Qemu-block] [PATCH v5 1/6] Stream block job involves copy-on-read filter driver

2019-02-08 Thread Alberto Garcia
On Sun 30 Dec 2018 09:09:12 PM CET, Andrey Shinkevich wrote: > +static BlockDriverState *child_file_bs(BlockDriverState *bs) > +{ > +return bs->file ? bs->file->bs : NULL; > +} In addition to Vladimir's comments, I wonder if it's useful to put this in block_int.h (together with backing_bs()).

[Qemu-block] [PATCH v3 03/13] vhost-user: simplify vhost_user_init/vhost_user_cleanup

2019-02-08 Thread Marc-André Lureau
Take a VhostUserState* that can be pre-allocated, and initialize it with the associated chardev. Signed-off-by: Marc-André Lureau Reviewed-by: Tiwei Bie --- include/hw/virtio/vhost-user-blk.h | 2 +- include/hw/virtio/vhost-user-scsi.h | 2 +- include/hw/virtio/vhost-user.h | 2 +- bac

Re: [Qemu-block] [PATCH] block: skip initializer BDS on recursive aio context attachment/detachment

2019-02-08 Thread Kevin Wolf
Am 24.01.2019 um 08:48 hat Denis Plotnikov geschrieben: > When there is a Backup Block Job running and shutdown command is sent to > a guest, the guest crushes due to assert(!bs->walking_aio_notifiers). > > Call stack: > > 0 __GI_raise > 1 __GI_abort > 2 __assert_fail_base > 3 __GI___assert_f

Re: [Qemu-block] [Qemu-devel] [PATCH] block: skip initializer BDS on recursive aio context attachment/detachment

2019-02-08 Thread Denis Plotnikov
ping ping! On 24.01.2019 10:48, Denis Plotnikov wrote: > When there is a Backup Block Job running and shutdown command is sent to > a guest, the guest crushes due to assert(!bs->walking_aio_notifiers). > > Call stack: > > 0 __GI_raise > 1 __GI_abort > 2 __assert_fail_base > 3 __GI___assert_f

Re: [Qemu-block] [PATCH v3 0/6] virtio-blk: add DISCARD and WRITE_ZEROES features

2019-02-08 Thread Stefano Garzarella
On Fri, Feb 08, 2019 at 02:06:18PM +0800, Stefan Hajnoczi wrote: > On Wed, Feb 06, 2019 at 12:27:23PM +0100, Stefano Garzarella wrote: > > This series adds the support of DISCARD and WRITE_ZEROES commands > > and extends the virtio-blk-test to test WRITE_ZEROES command when > > the feature is enabl