[Qemu-block] [PATCH v6 4/8] scsi: Propagate unrealize() callback to scsi-hd

2019-08-27 Thread Sam Eiderman via Qemu-block
From: Sam Eiderman We will need to add LCHS removal logic to scsi-hd's unrealize() in the next commit. Signed-off-by: Sam Eiderman Reviewed-by: Karl Heubaum Reviewed-by: Arbel Moshe Signed-off-by: Sam Eiderman --- hw/scsi/scsi-bus.c | 16 include/hw/scsi/scsi.h | 1 +

[Qemu-block] [PATCH v6 7/8] bootdevice: FW_CFG interface for LCHS values

2019-08-27 Thread Sam Eiderman via Qemu-block
From: Sam Eiderman Using fw_cfg, supply logical CHS values directly from QEMU to the BIOS. Non-standard logical geometries break under QEMU. A virtual disk which contains an operating system which depends on logical geometries (consistent values being reported from BIOS INT13 AH=08) will most

Re: [Qemu-block] [Qemu-devel] [PATCH 06/13] qcrypto-luks: implement more rigorous header checking

2019-08-27 Thread Daniel P . Berrangé
On Sun, Aug 25, 2019 at 07:08:00PM +0300, Maxim Levitsky wrote: > On Sun, 2019-08-25 at 18:40 +0300, Maxim Levitsky wrote: > > On Thu, 2019-08-22 at 12:04 +0100, Daniel P. Berrangé wrote: > > > On Wed, Aug 14, 2019 at 11:22:12PM +0300, Maxim Levitsky wrote: > > > > Check that keyslots don't

Re: [Qemu-block] [Qemu-devel] [PATCH v6 0/8] Add Qemu to SeaBIOS LCHS interface

2019-08-27 Thread no-reply
Patchew URL: https://patchew.org/QEMU/20190827082427.64280-1-sam...@google.com/ Hi, This series seems to have some coding style problems. See output below for more information: Message-id: 20190827082427.64280-1-sam...@google.com Type: series Subject: [Qemu-devel] [PATCH v6 0/8] Add Qemu to

[Qemu-block] [PATCH v6 1/8] block: Refactor macros - fix tabbing

2019-08-27 Thread Sam Eiderman via Qemu-block
From: Sam Eiderman Fixing tabbing in block related macros. Reviewed-by: Karl Heubaum Reviewed-by: Arbel Moshe Signed-off-by: Sam Eiderman --- hw/ide/qdev.c| 2 +- include/hw/block/block.h | 16 2 files changed, 9 insertions(+), 9 deletions(-) diff --git

[Qemu-block] [PATCH v6 0/8] Add Qemu to SeaBIOS LCHS interface

2019-08-27 Thread Sam Eiderman via Qemu-block
v1: Non-standard logical geometries break under QEMU. A virtual disk which contains an operating system which depends on logical geometries (consistent values being reported from BIOS INT13 AH=08) will most likely break under QEMU/SeaBIOS if it has non-standard logical geometries - for example

[Qemu-block] [PATCH v6 2/8] block: Support providing LCHS from user

2019-08-27 Thread Sam Eiderman via Qemu-block
From: Sam Eiderman Add logical geometry variables to BlockConf. A user can now supply "lcyls", "lheads" & "lsecs" for any HD device that supports CHS ("cyls", "heads", "secs"). These devices include: * ide-hd * scsi-hd * virtio-blk-pci In future commits we will use the provided

Re: [Qemu-block] [Qemu-devel] [PATCH v2 1/2] nbd: Use g_autofree in a few places

2019-08-27 Thread Daniel P . Berrangé
On Sat, Aug 24, 2019 at 12:28:12PM -0500, Eric Blake wrote: > Thanks to our recent move to use glib's g_autofree, I can join the > bandwagon. Getting rid of gotos is fun ;) > > There are probably more places where we could register cleanup > functions and get rid of more gotos; this patch just

Re: [Qemu-block] [Qemu-devel] [PATCH 05/13] qcrypto-luks: clear the masterkey and password before freeing them always

2019-08-27 Thread Daniel P . Berrangé
On Sun, Aug 25, 2019 at 06:31:02PM +0300, Maxim Levitsky wrote: > On Thu, 2019-08-22 at 13:56 +0300, Maxim Levitsky wrote: > > On Thu, 2019-08-22 at 11:49 +0100, Daniel P. Berrangé wrote: > > > On Tue, Aug 20, 2019 at 08:12:51PM +0200, Max Reitz wrote: > > > > On 14.08.19 22:22, Maxim Levitsky

Re: [Qemu-block] [Qemu-devel] [PATCH v6 0/8] Add Qemu to SeaBIOS LCHS interface

2019-08-27 Thread no-reply
Patchew URL: https://patchew.org/QEMU/20190827082427.64280-1-sam...@google.com/ Hi, This series seems to have some coding style problems. See output below for more information: Message-id: 20190827082427.64280-1-sam...@google.com Type: series Subject: [Qemu-devel] [PATCH v6 0/8] Add Qemu to

Re: [Qemu-block] [Qemu-devel] [PATCH] file-posix: fix request_alignment typo

2019-08-27 Thread Thomas Huth
On 27/08/2019 12.13, Stefan Hajnoczi wrote: > Fixes: a6b257a08e3d72219f03e461a52152672fec0612 >("file-posix: Handle undetectable alignment") > Signed-off-by: Stefan Hajnoczi > --- > block/file-posix.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git

Re: [Qemu-block] [Qemu-devel] [PATCH v2 01/13] introduce g_autowipe

