Re: [Qemu-block] [PATCH v2 7/9] blkdebug: Add pass-through write_zero and discard support

2016-11-18 Thread Eric Blake
On 11/17/2016 04:47 PM, Max Reitz wrote: > On 17.11.2016 21:14, Eric Blake wrote: >> In order to test the effects of artificial geometry constraints >> on operations like write zero or discard, we first need blkdebug >> to manage these actions. Ideally, it would be nice to let these >> operations

Re: [Qemu-block] [PATCH v2 4/9] block: Return -ENOTSUP rather than assert on unaligned discards

2016-11-18 Thread Eric Blake
On 11/17/2016 04:01 PM, Max Reitz wrote: > On 17.11.2016 21:13, Eric Blake wrote: >> 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 mu

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

2016-11-18 Thread Eric Blake
On 11/18/2016 06:21 AM, Kevin Wolf wrote: >>> +ret = bdrv_co_pwritev(s->children[co->i], >>> + acb->sector_num * BDRV_SECTOR_SIZE, >>> + acb->nb_sectors * BDRV_SECTOR_SIZE, >>> + acb->qiov, 0); >>> +(void) ret; >> >

Re: [Qemu-block] [Qemu-devel] [PATCH] xen_disk: convert discard input to byte ranges

2016-11-18 Thread Eric Blake
On 11/18/2016 11:41 AM, Olaf Hering wrote: > On Fri, Nov 18, Eric Blake wrote: > >> On 11/18/2016 04:24 AM, Olaf Hering wrote: >>> +/* Overflowing byte limit? */ >>> +if ((sec_start + sec_count) > ((INT64_MAX + INT_MAX) >> >>> BDRV_SECTOR_BITS)) { >> This is undefined. INT64_MAX + anythi

Re: [Qemu-block] [Qemu-devel] [PATCH] xen_disk: convert discard input to byte ranges

2016-11-18 Thread Olaf Hering
On Fri, Nov 18, Eric Blake wrote: > On 11/18/2016 04:24 AM, Olaf Hering wrote: > > +/* Overflowing byte limit? */ > > +if ((sec_start + sec_count) > ((INT64_MAX + INT_MAX) >> > > BDRV_SECTOR_BITS)) { > This is undefined. INT64_MAX + anything non-negative overflows int64, The expanded va

[Qemu-block] [PATCH 5/5] sheepdog: reorganize check for overlapping requests

2016-11-18 Thread Paolo Bonzini
Wrap the code that was copied repeatedly in the two functions, sd_aio_setup and sd_aio_complete. Cc: jc...@redhat.com Cc: qemu-block@nongnu.org Cc: Hitoshi Mitake Cc: Liu Yuan Signed-off-by: Paolo Bonzini --- block/sheepdog.c | 66 ++-- 1 fil

[Qemu-block] [PATCH 2/5] sheepdog: reorganize coroutine flow

2016-11-18 Thread Paolo Bonzini
Delimit co_recv's lifetime clearly in aio_read_response. Do a simple qemu_coroutine_enter in aio_read_response, letting sd_co_writev call sd_write_done. Handle nr_pending in the same way in sd_co_rw_vector, sd_write_done and sd_co_flush_to_disk. Remove sd_co_rw_vector's return value; just leave

[Qemu-block] [PATCH 4/5] sheepdog: simplify inflight_aio_head management

2016-11-18 Thread Paolo Bonzini
Add to the list in add_aio_request and, indirectly, resend_aioreq. Inline free_aio_req in the caller, it does not simply undo alloc_aio_req's job. Cc: jc...@redhat.com Cc: qemu-block@nongnu.org Cc: Hitoshi Mitake Cc: Liu Yuan Signed-off-by: Paolo Bonzini --- block/sheepdog.c | 23 ++--

[Qemu-block] [PATCH 3/5] sheepdog: do not use BlockAIOCB

2016-11-18 Thread Paolo Bonzini
Sheepdog's AIOCB are completely internal entities for a group of requests and do not need dynamic allocation. Cc: jc...@redhat.com Cc: qemu-block@nongnu.org Cc: Hitoshi Mitake Cc: Liu Yuan Signed-off-by: Paolo Bonzini --- block/sheepdog.c | 99 ++

[Qemu-block] [PATCH 1/5] sheepdog: remove unused cancellation support

2016-11-18 Thread Paolo Bonzini
SheepdogAIOCB is internal to sheepdog.c, hence it is never canceled. Cc: jc...@redhat.com Cc: qemu-block@nongnu.org Cc: Hitoshi Mitake Cc: Liu Yuan Signed-off-by: Paolo Bonzini --- block/sheepdog.c | 52 1 file changed, 52 deletions(-) diff

[Qemu-block] [PATCH for-2.9 v2 0/5] Sheepdog cleanups

2016-11-18 Thread Paolo Bonzini
Cleaning up the code and removing duplication makes it simpler to later adapt it for the multiqueue work. Tested against sheepdog 1.0. I also tested taking snapshots and reverting to older snapshots, but the latter only worked with "dog vdi rollback". Neither loadvm nor qemu-img worked for me.

Re: [Qemu-block] [Qemu-devel] [PATCH] xen_disk: convert discard input to byte ranges

2016-11-18 Thread Eric Blake
On 11/18/2016 04:24 AM, Olaf Hering wrote: > The guest sends discard requests as u64 sector/count pairs, but the > block layer operates internally with s64/s32 pairs. The conversion > leads to IO errors in the guest, the discard request is not processed. > > domU.cfg: > 'vdev=xvda, format=qcow

Re: [Qemu-block] [Qemu-devel] [PATCH for-2.9 0/5] Sheepdog cleanups

2016-11-18 Thread no-reply
Hi, Your series failed automatic build test. Please find the testing commands and their output below. If you have docker installed, you can probably reproduce it locally. Subject: [Qemu-devel] [PATCH for-2.9 0/5] Sheepdog cleanups Type: series Message-id: 20161118155500.11050-1-pbonz...@redhat.co

[Qemu-block] [PATCH 5/5] sheepdog: reorganize check for overlapping requests

2016-11-18 Thread Paolo Bonzini
Wrap the code that was copied repeatedly in the two functions, sd_aio_setup and sd_aio_complete. Cc: Hitoshi Mitake Cc: Liu Yuan Signed-off-by: Paolo Bonzini --- block/sheepdog.c | 66 ++-- 1 file changed, 30 insertions(+), 36 deletions(-) d

[Qemu-block] [PATCH 3/5] sheepdog: do not use BlockAIOCB

2016-11-18 Thread Paolo Bonzini
Sheepdog's AIOCB are completely internal entities for a group of requests and do not need dynamic allocation. Cc: Hitoshi Mitake Cc: Liu Yuan Signed-off-by: Paolo Bonzini --- block/sheepdog.c | 95 ++-- 1 file changed, 37 insertions(+), 58 de

[Qemu-block] [PATCH 1/5] sheepdog: remove unused cancellation support

2016-11-18 Thread Paolo Bonzini
SheepdogAIOCB is internal to sheepdog.c, hence it is never canceled. Cc: Hitoshi Mitake Cc: Liu Yuan Signed-off-by: Paolo Bonzini --- block/sheepdog.c | 52 1 file changed, 52 deletions(-) diff --git a/block/sheepdog.c b/block/sheepdog.c in

[Qemu-block] [PATCH 2/5] sheepdog: reorganize coroutine flow

2016-11-18 Thread Paolo Bonzini
Delimit co_recv's lifetime clearly in aio_read_response. Do a simple qemu_coroutine_enter in aio_read_response, letting sd_co_writev call sd_write_done. Handle nr_pending in the same way in sd_co_rw_vector, sd_write_done and sd_co_flush_to_disk. Remove sd_co_rw_vector's return value; just leave

[Qemu-block] [PATCH for-2.9 0/5] Sheepdog cleanups

2016-11-18 Thread Paolo Bonzini
Cleaning up the code and removing duplication makes it simpler to later adapt it for the multiqueue work. Tested against sheepdog 1.0. I also tested taking snapshots and reverting to older snapshots, but the latter only worked with "dog vdi rollback". Neither loadvm nor qemu-img worked for me. P

[Qemu-block] [PATCH 4/5] sheepdog: simplify inflight_aio_head management

2016-11-18 Thread Paolo Bonzini
Add to the list in add_aio_request and, indirectly, resend_aioreq. Inline free_aio_req in the caller, it does not simply undo alloc_aio_req's job. Cc: Hitoshi Mitake Cc: Liu Yuan Signed-off-by: Paolo Bonzini --- block/sheepdog.c | 23 ++- 1 file changed, 6 insertions(+), 1

[Qemu-block] [PULL 4/7] virtio: set ISR on dataplane notifications

2016-11-18 Thread Michael S. Tsirkin
From: Paolo Bonzini Dataplane has been omitting forever the step of setting ISR when an interrupt is raised. This caused little breakage, because the specification actually says that ISR may not be updated in MSI mode. Some versions of the Windows drivers however didn't clear MSI mode correctly

Re: [Qemu-block] [Qemu-devel] [PATCH] xen_disk: convert discard input to byte ranges

2016-11-18 Thread Kevin Wolf
Am 18.11.2016 um 15:35 hat Eric Blake geschrieben: > On 11/18/2016 08:19 AM, Olaf Hering wrote: > > Am 18. November 2016 14:43:18 MEZ, schrieb Eric Blake : > >> On 11/18/2016 04:24 AM, Olaf Hering wrote: > >>> The guest sends discard requests as u64 sector/count pairs, but the > >>> block layer ope

Re: [Qemu-block] [Qemu-devel] [PATCH] xen_disk: convert discard input to byte ranges

2016-11-18 Thread Eric Blake
On 11/18/2016 08:19 AM, Olaf Hering wrote: > Am 18. November 2016 14:43:18 MEZ, schrieb Eric Blake : >> On 11/18/2016 04:24 AM, Olaf Hering wrote: >>> The guest sends discard requests as u64 sector/count pairs, but the >>> block layer operates internally with s64/s32 pairs. The conversion >>> leads

Re: [Qemu-block] [Qemu-devel] [PATCH] xen_disk: convert discard input to byte ranges

2016-11-18 Thread Olaf Hering
Am 18. November 2016 14:43:18 MEZ, schrieb Eric Blake : >On 11/18/2016 04:24 AM, Olaf Hering wrote: >> The guest sends discard requests as u64 sector/count pairs, but the >> block layer operates internally with s64/s32 pairs. The conversion >> leads to IO errors in the guest, the discard request is

Re: [Qemu-block] [PATCH v2 1/9] nbd: Allow unmap and fua during write zeroes

2016-11-18 Thread Paolo Bonzini
On 17/11/2016 22:10, Max Reitz wrote: > On 17.11.2016 21:13, Eric Blake wrote: >> Commit fa778fff wired up support to send the NBD_CMD_WRITE_ZEROES, >> but forgot to inform the block layer that FUA unmapping of zeroes is >> supported. Without BDRV_REQ_MAY_UNMAP listed as a supported flag, >> the

Re: [Qemu-block] [Qemu-devel] [PATCH] xen_disk: convert discard input to byte ranges

2016-11-18 Thread Eric Blake
On 11/18/2016 04:24 AM, Olaf Hering wrote: > The guest sends discard requests as u64 sector/count pairs, but the > block layer operates internally with s64/s32 pairs. The conversion > leads to IO errors in the guest, the discard request is not processed. Doesn't the block layer already split disca

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

2016-11-18 Thread Alberto Garcia
On Fri 18 Nov 2016 01:21:12 PM CET, Kevin Wolf wrote: >> > +/* one less rewrite to do */ >> > +acb->rewrite_count--; >> > +qemu_coroutine_enter_if_inactive(acb->co); >> >> I think you should only enter acb->co when acb->rewrite_count reaches >> zero. >> >> In all other cases the main

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

2016-11-18 Thread Kevin Wolf
Am 17.11.2016 um 15:54 hat Alberto Garcia geschrieben: > On Thu 10 Nov 2016 06:19:07 PM CET, Kevin Wolf wrote: > > +static void quorum_rewrite_entry(void *opaque) > > +{ > > +QuorumCo *co = opaque; > > +QuorumAIOCB *acb = co->acb; > > +BDRVQuorumState *s = acb->bs->opaque; > > +int

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

2016-11-18 Thread Paolo Bonzini
On 18/11/2016 10:51, Alberto Garcia wrote: > >>> >> Honestly I don't see the point. It seems easier, more practical and >>> >> more effective to convert bdrv_aio_* to byte ranges, especially since >>> >> QED would be basically a rewrite. >> > >> > Well, it's an RFC for a reason, I want people t

Re: [Qemu-block] [PATCH] xen_disk: convert discard input to byte ranges

2016-11-18 Thread Olaf Hering
On Fri, Nov 18, Olaf Hering wrote: > @@ -708,12 +743,10 @@ static int ioreq_runio_qemu_aio(struct ioreq *ioreq) > +if (!blk_split_discard(ioreq, req->sector_number, req->nr_sectors)) { > +goto err; How is error handling supposed to work here? Initially I forgot the "!", which

[Qemu-block] [PATCH] xen_disk: convert discard input to byte ranges

2016-11-18 Thread Olaf Hering
The guest sends discard requests as u64 sector/count pairs, but the block layer operates internally with s64/s32 pairs. The conversion leads to IO errors in the guest, the discard request is not processed. domU.cfg: 'vdev=xvda, format=qcow2, backendtype=qdisk, target=/x.qcow2' domU: mkfs.e

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

2016-11-18 Thread Alberto Garcia
On Fri 11 Nov 2016 11:22:26 AM CET, Kevin Wolf wrote: >> Honestly I don't see the point. It seems easier, more practical and >> more effective to convert bdrv_aio_* to byte ranges, especially since >> QED would be basically a rewrite. > > Well, it's an RFC for a reason, I want people to give thei

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

2016-11-18 Thread Alberto Garcia
On Thu 10 Nov 2016 06:19:09 PM CET, Kevin Wolf wrote: > 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 Reviewed-by: Alberto Garcia Berto