Re: [Qemu-block] [Qemu-devel] [PATCH] block/mirror: change the semantic of 'force' of block-job-cancel

2018-01-30 Thread John Snow
On 01/30/2018 03:18 PM, John Snow wrote: > > > On 01/30/2018 03:38 AM, Liang Li wrote: >> When doing drive mirror to a low speed shared storage, if there was heavy >> BLK IO write workload in VM after the 'ready' event, drive mirror block job >> can't be canceled immediately, it would keep runn

Re: [Qemu-block] [Qemu-devel] [PATCH v2 00/13] blockjob: refactor mirror_throttle

2018-01-30 Thread John Snow
ping; I won't respin for patchew until this gets looked over again, sorry :) On 01/19/2018 03:58 PM, John Snow wrote: > mirror_throttle attempts to make sure we yield every so often when we're > doing operations that may not otherwise be as cooperative as we'd like. > > This pattern is useful to

Re: [Qemu-block] [Qemu-devel] [PATCH] block/mirror: change the semantic of 'force' of block-job-cancel

2018-01-30 Thread John Snow
On 01/30/2018 03:38 AM, Liang Li wrote: > When doing drive mirror to a low speed shared storage, if there was heavy > BLK IO write workload in VM after the 'ready' event, drive mirror block job > can't be canceled immediately, it would keep running until the heavy BLK IO > workload stopped in the

Re: [Qemu-block] [Qemu-devel] [PATCH] block/mirror: change the semantic of 'force' of block-job-cancel

2018-01-30 Thread John Snow
On 01/30/2018 03:38 AM, Liang Li wrote: > When doing drive mirror to a low speed shared storage, if there was heavy > BLK IO write workload in VM after the 'ready' event, drive mirror block job > can't be canceled immediately, it would keep running until the heavy BLK IO > workload stopped in the

Re: [Qemu-block] [PATCH] virtio-blk: check for NULL BlockDriverState

2018-01-30 Thread John Snow
On 01/30/2018 10:56 AM, Kevin Wolf wrote: > Am 30.01.2018 um 13:38 hat Stefan Hajnoczi geschrieben: >> On Mon, Jan 29, 2018 at 04:41:07PM +0100, Kevin Wolf wrote: >>> Am 24.01.2018 um 12:31 hat Stefan Hajnoczi geschrieben: On Mon, Jan 22, 2018 at 09:01:49AM -0600, Mark Kanda wrote: > Add

Re: [Qemu-block] [PATCH] vl: pause vcpus before stopping iothreads

2018-01-30 Thread Kevin Wolf
Am 30.01.2018 um 16:38 hat Stefan Hajnoczi geschrieben: > Commit dce8921b2baaf95974af8176406881872067adfa ("iothread: Stop threads > before main() quits") introduced iothread_stop_all() to avoid the > following virtio-scsi assertion failure: > > assert(blk_get_aio_context(d->conf.blk) == s->ctx)

Re: [Qemu-block] [PATCH] qcow2: Replace align_offset() with ROUND_UP()