2019-08-27 Thread Maxim Levitsky
On Tue, 2019-08-27 at 11:52 +0100, Daniel P. Berrangé wrote: > On Mon, Aug 26, 2019 at 04:50:51PM +0300, Maxim Levitsky wrote: > > Marking a pointer with g_autowipe, will > > not only free it at the scope exit, but also > > erase the data it points to just prior to freeing it. > > > > This is

Re: [Qemu-block] [PATCH] block: workaround for unaligned byte range in fallocate()

2019-08-27 Thread Denis V. Lunev
On 8/22/19 11:09 PM, Eric Blake wrote: > On 8/22/19 1:31 PM, Andrey Shinkevich wrote: >> Revert the commit 118f99442d 'block/io.c: fix for the allocation failure' >> and make better error handling for the file systems that do not support > s/make/use/ > >> fallocate() for the unaligned byte range.

Re: [Qemu-block] [Qemu-devel] [PATCH v2 01/13] introduce g_autowipe

2019-08-27 Thread Tony Nguyen
Hi Maxim, On Mon, Aug 26, 2019 at 04:50:51PM +0300, Maxim Levitsky wrote: > 2. is it portable enought for us to use malloc_usable_size > to get the size of malloced pointer in the autofree callback? > This function is aviable in glibc (but no wrapper in glib). We will also need to consider host

Re: [Qemu-block] [PATCH v3 1/3] qcow2: introduce compression type feature

2019-08-27 Thread Vladimir Sementsov-Ogievskiy
19.08.2019 18:00, Denis Plotnikov wrote: > The patch adds some preparation parts for incompatible compression type > feature to QCOW2 header that indicates that *all* compressed clusters > must be (de)compressed using a certain compression type. > > It is implied that the compression type is set

Re: [Qemu-block] [Libguestfs] [libnbd PATCH 1/1] api: Add support for FAST_ZERO flag

2019-08-27 Thread Richard W.M. Jones
Yes this libnbd patch all looks reasonable to me. ACK conditional on NBD protocol changes and agreement as discussed elsewhere. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com

[Qemu-block] [PATCH] file-posix: fix request_alignment typo

2019-08-27 Thread Stefan Hajnoczi
Fixes: a6b257a08e3d72219f03e461a52152672fec0612 ("file-posix: Handle undetectable alignment") Signed-off-by: Stefan Hajnoczi --- block/file-posix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/file-posix.c b/block/file-posix.c index fbeb0068db..67abd1f01c

Re: [Qemu-block] [Libguestfs] cross-project patches: Add NBD Fast Zero support

2019-08-27 Thread Richard W.M. Jones
On Fri, Aug 23, 2019 at 09:30:36AM -0500, Eric Blake wrote: > I've run several tests to demonstrate why this is useful, as well as > prove that because I have multiple interoperable projects, it is worth > including in the NBD standard. The original proposal was here: >

Re: [Qemu-block] [PATCH] block: workaround for unaligned byte range in fallocate()

2019-08-27 Thread Andrey Shinkevich
On 23/08/2019 00:09, Eric Blake wrote: > On 8/22/19 1:31 PM, Andrey Shinkevich wrote: >> Revert the commit 118f99442d 'block/io.c: fix for the allocation failure' >> and make better error handling for the file systems that do not support > > s/make/use/ > >> fallocate() for the unaligned byte

Re: [Qemu-block] [Qemu-devel] [PATCH v2 01/13] introduce g_autowipe

2019-08-27 Thread Daniel P . Berrangé
On Mon, Aug 26, 2019 at 04:50:51PM +0300, Maxim Levitsky wrote: > Marking a pointer with g_autowipe, will > not only free it at the scope exit, but also > erase the data it points to just prior to freeing it. > > This is first attempt to implement this feature, > as suggested by Daniel and Nir. >

Re: [Qemu-block] [PATCH v3 2/3] qcow2: rework the cluster compression routine

2019-08-27 Thread Vladimir Sementsov-Ogievskiy
19.08.2019 18:00, Denis Plotnikov wrote: > The patch allow to process image compression type defined > in the image header and choose an appropriate method for > image clusters (de)compression. > > Signed-off-by: Denis Plotnikov > --- > block/qcow2-threads.c | 78

[Qemu-block] [PATCH v6 6/8] bootdevice: Refactor get_boot_devices_list

2019-08-27 Thread Sam Eiderman via Qemu-block
From: Sam Eiderman Move device name construction to a separate function. We will reuse this function in the following commit to pass logical CHS parameters through fw_cfg much like we currently pass bootindex. Reviewed-by: Karl Heubaum Reviewed-by: Arbel Moshe Signed-off-by: Sam Eiderman

[Qemu-block] [PATCH v6 3/8] bootdevice: Add interface to gather LCHS

2019-08-27 Thread Sam Eiderman via Qemu-block
From: Sam Eiderman Add an interface to provide direct logical CHS values for boot devices. We will use this interface in the next commits. Reviewed-by: Karl Heubaum Reviewed-by: Arbel Moshe Signed-off-by: Sam Eiderman --- bootdevice.c| 55

[Qemu-block] [PATCH v6 5/8] bootdevice: Gather LCHS from all relevant devices

2019-08-27 Thread Sam Eiderman via Qemu-block
From: Sam Eiderman Relevant devices are: * ide-hd (and ide-cd, ide-drive) * scsi-hd (and scsi-cd, scsi-disk, scsi-block) * virtio-blk-pci We do not call del_boot_device_lchs() for ide-* since we don't need to - IDE block devices do not support unplugging. Signed-off-by: Sam

Re: [Qemu-block] [Qemu-devel] [PATCH v2 2/2] nbd: Tolerate more errors to structured reply request

