Re: [Qemu-block] [PATCH v4 04/15] block/commit: refactor commit to use job callbacks

2018-09-05 Thread John Snow
On 09/05/2018 06:27 AM, Max Reitz wrote: > On 2018-09-04 22:32, John Snow wrote: >> >> >> On 09/04/2018 02:46 PM, Jeff Cody wrote: >>> On Tue, Sep 04, 2018 at 01:09:19PM -0400, John Snow wrote: Use the component callbacks; prepare, abort, and clean. NB: prepare is only called

Re: [Qemu-block] [PATCH v2 08/10] block: Allow changing 'discard' on reopen

2018-09-05 Thread Alberto Garcia
On Mon 03 Sep 2018 04:34:06 PM CEST, Alberto Garcia wrote: > +value = qemu_opt_get_del(opts, "discard"); > +if (value != NULL) { > +if (bdrv_parse_discard_flags(value, _state->flags) != 0) { > +error_setg(errp, "Invalid discard option"); > +ret = -EINVAL;

Re: [Qemu-block] [PATCH v4 06/15] block/mirror: conservative mirror_exit refactor

2018-09-05 Thread Eric Blake
On 09/05/2018 08:09 AM, John Snow wrote: On 09/05/2018 06:43 AM, Max Reitz wrote: On 2018-09-04 19:09, John Snow wrote: For purposes of minimum code movement, refactor the mirror_exit callback to use the post-finalization callbacks in a trivial way. Signed-off-by: John Snow ---

Re: [Qemu-block] [PATCH v4 05/15] block/mirror: don't install backing chain on abort

2018-09-05 Thread John Snow
On 09/05/2018 06:40 AM, Max Reitz wrote: > On 2018-09-04 19:09, John Snow wrote: >> In cases where we abort the block/mirror job, there's no point in >> installing the new backing chain before we finish aborting. >> >> Move this to the "success" portion of mirror_exit. > > Sounds a bit weird

Re: [Qemu-block] [Qemu-devel] [PATCH 1/2] commit: Add top-node/base-node options

2018-09-05 Thread Kevin Wolf
Am 05.09.2018 um 16:02 hat Peter Krempa geschrieben: > On Wed, Sep 05, 2018 at 08:48:15 -0500, Eric Blake wrote: > > On 09/05/2018 07:38 AM, Peter Krempa wrote: > > > > > block-commit is able to reopen the format layers and works as expected. > > > > > > Unfortunately though the 'read-only'

Re: [Qemu-block] [PATCH for-3.1 v10 31/31] iotests: Test json:{} filenames of internal BDSs

2018-09-05 Thread Alberto Garcia
On Thu 09 Aug 2018 11:35:28 PM CEST, Max Reitz wrote: > +vm.shutdown() > + > +#assert top_name[:5] == 'json:' > +#top_options = json.loads(top_name[5:]) > + > +#if filter_node_name: > +## This should be present and set > +#assert

Re: [Qemu-block] [PATCH for-3.1 v10 08/31] iotests: Add test for backing file overrides

2018-09-05 Thread Alberto Garcia
On Thu 09 Aug 2018 11:35:05 PM CEST, Max Reitz wrote: > Signed-off-by: Max Reitz Reviewed-by: Alberto Garcia Berto

Re: [Qemu-block] [PATCH for-3.1 v10 04/31] block: Add BDS.auto_backing_file

2018-09-05 Thread Alberto Garcia
On Thu 09 Aug 2018 11:35:01 PM CEST, Max Reitz wrote: > If the backing file is overridden, this most probably does change the > guest-visible data of a BDS. Therefore, we will need to consider this > in bdrv_refresh_filename(). > > To see whether it has been overridden, we might want to compare >

Re: [Qemu-block] [Qemu-devel] [PATCH 1/2] commit: Add top-node/base-node options

2018-09-05 Thread Peter Krempa
On Wed, Sep 05, 2018 at 08:48:15 -0500, Eric Blake wrote: > On 09/05/2018 07:38 AM, Peter Krempa wrote: > > > block-commit is able to reopen the format layers and works as expected. > > > > Unfortunately though the 'read-only' option is actually useful as the > > curl-driver does not work

Re: [Qemu-block] [Qemu-devel] [PATCH 1/2] commit: Add top-node/base-node options

2018-09-05 Thread Eric Blake
On 09/05/2018 07:38 AM, Peter Krempa wrote: block-commit is able to reopen the format layers and works as expected. Unfortunately though the 'read-only' option is actually useful as the curl-driver does not work without it: -blockdev

Re: [Qemu-block] [PATCH for-3.1 v10 25/31] block: Do not copy exact_filename from format file

2018-09-05 Thread Alberto Garcia
On Thu 09 Aug 2018 11:35:22 PM CEST, Max Reitz wrote: > If a format BDS's file BDS is in turn a format BDS, we cannot simply use > the same filename, because when opening a BDS tree based on a filename > alone, qemu will create only one format node on top of one protocol node > (disregarding a

Re: [Qemu-block] [PATCH v4 06/15] block/mirror: conservative mirror_exit refactor

2018-09-05 Thread John Snow
On 09/05/2018 06:43 AM, Max Reitz wrote: > On 2018-09-04 19:09, John Snow wrote: >> For purposes of minimum code movement, refactor the mirror_exit >> callback to use the post-finalization callbacks in a trivial way. >> >> Signed-off-by: John Snow >> --- >> block/mirror.c | 34

Re: [Qemu-block] [PATCH v3 05/15] block/mirror: don't install backing chain on abort

2018-09-05 Thread John Snow
On 09/05/2018 05:54 AM, Kevin Wolf wrote: > Am 04.09.2018 um 21:30 hat Eric Blake geschrieben: >> On 09/04/2018 02:15 PM, John Snow wrote: >> >>> >>> post-script: I really, really hate the "fake cancel" we've implemented >>> for mirror. It makes the job logic so much worse. >> >> Mirror really

Re: [Qemu-block] [PATCH v2 10/10] block: Allow changing 'force-share' on reopen

2018-09-05 Thread Max Reitz
On 2018-09-03 16:34, Alberto Garcia wrote: > 'force-share' is one of the basic BlockdevOptions available for all > drivers, but it's not handled by bdrv_reopen_prepare() so any attempt > to change it results in a "Cannot change the option" error: > >(qemu) qemu-io virtio0 "reopen -o

Re: [Qemu-block] [PATCH v2 09/10] block: Allow changing 'detect-zeroes' on reopen

2018-09-05 Thread Max Reitz
On 2018-09-03 16:34, Alberto Garcia wrote: > 'detect-zeroes' is one of the basic BlockdevOptions available for all > drivers, but it's not handled by bdrv_reopen_prepare(), so any attempt > to change it results in an error: > >(qemu) qemu-io virtio0 "reopen -o detect-zeroes=on" >Cannot

Re: [Qemu-block] [PATCH v2 08/10] block: Allow changing 'discard' on reopen

2018-09-05 Thread Max Reitz
On 2018-09-03 16:34, Alberto Garcia wrote: > 'discard' is one of the basic BlockdevOptions available for all > drivers, but it's not handled by bdrv_reopen_prepare() so any attempt > to change it results in an error: > >(qemu) qemu-io virtio0 "reopen -o discard=on" >Cannot change the

Re: [Qemu-block] [PATCH v2 07/10] file-posix: Forbid trying to change unsupported options during reopen

2018-09-05 Thread Max Reitz
On 2018-09-03 16:34, Alberto Garcia wrote: > The file-posix code is used for the "file", "host_device" and > "host_cdrom" drivers, and it allows reopening images. However the only > option that is actually processed is "x-check-cache-dropped", and > changes in all other options (e.g. "filename")

Re: [Qemu-block] [PATCH v2 06/10] block: Forbid trying to change unsupported options during reopen

2018-09-05 Thread Max Reitz
On 2018-09-03 16:34, Alberto Garcia wrote: > The bdrv_reopen_prepare() function checks all options passed to each > BlockDriverState (in the reopen_state->options QDict) and makes all > necessary preparations to apply the option changes requested by the > user. > > Options are removed from the

Re: [Qemu-block] [PATCH for-3.1 v10 23/31] block: Generically refresh runtime options

2018-09-05 Thread Alberto Garcia
On Thu 09 Aug 2018 11:35:20 PM CEST, Max Reitz wrote: > Instead of having every block driver which implements > bdrv_refresh_filename() copy all of the strong runtime options over to > bs->full_open_options, implement this process generically in > bdrv_refresh_filename(). > > This patch only adds

Re: [Qemu-block] [PATCH for-3.1 v10 22/31] block: Add BlockDriver.bdrv_gather_child_options

2018-09-05 Thread Alberto Garcia
On Thu 09 Aug 2018 11:35:19 PM CEST, Max Reitz wrote: > Some follow-up patches will rework the way bs->full_open_options is > refreshed in bdrv_refresh_filename(). The new implementation will remove > the need for the block drivers' bdrv_refresh_filename() implementations > to set

Re: [Qemu-block] [PATCH v2 05/10] block: Allow child references on reopen

2018-09-05 Thread Max Reitz
On 2018-09-03 16:34, Alberto Garcia wrote: > In the previous patches we removed all child references from > bs->{options,explicit_options} because keeping them is useless and > wrong. > > Because of this, any attempt to reopen a BlockDriverState using a > child reference as one of its options

Re: [Qemu-block] [Qemu-devel] [PATCH 1/2] commit: Add top-node/base-node options

2018-09-05 Thread Peter Krempa
On Tue, Sep 04, 2018 at 17:34:36 +0200, Kevin Wolf wrote: > Am 04.09.2018 um 17:00 hat Peter Krempa geschrieben: > > On Tue, Sep 04, 2018 at 16:42:17 +0200, Alberto Garcia wrote: > > > On Tue 04 Sep 2018 04:17:30 PM CEST, Peter Krempa wrote: [...] > > I remember being told some time ago to

Re: [Qemu-block] [PATCH v2 03/10] block: Remove child references from bs->{options, explicit_options}

2018-09-05 Thread Max Reitz
On 2018-09-03 16:34, Alberto Garcia wrote: > Block drivers allow opening their children using a reference to an > existing BlockDriverState. These references remain stored in the > 'options' and 'explicit_options' QDicts, but we don't need to keep > them once everything is open. > > What is more

Re: [Qemu-block] [PATCH v4 04/15] block/commit: refactor commit to use job callbacks

2018-09-05 Thread Max Reitz
On 2018-09-05 13:53, Kevin Wolf wrote: > Am 05.09.2018 um 13:37 hat Max Reitz geschrieben: >> On 2018-09-05 12:49, Kevin Wolf wrote: >>> Am 05.09.2018 um 12:27 hat Max Reitz geschrieben: On 2018-09-04 22:32, John Snow wrote: > > > On 09/04/2018 02:46 PM, Jeff Cody wrote: >> On

Re: [Qemu-block] [PATCH v4 04/15] block/commit: refactor commit to use job callbacks

2018-09-05 Thread Kevin Wolf
Am 05.09.2018 um 13:37 hat Max Reitz geschrieben: > On 2018-09-05 12:49, Kevin Wolf wrote: > > Am 05.09.2018 um 12:27 hat Max Reitz geschrieben: > >> On 2018-09-04 22:32, John Snow wrote: > >>> > >>> > >>> On 09/04/2018 02:46 PM, Jeff Cody wrote: > On Tue, Sep 04, 2018 at 01:09:19PM -0400,

Re: [Qemu-block] [PATCH v4 04/15] block/commit: refactor commit to use job callbacks

2018-09-05 Thread Max Reitz
On 2018-09-05 12:49, Kevin Wolf wrote: > Am 05.09.2018 um 12:27 hat Max Reitz geschrieben: >> On 2018-09-04 22:32, John Snow wrote: >>> >>> >>> On 09/04/2018 02:46 PM, Jeff Cody wrote: On Tue, Sep 04, 2018 at 01:09:19PM -0400, John Snow wrote: > Use the component callbacks; prepare,

[Qemu-block] [PATCH] block/linux-aio: acquire AioContext before qemu_laio_process_completions

2018-09-05 Thread Sergio Lopez
In qemu_laio_process_completions_and_submit, the AioContext is acquired before the ioq_submit iteration and after qemu_laio_process_completions, but the latter is not thread safe either. This change avoids a number of random crashes when the Main Thread and an IO Thread collide processing

Re: [Qemu-block] [PATCH v4 04/15] block/commit: refactor commit to use job callbacks

2018-09-05 Thread Kevin Wolf
Am 05.09.2018 um 12:27 hat Max Reitz geschrieben: > On 2018-09-04 22:32, John Snow wrote: > > > > > > On 09/04/2018 02:46 PM, Jeff Cody wrote: > >> On Tue, Sep 04, 2018 at 01:09:19PM -0400, John Snow wrote: > >>> Use the component callbacks; prepare, abort, and clean. > >>> > >>> NB: prepare is

Re: [Qemu-block] [PATCH v4 10/15] tests/test-blockjob-txn: move .exit to .clean

2018-09-05 Thread Max Reitz
On 2018-09-04 19:09, John Snow wrote: > The exit callback in this test actually only performs cleanup. > > Signed-off-by: John Snow > --- > tests/test-blockjob-txn.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) Reviewed-by: Max Reitz signature.asc Description: OpenPGP

Re: [Qemu-block] [PATCH v4 06/15] block/mirror: conservative mirror_exit refactor

2018-09-05 Thread Max Reitz
On 2018-09-04 19:09, John Snow wrote: > For purposes of minimum code movement, refactor the mirror_exit > callback to use the post-finalization callbacks in a trivial way. > > Signed-off-by: John Snow > --- > block/mirror.c | 34 +++--- > 1 file changed, 27

Re: [Qemu-block] [PATCH v4 05/15] block/mirror: don't install backing chain on abort

2018-09-05 Thread Max Reitz
On 2018-09-04 19:09, John Snow wrote: > In cases where we abort the block/mirror job, there's no point in > installing the new backing chain before we finish aborting. > > Move this to the "success" portion of mirror_exit. Sounds a bit weird now that you don't do any moving. > Signed-off-by:

Re: [Qemu-block] [PATCH v4 04/15] block/commit: refactor commit to use job callbacks

2018-09-05 Thread Max Reitz
On 2018-09-04 22:32, John Snow wrote: > > > On 09/04/2018 02:46 PM, Jeff Cody wrote: >> On Tue, Sep 04, 2018 at 01:09:19PM -0400, John Snow wrote: >>> Use the component callbacks; prepare, abort, and clean. >>> >>> NB: prepare is only called when the job has not yet failed; >>> and abort can be

Re: [Qemu-block] [PATCH v3 05/15] block/mirror: don't install backing chain on abort

2018-09-05 Thread Kevin Wolf
Am 04.09.2018 um 21:30 hat Eric Blake geschrieben: > On 09/04/2018 02:15 PM, John Snow wrote: > > > > > post-script: I really, really hate the "fake cancel" we've implemented > > for mirror. It makes the job logic so much worse. > > Mirror really does have a tri-state way to end the job (and

[Qemu-block] [PATCH] util/async: use qemu_aio_coroutine_enter in co_schedule_bh_cb

2018-09-05 Thread Sergio Lopez
AIO Coroutines shouldn't by managed by an AioContext different than the one assigned when they are created. aio_co_enter avoids entering a coroutine from a different AioContext, calling aio_co_schedule instead. Scheduled coroutines are then entered by co_schedule_bh_cb using qemu_coroutine_enter,