Re: [Qemu-block] [PATCH 4/4] block: Cater to iscsi with non-power-of-2 discard

2016-11-10 Thread Eric Blake
On 11/08/2016 05:03 AM, Peter Lieven wrote: > Am 25.10.2016 um 18:12 schrieb Eric Blake: >> On 10/25/2016 09:36 AM, Paolo Bonzini wrote: >>> >>> On 25/10/2016 16:35, Eric Blake wrote: So your argument is that we should always pass down every unaligned less-than-optimum discard request

Re: [Qemu-block] [Qemu-devel] [RFC PATCH 7/8] quorum: Implement .bdrv_co_preadv/pwritev()

2016-11-10 Thread Eric Blake
On 11/10/2016 11:19 AM, Kevin Wolf wrote: > This enables byte granularity requests on quorum nodes. > > Note that the QMP events emitted by the driver are an external API that > we were careless enough to define as sector based. The offset and length > of requests reported in events are rounded

Re: [Qemu-block] [Qemu-devel] [RFC PATCH 6/8] quorum: Avoid bdrv_aio_writev() for rewrites

2016-11-10 Thread Eric Blake
On 11/10/2016 11:19 AM, Kevin Wolf wrote: > Replacing it with bdrv_co_pwritev() prepares us for byte granularity > requests and gets us rid of the last bdrv_aio_*() user in quorum. > > Signed-off-by: Kevin Wolf > --- > block/quorum.c | 52

Re: [Qemu-block] [Qemu-devel] [RFC PATCH 4/8] quorum: Do cleanup in caller coroutine

2016-11-10 Thread Eric Blake
On 11/10/2016 11:19 AM, Kevin Wolf wrote: > Instead of calling quorum_aio_finalize() deeply nested in what used > to be an AIO callback, do it in the same functions that allocated the > AIOCB. > > Signed-off-by: Kevin Wolf > --- > block/quorum.c | 15 +-- > 1 file

Re: [Qemu-block] [Qemu-devel] [RFC PATCH 3/8] quorum: Implement .bdrv_co_readv/writev

2016-11-10 Thread Eric Blake
On 11/10/2016 11:19 AM, Kevin Wolf wrote: > Signed-off-by: Kevin Wolf > --- > block/quorum.c | 194 > ++--- > 1 file changed, 117 insertions(+), 77 deletions(-) > > + > +static void read_quorum_children_entry(void *opaque)

Re: [Qemu-block] [Qemu-devel] [RFC PATCH 2/8] quorum: Remove s from quorum_aio_get() arguments

2016-11-10 Thread Eric Blake
On 11/10/2016 11:19 AM, Kevin Wolf wrote: > There is no point in passing the value of bs->opaque in order to > overwrite it with itself. > > Signed-off-by: Kevin Wolf > --- > block/quorum.c | 9 - > 1 file changed, 4 insertions(+), 5 deletions(-) > Reviewed-by: Eric

Re: [Qemu-block] [Qemu-devel] [RFC PATCH 1/8] coroutine: Introduce qemu_coroutine_enter_if_inactive()

2016-11-10 Thread Eric Blake
On 11/10/2016 11:19 AM, Kevin Wolf wrote: > In the context of asynchronous work, if we have a worker coroutine that > didn't yield, the parent coroutine cannot be reentered because it hasn't > yielded yet. In this case we don't even have to reenter the parent > because it will see that the work is

[Qemu-block] [PATCH 1/2] block: Return -ENOTSUP rather than assert on unaligned discards

2016-11-10 Thread Eric Blake
Right now, the block layer rounds discard requests, so that individual drivers are able to assert that discard requests will never be unaligned. But there are some ISCSI devices that track and coalesce multiple unaligned requests, turning it into an actual discard if the requests eventually cover

[Qemu-block] [PATCH 2/2] block: Pass unaligned discard requests to drivers

2016-11-10 Thread Eric Blake
Discard is advisory, so rounding the requests to alignment boundaries is never semantically wrong from the data that the guest sees. But at least the Dell Equallogic iSCSI SANs has an interesting property that its advertised discard alignment is 15M, yet documents that discarding a sequence of 1M

[Qemu-block] [PATCH for-2.8 0/2] pass partial discard requests all the way down

2016-11-10 Thread Eric Blake
Peter reported a mild regression in qemu 2.7 when targetting the Dell Equallogic iSCSI, which advertizes a preferred and maximum unmap alignment at 15M. In qemu 2.6, trims not aligned to those boundaries still made it to the device, but in 2.7, the block layer is ignoring unaligned portions of

[Qemu-block] [RFC PATCH 8/8] quorum: Inline quorum_fifo_aio_cb()

2016-11-10 Thread Kevin Wolf
Inlining the function removes some boilerplace code and replaces recursion by a simple loop, so the code becomes somewhat easier to understand. Signed-off-by: Kevin Wolf --- block/quorum.c | 42 +- 1 file changed, 13 insertions(+), 29

[Qemu-block] [RFC PATCH 3/8] quorum: Implement .bdrv_co_readv/writev