2019-08-27 Thread Daniel P . Berrangé
On Sat, Aug 24, 2019 at 12:28:13PM -0500, Eric Blake wrote: > A server may have a reason to reject a request for structured replies, > beyond just not recognizing them as a valid request; similarly, it may > have a reason for rejecting a request for a meta context. It doesn't > hurt us to

[Qemu-block] [PATCH 0/6] block/curl: Fix hang and potential crash

2019-08-27 Thread Max Reitz
Hi, As reported in https://bugzilla.redhat.com/show_bug.cgi?id=1740193, our curl block driver can spontaneously hang. This becomes visible e.g. when reading compressed qcow2 images: $ qemu-img convert -p -O raw -n \ https://download.cirros-cloud.net/0.4.0/cirros-0.4.0-x86_64-disk.img \

[Qemu-block] [PATCH 1/6] curl: Keep pointer to the CURLState in CURLSocket

2019-08-27 Thread Max Reitz
A follow-up patch will make curl_multi_do() and curl_multi_read() take a CURLSocket instead of the CURLState. They still need the latter, though, so add a pointer to it to the former. Cc: qemu-sta...@nongnu.org Signed-off-by: Max Reitz --- block/curl.c | 3 +++ 1 file changed, 3 insertions(+)

Re: [Qemu-block] [PATCH] block: workaround for unaligned byte range in fallocate()

2019-08-27 Thread Eric Blake
On 8/27/19 7:39 AM, Andrey Shinkevich wrote: > > >>> >> >> Reviewed-by: Eric Blake >> > Eric, > If you are good to take this patch to your branch with your corrections, > please let us know. Otherwise, I will send the v2 with your corrections. Since I based my fast-zero patches on top of

Re: [Qemu-block] [PATCH v2 1/2] nbd: Use g_autofree in a few places

2019-08-27 Thread Vladimir Sementsov-Ogievskiy
24.08.2019 20:28, Eric Blake wrote: > Thanks to our recent move to use glib's g_autofree, I can join the > bandwagon. Getting rid of gotos is fun ;) > > There are probably more places where we could register cleanup > functions and get rid of more gotos; this patch just focuses on the > labels

Re: [Qemu-block] [PATCH v2] block: workaround for unaligned byte range in fallocate()

2019-08-27 Thread Eric Blake
On 8/27/19 8:52 AM, Andrey Shinkevich wrote: > Revert the commit 118f99442d 'block/io.c: fix for the allocation failure' > and use better error handling for file systems that do not support > fallocate() for an unaligned byte range. Allow falling back to pwrite > in case fallocate() returns

Re: [Qemu-block] [Libguestfs] cross-project patches: Add NBD Fast Zero support

2019-08-27 Thread Eric Blake
On 8/27/19 7:14 AM, Richard W.M. Jones wrote: > > Is the plan to wait until NBD_CMF_FLAG_FAST_ZERO gets into the NBD > protocol doc before doing the rest? Also I would like to release both > libnbd 1.0 and nbdkit 1.14 before we introduce any large new features. > Both should be released this

Re: [Qemu-block] [PATCH v3 3/3] qcow2: add zstd cluster compression

2019-08-27 Thread Vladimir Sementsov-Ogievskiy
19.08.2019 18:00, Denis Plotnikov wrote: > zstd significantly reduces cluster compression time. > It provides better compression performance maintaining > the same level of compression ratio in comparison with > zlib, which, at the moment, has been the only compression > method available. > > The

[Qemu-block] [PATCH v2] block: workaround for unaligned byte range in fallocate()

2019-08-27 Thread Andrey Shinkevich
Revert the commit 118f99442d 'block/io.c: fix for the allocation failure' and use better error handling for file systems that do not support fallocate() for an unaligned byte range. Allow falling back to pwrite in case fallocate() returns EINVAL. Suggested-by: Kevin Wolf Suggested-by: Eric Blake

Re: [Qemu-block] [PATCH v2] block: workaround for unaligned byte range in fallocate()

2019-08-27 Thread Andrey Shinkevich
On 27/08/2019 16:55, Eric Blake wrote: > On 8/27/19 8:52 AM, Andrey Shinkevich wrote: >> Revert the commit 118f99442d 'block/io.c: fix for the allocation failure' >> and use better error handling for file systems that do not support >> fallocate() for an unaligned byte range. Allow falling back

Re: [Qemu-block] [PATCH v2] block: workaround for unaligned byte range in fallocate()

2019-08-27 Thread Andrey Shinkevich
On 27/08/2019 16:55, Eric Blake wrote: > On 8/27/19 8:52 AM, Andrey Shinkevich wrote: >> Revert the commit 118f99442d 'block/io.c: fix for the allocation failure' >> and use better error handling for file systems that do not support >> fallocate() for an unaligned byte range. Allow falling back

[Qemu-block] [PULL 09/12] block/io: introduce bdrv_co_p{read, write}v_part

2019-08-27 Thread Stefan Hajnoczi
From: Vladimir Sementsov-Ogievskiy Introduce extended variants of bdrv_co_preadv and bdrv_co_pwritev with qiov_offset parameter. Signed-off-by: Vladimir Sementsov-Ogievskiy Acked-by: Stefan Hajnoczi Message-id: 20190604161514.262241-10-vsement...@virtuozzo.com Message-Id:

[Qemu-block] [PULL 10/12] block/qcow2: refactor qcow2_co_preadv to use buffer-based io