2018-01-30 Thread Eric Blake
On 01/30/2018 10:22 AM, Alberto Garcia wrote: > On Tue 30 Jan 2018 05:17:47 PM CET, Eric Blake wrote: >> On 01/30/2018 10:08 AM, Alberto Garcia wrote: >>> On Tue 30 Jan 2018 05:03:16 PM CET, Eric Blake wrote: >>> > -virtual_size = align_offset(qemu_opt_get_size_del(opts, > BLOCK_OPT_SI

Re: [Qemu-block] [PATCH v6 2/2] qemu-img: Document --force-share / -U

2018-01-30 Thread Kevin Wolf
Am 30.01.2018 um 15:23 hat Eric Blake geschrieben: > On 01/30/2018 12:34 AM, Fam Zheng wrote: > > Signed-off-by: Fam Zheng > > Signed-off-by: Kevin Wolf > > --- > > qemu-img.texi | 7 +++ > > 1 file changed, 7 insertions(+) > > > > diff --git a/qemu-img.texi b/qemu-img.texi > > index 60a0e0

Re: [Qemu-block] [PATCH] iotests: Fix CID for VMDK afl image

2018-01-30 Thread Kevin Wolf
Am 30.01.2018 um 07:25 hat Fam Zheng geschrieben: > This reverts commit 76bf133c4 which updated the reference output, and > fixed the reference image, because the code path we want to exercise is > actually the invalid image size. > > The descriptor block in the image, which includes the CID to ve

Re: [Qemu-block] [PATCH] qcow2: Replace align_offset() with ROUND_UP()

2018-01-30 Thread Alberto Garcia
On Tue 30 Jan 2018 05:17:47 PM CET, Eric Blake wrote: > On 01/30/2018 10:08 AM, Alberto Garcia wrote: >> On Tue 30 Jan 2018 05:03:16 PM CET, Eric Blake wrote: >> -virtual_size = align_offset(qemu_opt_get_size_del(opts, BLOCK_OPT_SIZE, 0), +virtual_size = ROUND_UP(qemu_opt_g

Re: [Qemu-block] [PATCH] qcow2: Replace align_offset() with ROUND_UP()

2018-01-30 Thread Eric Blake
On 01/30/2018 10:08 AM, Alberto Garcia wrote: > On Tue 30 Jan 2018 05:03:16 PM CET, Eric Blake wrote: > >>> -virtual_size = align_offset(qemu_opt_get_size_del(opts, >>> BLOCK_OPT_SIZE, 0), >>> +virtual_size = ROUND_UP(qemu_opt_get_size_del(opts, BLOCK_OPT_SIZE, 0), >>>

Re: [Qemu-block] [PATCH] qcow2: Replace align_offset() with ROUND_UP()

2018-01-30 Thread Alberto Garcia
On Tue 30 Jan 2018 05:03:16 PM CET, Eric Blake wrote: >> -virtual_size = align_offset(qemu_opt_get_size_del(opts, BLOCK_OPT_SIZE, >> 0), >> +virtual_size = ROUND_UP(qemu_opt_get_size_del(opts, BLOCK_OPT_SIZE, 0), >> cluster_size); I just realized that the

Re: [Qemu-block] [PATCH] qcow2: Replace align_offset() with ROUND_UP()

2018-01-30 Thread Eric Blake
On 01/30/2018 09:04 AM, Alberto Garcia wrote: > The align_offset() function is equivalent to the ROUND_UP() macro so > there's no need to use the former. The ROUND_UP() name is also a bit > more explicit. > > This patch uses ROUND_UP() instead of the slower QEMU_ALIGN_UP() > because align_offset()

Re: [Qemu-block] [PATCH v7 1/9] mirror: inherit supported write/zero flags

2018-01-30 Thread Eric Blake
On 01/30/2018 06:15 AM, Anton Nefedov wrote: @@ -1064,6 +1064,11 @@ static void bdrv_mirror_top_refresh_filename(BlockDriverState *bs, QDict *opts)   bdrv_refresh_filename(bs->backing->bs);   pstrcpy(bs->exact_filename, sizeof(bs->exact_filename),   bs-

Re: [Qemu-block] [PATCH] virtio-blk: check for NULL BlockDriverState

2018-01-30 Thread Kevin Wolf
Am 30.01.2018 um 13:38 hat Stefan Hajnoczi geschrieben: > On Mon, Jan 29, 2018 at 04:41:07PM +0100, Kevin Wolf wrote: > > Am 24.01.2018 um 12:31 hat Stefan Hajnoczi geschrieben: > > > On Mon, Jan 22, 2018 at 09:01:49AM -0600, Mark Kanda wrote: > > > > Add a BlockDriverState NULL check to virtio_blk

[Qemu-block] [PATCH] vl: pause vcpus before stopping iothreads

2018-01-30 Thread Stefan Hajnoczi
Commit dce8921b2baaf95974af8176406881872067adfa ("iothread: Stop threads before main() quits") introduced iothread_stop_all() to avoid the following virtio-scsi assertion failure: assert(blk_get_aio_context(d->conf.blk) == s->ctx); Back then the assertion failed because when bdrv_close_all() ma

Re: [Qemu-block] [PATCH v6 2/2] qemu-img: Document --force-share / -U

2018-01-30 Thread Stefan Hajnoczi
On Tue, Jan 30, 2018 at 02:34:33PM +0800, Fam Zheng wrote: > Signed-off-by: Fam Zheng > Signed-off-by: Kevin Wolf > --- > qemu-img.texi | 7 +++ > 1 file changed, 7 insertions(+) > > diff --git a/qemu-img.texi b/qemu-img.texi > index 60a0e080c6..ec7e2f5d1e 100644 > --- a/qemu-img.texi > +++

Re: [Qemu-block] [PATCH] virtio-blk: check for NULL BlockDriverState

2018-01-30 Thread Stefan Hajnoczi
On Mon, Jan 29, 2018 at 04:41:07PM +0100, Kevin Wolf wrote: > Am 24.01.2018 um 12:31 hat Stefan Hajnoczi geschrieben: > > On Mon, Jan 22, 2018 at 09:01:49AM -0600, Mark Kanda wrote: > > > Add a BlockDriverState NULL check to virtio_blk_handle_request() > > > to prevent a segfault if the drive is fo

[Qemu-block] [PATCH] qcow2: Replace align_offset() with ROUND_UP()

2018-01-30 Thread Alberto Garcia
The align_offset() function is equivalent to the ROUND_UP() macro so there's no need to use the former. The ROUND_UP() name is also a bit more explicit. This patch uses ROUND_UP() instead of the slower QEMU_ALIGN_UP() because align_offset() already requires that the second parameter is a power of

Re: [Qemu-block] [PATCH v6 2/2] qemu-img: Document --force-share / -U

2018-01-30 Thread Kashyap Chamarthy
On Tue, Jan 30, 2018 at 08:23:50AM -0600, Eric Blake wrote: > On 01/30/2018 12:34 AM, Fam Zheng wrote: [...] > > +If specified, @code{qemu-img} will open the image in shared mode, allowing > > +concurrent writers. For example, this can be used to get the image > > information > > Actually, we o

Re: [Qemu-block] [PATCH v6 2/2] qemu-img: Document --force-share / -U

2018-01-30 Thread Eric Blake
On 01/30/2018 12:34 AM, Fam Zheng wrote: > Signed-off-by: Fam Zheng > Signed-off-by: Kevin Wolf > --- > qemu-img.texi | 7 +++ > 1 file changed, 7 insertions(+) > > diff --git a/qemu-img.texi b/qemu-img.texi > index 60a0e080c6..ec7e2f5d1e 100644 > --- a/qemu-img.texi > +++ b/qemu-img.texi >

Re: [Qemu-block] [PATCH v7 8/9] qcow2: skip writing zero buffers to empty COW areas

2018-01-30 Thread Anton Nefedov
On 29/1/2018 11:28 PM, Max Reitz wrote: On 2018-01-18 18:49, Anton Nefedov wrote: If COW areas of the newly allocated clusters are zeroes on the backing image, efficient bdrv_write_zeroes(flags=BDRV_REQ_ALLOCATE) can be used on the whole cluster instead of writing explicit zero buffers later i

Re: [Qemu-block] [PATCH] block/mirror: change the semantic of 'force' of block-job-cancel

2018-01-30 Thread Eric Blake
On 01/30/2018 02:38 AM, Liang Li wrote: > When doing drive mirror to a low speed shared storage, if there was heavy > BLK IO write workload in VM after the 'ready' event, drive mirror block job > can't be canceled immediately, it would keep running until the heavy BLK IO > workload stopped in the V

Re: [Qemu-block] [Qemu-devel] [PATCH] iotests: Fix CID for VMDK afl image

2018-01-30 Thread Fam Zheng
On Tue, Jan 30, 2018 at 9:48 PM, Eric Blake wrote: > On 01/30/2018 12:25 AM, Fam Zheng wrote: >> This reverts commit 76bf133c4 which updated the reference output, and >> fixed the reference image, because the code path we want to exercise is >> actually the invalid image size. >> >> The descriptor

Re: [Qemu-block] [PATCH v6 2/2] qemu-img: Document --force-share / -U

2018-01-30 Thread Eric Blake
On 01/30/2018 12:34 AM, Fam Zheng wrote: > Signed-off-by: Fam Zheng > Signed-off-by: Kevin Wolf > --- > qemu-img.texi | 7 +++ > 1 file changed, 7 insertions(+) > Reviewed-by: Eric Blake -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization:

Re: [Qemu-block] [PATCH v6 1/2] qemu-img.texi: Clean up parameter list

2018-01-30 Thread Eric Blake
On 01/30/2018 12:34 AM, Fam Zheng wrote: > Split options out of the "@table @var" section and create a "@table > @option", then use whitespaces and blank lines consistently. > > Suggested-by: Kevin Wolf > Signed-off-by: Fam Zheng > --- > qemu-img.texi | 66 > +++

Re: [Qemu-block] [Qemu-devel] [PATCH] iotests: Fix CID for VMDK afl image

2018-01-30 Thread Eric Blake
On 01/30/2018 12:25 AM, Fam Zheng wrote: > This reverts commit 76bf133c4 which updated the reference output, and > fixed the reference image, because the code path we want to exercise is > actually the invalid image size. > > The descriptor block in the image, which includes the CID to verify, has

Re: [Qemu-block] [PATCH v7 9/9] iotest 134: test cluster-misaligned encrypted write

2018-01-30 Thread Alberto Garcia
On Thu 18 Jan 2018 06:49:07 PM CET, Anton Nefedov wrote: > COW (even empty/zero) areas require encryption too > > Signed-off-by: Anton Nefedov > Reviewed-by: Eric Blake Reviewed-by: Alberto Garcia Berto

Re: [Qemu-block] [PATCH v7 4/9] block: treat BDRV_REQ_ALLOCATE as serialising

2018-01-30 Thread Anton Nefedov
On 29/1/2018 10:48 PM, Max Reitz wrote: On 2018-01-18 18:49, Anton Nefedov wrote: The idea is that ALLOCATE requests may overlap with other requests. Reuse the existing block layer infrastructure for serialising requests. Use the following approach: - mark ALLOCATE serialising, so subsequen

Re: [Qemu-block] [PATCH v7 3/9] block: introduce BDRV_REQ_ALLOCATE flag

2018-01-30 Thread Anton Nefedov
On 29/1/2018 10:37 PM, Max Reitz wrote: On 2018-01-18 18:49, Anton Nefedov wrote: The flag is supposed to indicate that the region of the disk image has to be sufficiently allocated so it reads as zeroes. The call with the flag set must return -ENOTSUP if allocation cannot be done efficiently

Re: [Qemu-block] [PATCH v7 1/9] mirror: inherit supported write/zero flags

2018-01-30 Thread Anton Nefedov
On 29/1/2018 10:26 PM, Eric Blake wrote: On 01/29/2018 01:21 PM, Max Reitz wrote: On 2018-01-18 18:48, Anton Nefedov wrote: Signed-off-by: Anton Nefedov Reviewed-by: Eric Blake Reviewed-by: Alberto Garcia --- block/mirror.c | 5 + 1 file changed, 5 insertions(+) diff --git a/block/

[Qemu-block] [PATCH] block/mirror: change the semantic of 'force' of block-job-cancel

2018-01-30 Thread Liang Li
When doing drive mirror to a low speed shared storage, if there was heavy BLK IO write workload in VM after the 'ready' event, drive mirror block job can't be canceled immediately, it would keep running until the heavy BLK IO workload stopped in the VM. Because libvirt depends on block-job-cancel