2016-11-10 Thread Kevin Wolf
Signed-off-by: Kevin Wolf --- block/quorum.c | 194 ++--- 1 file changed, 117 insertions(+), 77 deletions(-) diff --git a/block/quorum.c b/block/quorum.c index dfa9fd3..3cb579e 100644 --- a/block/quorum.c +++ b/block/quorum.c

[Qemu-block] [RFC PATCH 2/8] quorum: Remove s from quorum_aio_get() arguments

2016-11-10 Thread Kevin Wolf
There is no point in passing the value of bs->opaque in order to overwrite it with itself. Signed-off-by: Kevin Wolf --- block/quorum.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/block/quorum.c b/block/quorum.c index d122299..dfa9fd3 100644

[Qemu-block] [RFC PATCH 4/8] quorum: Do cleanup in caller coroutine

2016-11-10 Thread Kevin Wolf
Instead of calling quorum_aio_finalize() deeply nested in what used to be an AIO callback, do it in the same functions that allocated the AIOCB. Signed-off-by: Kevin Wolf --- block/quorum.c | 15 +-- 1 file changed, 9 insertions(+), 6 deletions(-) diff --git

[Qemu-block] [RFC PATCH 1/8] coroutine: Introduce qemu_coroutine_enter_if_inactive()

2016-11-10 Thread Kevin Wolf
In the context of asynchronous work, if we have a worker coroutine that didn't yield, the parent coroutine cannot be reentered because it hasn't yielded yet. In this case we don't even have to reenter the parent because it will see that the work is already done and won't even yield.

[Qemu-block] [RFC PATCH 0/8] quorum: Implement .bdrv_co_preadv/pwritev()

2016-11-10 Thread Kevin Wolf
This is part of a series that I'm working on and that aims to remove the bdrv_aio_*() emulation in io.c. blkdebug and blkverify were easy, but for quorum I need a few more patches, so I'm sending this out as an RFC while I continue work on the rest (QED, and then possibly some polishing). After

[Qemu-block] [RFC PATCH 6/8] quorum: Avoid bdrv_aio_writev() for rewrites

2016-11-10 Thread Kevin Wolf
Replacing it with bdrv_co_pwritev() prepares us for byte granularity requests and gets us rid of the last bdrv_aio_*() user in quorum. Signed-off-by: Kevin Wolf --- block/quorum.c | 52 +--- 1 file changed, 33 insertions(+), 19

[Qemu-block] [RFC PATCH 7/8] quorum: Implement .bdrv_co_preadv/pwritev()

2016-11-10 Thread Kevin Wolf
This enables byte granularity requests on quorum nodes. Note that the QMP events emitted by the driver are an external API that we were careless enough to define as sector based. The offset and length of requests reported in events are rounded down therefore. Signed-off-by: Kevin Wolf

Re: [Qemu-block] [Qemu-devel] [PATCH v2 0/6] block-backend: Always notify on blk_eject

2016-11-10 Thread John Snow
Ping, Kevin: Look ok? --js On 11/07/2016 04:13 PM, John Snow wrote: Requires patches in my IDE branch, for context. This series changes blk_eject (used for a software-initiated eject request) to always trigger a QMP tray event, in contrast to the current behavior where a tray event only

[Qemu-block] [PULL 39/47] megasas: remove unnecessary megasas_use_msix()

2016-11-10 Thread Michael S. Tsirkin
From: Cao jin Also move certain hunk above, to place msix init related code together. CC: Hannes Reinecke CC: Paolo Bonzini CC: Markus Armbruster CC: Marcel Apfelbaum CC: Michael S. Tsirkin

[Qemu-block] [PULL 36/47] pci: Convert msix_init() to Error and fix callers to check it

2016-11-10 Thread Michael S. Tsirkin
From: Cao jin msix_init() reports errors with error_report(), which is wrong when it's used in realize(). The same issue was fixed for msi_init() in commit 1108b2f. For some devices(like e1000e, vmxnet3) who won't fail because of msix_init's failure, suppress the

[Qemu-block] [PULL 37/47] megasas: change behaviour of msix switch

2016-11-10 Thread Michael S. Tsirkin
From: Cao jin Resolve the TODO, msix=auto means msix on; if user specify msix=on, then device creation fail on msix_init failure. Also undo the overwrites of user configuration of msix. CC: Michael S. Tsirkin CC: Hannes Reinecke CC:

Re: [Qemu-block] [PATCH for-2.8] block: Let write zeroes fallback work even with small max_transfer

2016-11-10 Thread Kevin Wolf
Am 10.11.2016 um 03:11 hat Fam Zheng geschrieben: > On Wed, 11/09 14:06, Eric Blake wrote: > > On 11/09/2016 07:49 AM, Stefan Hajnoczi wrote: > > > On Tue, Nov 08, 2016 at 04:52:15PM -0600, Eric Blake wrote: > > >> Commit 443668ca rewrote the write_zeroes logic to guarantee that > > >> an