2019-08-27 Thread Stefan Hajnoczi
From: Vladimir Sementsov-Ogievskiy Use buffer based io in encrypted case. Signed-off-by: Vladimir Sementsov-Ogievskiy Acked-by: Stefan Hajnoczi Message-id: 20190604161514.262241-11-vsement...@virtuozzo.com Message-Id: <20190604161514.262241-11-vsement...@virtuozzo.com> Signed-off-by: Stefan

Re: [Qemu-block] [Qemu-devel] [PATCH 1/2] block/nvme: add support for write zeros

2019-08-27 Thread John Snow
Without a commit message, I have no real hope of reviewing this. I was CC'd, though, so I'll give it a blind shot. We want to add write_zeroes support for block/nvme, but I can't really verify any of that is correct or working without a unit test, a spec, or some instructions to help me verify

[Qemu-block] [PULL 00/12] Block patches

2019-08-27 Thread Stefan Hajnoczi
The following changes since commit dac03af5d5482ec7ee9c23db467bb7230b33c0d9: Merge remote-tracking branch 'remotes/rth/tags/pull-axp-20190825' into staging (2019-08-27 10:00:51 +0100) are available in the Git repository at: https://github.com/stefanha/qemu.git tags/block-pull-request for

[Qemu-block] [PULL 01/12] util/iov: introduce qemu_iovec_init_extended

2019-08-27 Thread Stefan Hajnoczi
From: Vladimir Sementsov-Ogievskiy Introduce new initialization API, to create requests with padding. Will be used in the following patch. New API uses qemu_iovec_init_buf if resulting io vector has only one element, to avoid extra allocations. So, we need to update qemu_iovec_destroy to support

Re: [Qemu-block] [Qemu-devel] [PATCH 2/2] block/nvme: add support for discard

2019-08-27 Thread John Snow
On 8/25/19 3:15 AM, Maxim Levitsky wrote: > Signed-off-by: Maxim Levitsky > --- > block/nvme.c | 83 ++ > block/trace-events | 2 ++ > 2 files changed, 85 insertions(+) > > diff --git a/block/nvme.c b/block/nvme.c > index

Re: [Qemu-block] [PATCH v5 1/6] iotests: allow Valgrind checking all QEMU processes

2019-08-27 Thread John Snow
On 8/25/19 11:26 AM, Andrey Shinkevich wrote: > > > On 16/08/2019 01:49, John Snow wrote: >> >> >> On 7/19/19 12:30 PM, Andrey Shinkevich wrote: >>> With the '-valgrind' option, let all the QEMU processes be run under >>> the Valgrind tool. The Valgrind own parameters may be set with its >>>

[Qemu-block] [PULL 02/12] util/iov: improve qemu_iovec_is_zero

2019-08-27 Thread Stefan Hajnoczi
From: Vladimir Sementsov-Ogievskiy We'll need to check a part of qiov soon, so implement it now. Optimization with align down to 4 * sizeof(long) is dropped due to: 1. It is strange: it aligns length of the buffer, but where is a guarantee that buffer pointer is aligned itself? 2.

[Qemu-block] [PULL 12/12] block/qcow2: implement .bdrv_co_pwritev(_compressed)_part

2019-08-27 Thread Stefan Hajnoczi
From: Vladimir Sementsov-Ogievskiy Implement and use new interface to get rid of hd_qiov. Signed-off-by: Vladimir Sementsov-Ogievskiy Acked-by: Stefan Hajnoczi Message-id: 20190604161514.262241-13-vsement...@virtuozzo.com Message-Id: <20190604161514.262241-13-vsement...@virtuozzo.com>

[Qemu-block] [PULL 06/12] block/io: bdrv_co_do_copy_on_readv: lazy allocation

2019-08-27 Thread Stefan Hajnoczi
From: Vladimir Sementsov-Ogievskiy Allocate bounce_buffer only if it is really needed. Also, sub-optimize allocation size (why not?). Signed-off-by: Vladimir Sementsov-Ogievskiy Acked-by: Stefan Hajnoczi Message-id: 20190604161514.262241-7-vsement...@virtuozzo.com Message-Id:

[Qemu-block] [PULL 08/12] block/io: bdrv_aligned_pwritev: use and support qiov_offset

2019-08-27 Thread Stefan Hajnoczi
From: Vladimir Sementsov-Ogievskiy Use and support new API in bdrv_aligned_pwritev. Signed-off-by: Vladimir Sementsov-Ogievskiy Acked-by: Stefan Hajnoczi Message-id: 20190604161514.262241-9-vsement...@virtuozzo.com Message-Id: <20190604161514.262241-9-vsement...@virtuozzo.com> Signed-off-by:

[Qemu-block] [PULL 03/12] block/io: refactor padding

2019-08-27 Thread Stefan Hajnoczi
From: Vladimir Sementsov-Ogievskiy We have similar padding code in bdrv_co_pwritev, bdrv_co_do_pwrite_zeroes and bdrv_co_preadv. Let's combine and unify it. [Squashed in Vladimir's qemu-iotests 077 fix --Stefan] Signed-off-by: Vladimir Sementsov-Ogievskiy Acked-by: Stefan Hajnoczi

[Qemu-block] [PULL 07/12] block/io: bdrv_aligned_preadv: use and support qiov_offset

2019-08-27 Thread Stefan Hajnoczi
From: Vladimir Sementsov-Ogievskiy Use and support new API in bdrv_co_do_copy_on_readv. Signed-off-by: Vladimir Sementsov-Ogievskiy Acked-by: Stefan Hajnoczi Message-id: 20190604161514.262241-8-vsement...@virtuozzo.com Message-Id: <20190604161514.262241-8-vsement...@virtuozzo.com>

[Qemu-block] [PULL 04/12] block: define .*_part io handlers in BlockDriver

2019-08-27 Thread Stefan Hajnoczi
From: Vladimir Sementsov-Ogievskiy Add handlers supporting qiov_offset parameter: bdrv_co_preadv_part bdrv_co_pwritev_part bdrv_co_pwritev_compressed_part This is used to reduce need of defining local_qiovs and hd_qiovs in all corners of block layer code. The following patches will

Re: [Qemu-block] [PATCH 2/2] qapi: deprecate implicit filters

2019-08-27 Thread John Snow
On 8/23/19 5:22 AM, Vladimir Sementsov-Ogievskiy wrote: > 14.08.2019 13:07, Vladimir Sementsov-Ogievskiy wrote: >> To get rid of implicit filters related workarounds in future let's >> deprecate them now. > > Interesting, could we deprecate implicit filter without deprecation of > unnecessity

Re: [Qemu-block] [Qemu-devel] [PATCH 0/2] block: Let blockdev-create return 0 on success

2019-08-27 Thread John Snow
On 8/23/19 2:47 PM, Max Reitz wrote: > Jobs are expected to return 0 on success. .bdrv_co_create() on the > other hand is a block layer function, and as such returns a non-negative > value on success. > > blockdev_create_run() should translate between the two (patch 1). > > Without patch 1,

Re: [Qemu-block] [Qemu-devel] [PATCH 2/2] iotests: Test blockdev-create for vpc

2019-08-27 Thread John Snow
On 8/23/19 2:47 PM, Max Reitz wrote: > Signed-off-by: Max Reitz > --- > tests/qemu-iotests/266 | 182 + > tests/qemu-iotests/266.out | 107 ++ > tests/qemu-iotests/group | 1 + > 3 files changed, 290 insertions(+) > create mode

[Qemu-block] [PULL 05/12] block/io: bdrv_co_do_copy_on_readv: use and support qiov_offset

2019-08-27 Thread Stefan Hajnoczi
From: Vladimir Sementsov-Ogievskiy Use and support new API in bdrv_co_do_copy_on_readv. Note that in case of allocated-in-top we need to shrink read size to MIN(..) by hand, as pre-patch this was actually done implicitly by qemu_iovec_concat (and we used local_qiov.size). Signed-off-by:

[Qemu-block] [PULL 11/12] block/qcow2: implement .bdrv_co_preadv_part

2019-08-27 Thread Stefan Hajnoczi
From: Vladimir Sementsov-Ogievskiy Implement and use new interface to get rid of hd_qiov. Signed-off-by: Vladimir Sementsov-Ogievskiy Acked-by: Stefan Hajnoczi Message-id: 20190604161514.262241-12-vsement...@virtuozzo.com Message-Id: <20190604161514.262241-12-vsement...@virtuozzo.com>

[Qemu-block] [PULL 01/15] qemu-io: add pattern file for write command

2019-08-27 Thread Max Reitz
From: Denis Plotnikov The patch allows to provide a pattern file for write command. There was no similar ability before. Signed-off-by: Denis Plotnikov Message-id: 20190820164616.4072-1-dplotni...@virtuozzo.com Reviewed-by: Eric Blake [mreitz: Keep optstring in alphabetical order]

[Qemu-block] [PULL 04/15] iotests: Test allocate_first_block() with O_DIRECT

2019-08-27 Thread Max Reitz
From: Nir Soffer Using block_resize we can test allocate_first_block() with file descriptor opened with O_DIRECT, ensuring that it works for any size larger than 4096 bytes. Testing smaller sizes is tricky as the result depends on the filesystem used for testing. For example on NFS any size

Re: [Qemu-block] [PATCH] iotests: Unify cache mode quoting

2019-08-27 Thread Nir Soffer
On Tue, Aug 27, 2019 at 8:43 PM Max Reitz wrote: > > On 27.08.19 19:38, Nir Soffer wrote: > > On Tue, Aug 27, 2019 at 8:36 PM Max Reitz > > wrote: > > > > On 27.08.19 19:34, Nir Soffer wrote: > > > Quoting cache mode is not needed, and most tests use unquoted

[Qemu-block] [PULL 00/15] Block patches

2019-08-27 Thread Max Reitz
The following changes since commit 23919ddfd56135cad3cb468a8f54d5a595f024f4: Merge remote-tracking branch 'remotes/aperard/tags/pull-xen-20190827' into staging (2019-08-27 15:52:36 +0100) are available in the Git repository at: https://github.com/XanClic/qemu.git tags/pull-block-2019-08-27

[Qemu-block] [PULL 06/15] vmdk: Use bdrv_dirname() for relative extent paths

2019-08-27 Thread Max Reitz
This makes iotest 033 pass with e.g. subformat=monolithicFlat. It also turns a former error in 059 into success. Signed-off-by: Max Reitz Message-id: 20190815153638.4600-3-mre...@redhat.com Reviewed-by: John Snow Signed-off-by: Max Reitz --- block/vmdk.c | 54

[Qemu-block] [PULL 07/15] iotests: Keep testing broken relative extent paths

2019-08-27 Thread Max Reitz
We had a test for a case where relative extent paths did not work, but unfortunately we just fixed the underlying problem, so it works now. This patch adds a new test case that still fails. Signed-off-by: Max Reitz Reviewed-by: John Snow Message-id: 20190815153638.4600-4-mre...@redhat.com

[Qemu-block] [PULL 03/15] block: posix: Always allocate the first block

2019-08-27 Thread Max Reitz
From: Nir Soffer When creating an image with preallocation "off" or "falloc", the first block of the image is typically not allocated. When using Gluster storage backed by XFS filesystem, reading this block using direct I/O succeeds regardless of request length, fooling alignment detection. In

[Qemu-block] [PULL 02/15] block: fix permission update in bdrv_replace_node

2019-08-27 Thread Max Reitz
From: Vladimir Sementsov-Ogievskiy It's wrong to OR shared permissions. It may lead to crash on further permission updates. Also, no needs to consider previously calculated permissions, as at this point we already bind all new parents and bdrv_get_cumulative_perm result is enough. So fix the bug

[Qemu-block] [PULL 10/15] iotests: Disable 110 for vmdk.twoGbMaxExtentSparse

2019-08-27 Thread Max Reitz
The error message for the test case where we have a quorum node for which no directory name can be generated is different: For twoGbMaxExtentSparse, it complains that it cannot open the extent file. For other (sub)formats, it just notes that it cannot determine the backing file path. Both are

[Qemu-block] [PULL 09/15] iotests: Disable broken streamOptimized tests

2019-08-27 Thread Max Reitz
streamOptimized does not support writes that do not span exactly one cluster. Furthermore, it cannot rewrite already allocated clusters. As such, many iotests do not work with it. Disable them. Signed-off-by: Max Reitz Message-id: 20190815153638.4600-6-mre...@redhat.com Reviewed-by: John Snow

[Qemu-block] [PULL 08/15] vmdk: Reject invalid compressed writes

2019-08-27 Thread Max Reitz
Compressed writes generally have to write full clusters, not just in theory but also in practice when it comes to vmdk's streamOptimized subformat. It currently is just silently broken for writes with non-zero in-cluster offsets: $ qemu-img create -f vmdk -o subformat=streamOptimized foo.vmdk 1M

[Qemu-block] [PULL 05/15] iotests: Fix _filter_img_create()

2019-08-27 Thread Max Reitz
fe646693acc changed qemu-img create's output so that it no longer prints single quotes around parameter values. The subformat and adapter_type filters in _filter_img_create() have never been adapted to that change. Fixes: fe646693acc13ac48b98435d14149ab04dc597bc Signed-off-by: Max Reitz

[Qemu-block] [PULL 15/15] iotests: Unify cache mode quoting

2019-08-27 Thread Max Reitz
From: Nir Soffer Quoting cache mode is not needed, and most tests use unquoted values. Unify all test to use the same style. Message-id: 20190827173432.7656-1-nsof...@redhat.com Signed-off-by: Nir Soffer Signed-off-by: Max Reitz --- tests/qemu-iotests/026 | 4 ++-- tests/qemu-iotests/039 | 4

[Qemu-block] [PULL 13/15] iotests: Check for enabled drivers before testing them

2019-08-27 Thread Max Reitz
From: Thomas Huth It is possible to enable only a subset of the block drivers with the "--block-drv-rw-whitelist" option of the "configure" script. All other drivers are marked as unusable (or only included as read-only with the "--block-drv-ro-whitelist" option). If an iotest is now using such

[Qemu-block] [PULL 14/15] tests/check-block: Skip iotests when sanitizers are enabled

2019-08-27 Thread Max Reitz
From: Thomas Huth The sanitizers (especially the address sanitizer from Clang) are sometimes printing out warnings or false positives - this spoils the output of the iotests, causing some of the tests to fail. Thus let's skip the automatic iotests during "make check" when the user configured

[Qemu-block] [PULL 12/15] file-posix: fix request_alignment typo

2019-08-27 Thread Max Reitz
From: Stefan Hajnoczi Fixes: a6b257a08e3d72219f03e461a52152672fec0612 ("file-posix: Handle undetectable alignment") Signed-off-by: Stefan Hajnoczi Message-id: 20190827101328.4062-1-stefa...@redhat.com Reviewed-by: Thomas Huth Signed-off-by: Max Reitz --- block/file-posix.c | 2 +- 1

[Qemu-block] [PULL 11/15] iotests: Disable 126 for flat vmdk subformats

2019-08-27 Thread Max Reitz
iotest 126 requires backing file support, which flat vmdks cannot offer. Skip this test for such subformats. Signed-off-by: Max Reitz Message-id: 20190815153638.4600-8-mre...@redhat.com Reviewed-by: John Snow Signed-off-by: Max Reitz --- tests/qemu-iotests/126 | 2 ++ 1 file changed, 2

Re: [Qemu-block] [Qemu-devel] [PATCH] iotests: Unify cache mode quoting

2019-08-27 Thread no-reply
Patchew URL: https://patchew.org/QEMU/20190827173432.7656-1-nsof...@redhat.com/ Hi, This series seems to have some coding style problems. See output below for more information: Message-id: 20190827173432.7656-1-nsof...@redhat.com Type: series Subject: [Qemu-devel] [PATCH] iotests: Unify cache

[Qemu-block] [PATCH v2 1/2] block: Use QEMU_IS_ALIGNED

2019-08-27 Thread Nir Soffer
Replace instances of: (n & (BDRV_SECTOR_SIZE - 1)) == 0 And: (n & ~BDRV_SECTOR_MASK) == 0 With: QEMU_IS_ALIGNED(n, BDRV_SECTOR_SIZE) Which reveals the intent of the code better, and makes it easier to locate the code checking alignment. Signed-off-by: Nir Soffer ---

[Qemu-block] [PATCH v2 0/2] Alignment checks cleanup

2019-08-27 Thread Nir Soffer
While working on 4k support, I noticed that there is lot of code using BDRV_SECTOR_SIZE (512) for checking alignment. I wonder how this can work with 4k storage. Lets start by cleaning up to make the code easier to understand: - Use QEMU_IS_ALIGNED macro to check alignment - Remove unneeded masks

[Qemu-block] [PATCH v2 2/2] block: Remove unused masks

2019-08-27 Thread Nir Soffer
Replace confusing usage: ~BDRV_SECTOR_MASK With more clear: (BDRV_SECTOR_SIZE - 1) Remove BDRV_SECTOR_MASK and the unused BDRV_BLOCK_OFFSET_MASK which was it's last user. Signed-off-by: Nir Soffer --- include/block/block.h | 2 -- migration/block.c | 2 +- 2 files changed, 1

Re: [Qemu-block] [PATCH v5 6/6] iotests: extend sleeping time under Valgrind

2019-08-27 Thread John Snow
On 8/23/19 11:27 AM, Vladimir Sementsov-Ogievskiy wrote: > 16.08.2019 4:01, John Snow wrote: >> >> >> On 7/19/19 12:30 PM, Andrey Shinkevich wrote: >>> To synchronize the time when QEMU is running longer under the Valgrind, >>> increase the sleeping time in the test 247. >>> >>> Signed-off-by:

Re: [Qemu-block] [PATCH v5 4/6] iotests: Valgrind fails with nonexistent directory

2019-08-27 Thread John Snow
On 8/25/19 11:24 AM, Andrey Shinkevich wrote: > > > On 16/08/2019 03:55, John Snow wrote: >> >> >> On 7/19/19 12:30 PM, Andrey Shinkevich wrote: >>> The Valgrind uses the exported variable TMPDIR and fails if the >>> directory does not exist. Let us exclude such a test case from >>> being run

[Qemu-block] [PATCH 3/6] curl: Pass CURLSocket to curl_multi_{do, read}()

2019-08-27 Thread Max Reitz
curl_multi_do_locked() currently marks all sockets as ready. That is not only inefficient, but in fact unsafe (the loop is). A follow-up patch will change that, but to do so, curl_multi_do_locked() needs to know exactly which socket is ready; and that is accomplished by this patch here. Cc:

[Qemu-block] [PATCH 5/6] curl: Handle success in multi_check_completion

2019-08-27 Thread Max Reitz
Background: As of cURL 7.59.0, it verifies that several functions are not called from within a callback. Among these functions is curl_multi_add_handle(). curl_read_cb() is a callback from cURL and not a coroutine. Waking up acb->co will lead to entering it then and there, which means the

[Qemu-block] [PATCH 2/6] curl: Keep *socket until the end of curl_sock_cb()

2019-08-27 Thread Max Reitz
This does not really change anything, but it makes the code a bit easier to follow once we use @socket as the opaque pointer for aio_set_fd_handler(). (Also, this change stops us from creating new CURLSocket objects when the cURL library just wants to stop listening on an existing socket that we

[Qemu-block] [PATCH 4/6] curl: Report only ready sockets

2019-08-27 Thread Max Reitz
Instead of reporting all sockets to cURL, only report the one that has caused curl_multi_do_locked() to be called. This lets us get rid of the QLIST_FOREACH_SAFE() list, which was actually wrong: SAFE foreaches are only safe when the current element is removed in each iteration. If it possible

[Qemu-block] [PATCH 6/6] curl: Check curl_multi_add_handle()'s return code

2019-08-27 Thread Max Reitz
If we had done that all along, debugging would have been much simpler. (Also, I/O errors are better than hangs.) Signed-off-by: Max Reitz --- block/curl.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/block/curl.c b/block/curl.c index 5e0cca601d..4a7aff02a6 100644

Re: [Qemu-block] [PATCH v3 1/2] block: posix: Always allocate the first block

2019-08-27 Thread Max Reitz
On 27.08.19 18:58, Max Reitz wrote: > On 27.08.19 03:05, Nir Soffer wrote: >> When creating an image with preallocation "off" or "falloc", the first >> block of the image is typically not allocated. When using Gluster >> storage backed by XFS filesystem, reading this block using direct I/O >>

Re: [Qemu-block] [PATCH] file-posix: fix request_alignment typo

2019-08-27 Thread Max Reitz
On 27.08.19 12:13, Stefan Hajnoczi wrote: > Fixes: a6b257a08e3d72219f03e461a52152672fec0612 >("file-posix: Handle undetectable alignment") > Signed-off-by: Stefan Hajnoczi > --- > block/file-posix.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Thanks, applied to my block

Re: [Qemu-block] [PATCH v2] iotests: Check for enabled drivers before testing them

2019-08-27 Thread Max Reitz
On 23.08.19 15:35, Thomas Huth wrote: > It is possible to enable only a subset of the block drivers with the > "--block-drv-rw-whitelist" option of the "configure" script. All other > drivers are marked as unusable (or only included as read-only with the > "--block-drv-ro-whitelist" option). If an

[Qemu-block] [PATCH] iotests: Unify cache mode quoting

2019-08-27 Thread Nir Soffer
Quoting cache mode is not needed, and most tests use unquoted values. Unify all test to use the same style. --- tests/qemu-iotests/026 | 4 ++-- tests/qemu-iotests/039 | 4 ++-- tests/qemu-iotests/052 | 2 +- tests/qemu-iotests/091 | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff

Re: [Qemu-block] [PATCH] iotests: Unify cache mode quoting

2019-08-27 Thread Nir Soffer
On Tue, Aug 27, 2019 at 8:36 PM Max Reitz wrote: > On 27.08.19 19:34, Nir Soffer wrote: > > Quoting cache mode is not needed, and most tests use unquoted values. > > Unify all test to use the same style. > > S-o-b is missing, shall I add it? > Thanks! Signed-off-by: Nir Soffer > > Max > > >

Re: [Qemu-block] [PATCH v3 1/2] block: posix: Always allocate the first block

2019-08-27 Thread Max Reitz
On 27.08.19 03:05, Nir Soffer wrote: > When creating an image with preallocation "off" or "falloc", the first > block of the image is typically not allocated. When using Gluster > storage backed by XFS filesystem, reading this block using direct I/O > succeeds regardless of request length, fooling

Re: [Qemu-block] [PATCH v3 0/2] Optimize alignment probing

2019-08-27 Thread Max Reitz
On 27.08.19 03:05, Nir Soffer wrote: > When probing unallocated area on remote XFS filesystem we cannot detect > request > alignment and we fallback to safe value which may not be optimal. Avoid this > fallback by always allocating the first block when creating a new image or > resizing empty

Re: [Qemu-block] [PATCH v2 0/7] vmdk: Misc fixes

2019-08-27 Thread Max Reitz
On 15.08.19 17:36, Max Reitz wrote: > I made the mistake of trying to run the iotests with all non-default > subformats our vmdk driver has to offer: > - monolithicFlat > - twoGbMaxExtentSparse > - twoGbMaxExtentFlat > - streamOptimized > > Many things broke, so this series fixes what I found.

Re: [Qemu-block] [PATCH] tests/check-block: Skip iotests when sanitizers are enabled

2019-08-27 Thread Max Reitz
On 23.08.19 10:42, Thomas Huth wrote: > The sanitizers (especially the address sanitizer from Clang) are > sometimes printing out warnings or false positives - this spoils > the output of the iotests, causing some of the tests to fail. > Thus let's skip the automatic iotests during "make check"

Re: [Qemu-block] [PATCH] iotests: Unify cache mode quoting

2019-08-27 Thread Max Reitz
On 27.08.19 19:34, Nir Soffer wrote: > Quoting cache mode is not needed, and most tests use unquoted values. > Unify all test to use the same style. S-o-b is missing, shall I add it? Max > --- > tests/qemu-iotests/026 | 4 ++-- > tests/qemu-iotests/039 | 4 ++-- > tests/qemu-iotests/052 | 2 +-

Re: [Qemu-block] [PATCH] iotests: Unify cache mode quoting

2019-08-27 Thread Max Reitz
On 27.08.19 19:38, Nir Soffer wrote: > On Tue, Aug 27, 2019 at 8:36 PM Max Reitz > wrote: > > On 27.08.19 19:34, Nir Soffer wrote: > > Quoting cache mode is not needed, and most tests use unquoted values. > > Unify all test to use the same style. > >

Re: [Qemu-block] [PATCH v3 0/2] Optimize alignment probing

2019-08-27 Thread Nir Soffer
Adding Eric On Tue, Aug 27, 2019 at 4:05 AM Nir Soffer wrote: > When probing unallocated area on remote XFS filesystem we cannot detect > request > alignment and we fallback to safe value which may not be optimal. Avoid > this > fallback by always allocating the first block when creating a new

Re: [Qemu-block] [Libguestfs] [nbdkit PATCH 3/3] plugins: Add .can_fast_zero hook

2019-08-27 Thread Richard W.M. Jones
The nbdkit series looks fine too, so ACK again. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-p2v converts physical machines to virtual machines. Boot with a live CD or over

[Qemu-block] [PATCH v6 8/8] hd-geo-test: Add tests for lchs override

2019-08-27 Thread Sam Eiderman via Qemu-block
From: Sam Eiderman Add QTest tests to check the logical geometry override option. The tests in hd-geo-test are out of date - they only test IDE and do not test interesting MBRs. I added a few helper functions which will make adding more tests easier. QTest's fw_cfg helper functions support

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

2019-08-27 Thread Peter Maydell
On Thu, 22 Aug 2019 at 16:53, Stefan Hajnoczi wrote: > > The following changes since commit 33f18cf7dca7741d3647d514040904ce83edd73d: > > Merge remote-tracking branch > 'remotes/kraxel/tags/audio-20190821-pull-request' into staging (2019-08-21 > 15:18:50 +0100) > > are available in the Git

Re: [Qemu-block] [PATCH v2] block: workaround for unaligned byte range in fallocate()

2019-08-27 Thread Eric Blake
On 8/27/19 9:04 AM, Andrey Shinkevich wrote: > > > On 27/08/2019 16:55, Eric Blake wrote: >> On 8/27/19 8:52 AM, Andrey Shinkevich wrote: >>> Revert the commit 118f99442d 'block/io.c: fix for the allocation failure' >>> and use better error handling for file systems that do not support >>>

Re: [Qemu-block] [PATCH v2] block: workaround for unaligned byte range in fallocate()

2019-08-27 Thread Andrey Shinkevich
On 27/08/2019 17:30, Eric Blake wrote: > On 8/27/19 9:04 AM, Andrey Shinkevich wrote: >> >> >> On 27/08/2019 16:55, Eric Blake wrote: >>> On 8/27/19 8:52 AM, Andrey Shinkevich wrote: Revert the commit 118f99442d 'block/io.c: fix for the allocation failure' and use better error handling

Re: [Qemu-block] [PATCH v3 1/3] qcow2: introduce compression type feature

2019-08-27 Thread Denis Plotnikov
On 27.08.2019 14:49, Vladimir Sementsov-Ogievskiy wrote: > 19.08.2019 18:00, Denis Plotnikov wrote: >> The patch adds some preparation parts for incompatible compression type >> feature to QCOW2 header that indicates that *all* compressed clusters >> must be (de)compressed using a certain

  1   2   >