Re: [Qemu-block] [PATCH] vmdk: align end of file to a sector boundary

2018-09-04 Thread yuchenlin
Ping! yuchen...@synology.com 於 2018-08-28 11:18 寫道: > From: yuchenlin There is a rare case which the size > of last compressed cluster is larger than the cluster size, which will cause > the file is not aligned at the sector boundary. Signed-off-by: yuchenlin > --- block/vmdk.c | 18 +

[Qemu-block] [PATCH v2] blkdebug: Add support for latency rules

2018-09-04 Thread Marc Olson
Sometimes storage devices can be slow to respond, due to media errors, firmware issues, SSD garbage collection, etc. This patch adds a new rule type to blkdebug that allows injection of latency to I/O operations. Similar to error injection rules, latency rules can be specified with or without an of

Re: [Qemu-block] [Qemu-devel] [PATCH 04/16] test/qgraph: aarch64/xlnx-zcu102 machine node

2018-09-04 Thread Alistair Francis
On Mon, Aug 20, 2018 at 5:02 AM, Emanuele Giuseppe Esposito wrote: > Add xlnx-zcu102 machine to the graph. This machine contains generic-sdhci, so > its constructor must take care of setting it properly when called. > > Signed-off-by: Emanuele Giuseppe Esposito Acked-by: Alistair Francis Alist

Re: [Qemu-block] [Qemu-devel] [PATCH 03/16] test/qgraph: arm/xlinx-zynq-a9 machine node

2018-09-04 Thread Alistair Francis
On Mon, Aug 20, 2018 at 5:02 AM, Emanuele Giuseppe Esposito wrote: > Add xlinx-zynq-a9 machine to the graph. This machine contains generic-sdhci, > so > its constructor must take care of setting it properly when called. > > Signed-off-by: Emanuele Giuseppe Esposito Acked-by: Alistair Francis

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

2018-09-04 Thread John Snow
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 called after prepare. >> >> complete -> prepare -

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

2018-09-04 Thread John Snow
On 09/04/2018 03:30 PM, Eric Blake wrote: > 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 accessible >

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

2018-09-04 Thread Eric Blake
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 accessible only after the job has moved into the sync state): cancel

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

2018-09-04 Thread John Snow
On 09/03/2018 05:24 AM, Max Reitz wrote: > On 2018-09-01 00:28, 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. >> >> Signed-off-by: John

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

2018-09-04 Thread Jeff Cody
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 called after prepare. > > complete -> prepare -> abort -> clean > complete -> abort -> clean > >

[Qemu-block] [PATCH v4 11/15] jobs: remove .exit callback

2018-09-04 Thread John Snow
Now that all of the jobs use the component finalization callbacks, there's no use for the heavy-hammer .exit callback anymore. job_exit becomes a glorified type shim so that we can call job_completed from aio_bh_schedule_oneshot. Move these three functions down into job.c to eliminate a forward r

[Qemu-block] [PATCH v4 12/15] qapi/block-commit: expose new job properties

2018-09-04 Thread John Snow
Signed-off-by: John Snow Reviewed-by: Max Reitz --- blockdev.c | 8 qapi/block-core.json | 16 +++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/blockdev.c b/blockdev.c index ec90eb1cf9..98b91e75a7 100644 --- a/blockdev.c +++ b/blockdev.c @@ -320

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

2018-09-04 Thread John Snow
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(-) diff --git a/tests/test-blockjob-txn.c b/tests/test-blockjob-txn.c index ef29f35e44..86606f92b3 100644 --- a/tests/test

[Qemu-block] [PATCH v4 09/15] tests/test-blockjob: remove exit callback

2018-09-04 Thread John Snow
We remove the exit callback and the completed boolean along with it. We can simulate it just fine by waiting for the job to defer to the main loop, and then giving it one final kick to get the main loop portion to run. Signed-off-by: John Snow Reviewed-by: Max Reitz --- tests/test-blockjob.c |

[Qemu-block] [PATCH v4 08/15] tests/blockjob: replace Blockjob with Job

2018-09-04 Thread John Snow
These tests don't actually test blockjobs anymore, they test generic Job lifetimes. Change the types accordingly. Signed-off-by: John Snow Reviewed-by: Max Reitz --- tests/test-blockjob.c | 98 ++- 1 file changed, 50 insertions(+), 48 deletions(-)

[Qemu-block] [PATCH v4 13/15] qapi/block-mirror: expose new job properties

2018-09-04 Thread John Snow
Signed-off-by: John Snow Reviewed-by: Max Reitz --- blockdev.c | 14 ++ qapi/block-core.json | 30 -- 2 files changed, 42 insertions(+), 2 deletions(-) diff --git a/blockdev.c b/blockdev.c index 98b91e75a7..429cdf9901 100644 --- a/blockdev.c +++

[Qemu-block] [PATCH v4 15/15] block/backup: qapi documentation fixup

2018-09-04 Thread John Snow
Fix documentation to match the other jobs amended for 3.1. Signed-off-by: John Snow Reviewed-by: Max Reitz --- qapi/block-core.json | 18 ++ 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/qapi/block-core.json b/qapi/block-core.json index f877e9e414..c0b3d33dbb 10

[Qemu-block] [PATCH v4 14/15] qapi/block-stream: expose new job properties

2018-09-04 Thread John Snow
Signed-off-by: John Snow Reviewed-by: Max Reitz --- blockdev.c | 9 + hmp.c| 5 +++-- qapi/block-core.json | 16 +++- 3 files changed, 27 insertions(+), 3 deletions(-) diff --git a/blockdev.c b/blockdev.c index 429cdf9901..0cf8febe6c 100644 --- a/

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

2018-09-04 Thread John Snow
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 insertions(+), 7 deletions(-) diff --git a/block/mirror.c b/b

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

2018-09-04 Thread John Snow
Use the component callbacks; prepare, abort, and clean. NB: prepare is only called when the job has not yet failed; and abort can be called after prepare. complete -> prepare -> abort -> clean complete -> abort -> clean Signed-off-by: John Snow Reviewed-by: Max Reitz --- block/commit.c | 90 +

[Qemu-block] [PATCH v4 07/15] block/stream: refactor stream to use job callbacks

2018-09-04 Thread John Snow
Signed-off-by: John Snow Reviewed-by: Max Reitz --- block/stream.c | 23 +++ 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/block/stream.c b/block/stream.c index 700eb239e4..81a7ec8ece 100644 --- a/block/stream.c +++ b/block/stream.c @@ -54,16 +54,16 @@ static

[Qemu-block] [PATCH v4 03/15] block/stream: add block job creation flags

2018-09-04 Thread John Snow
Add support for taking and passing forward job creation flags. Signed-off-by: John Snow Reviewed-by: Max Reitz Reviewed-by: Jeff Cody --- block/stream.c| 5 +++-- blockdev.c| 3 ++- include/block/block_int.h | 5 - 3 files changed, 9 insertions(+), 4 deletions(-

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

2018-09-04 Thread John Snow
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. Signed-off-by: John Snow --- block/mirror.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a

[Qemu-block] [PATCH v4 01/15] block/commit: add block job creation flags

2018-09-04 Thread John Snow
Add support for taking and passing forward job creation flags. Signed-off-by: John Snow Reviewed-by: Max Reitz Reviewed-by: Jeff Cody --- block/commit.c| 5 +++-- blockdev.c| 7 --- include/block/block_int.h | 5 - 3 files changed, 11 insertions(+), 6 deleti

[Qemu-block] [PATCH v4 02/15] block/mirror: add block job creation flags

2018-09-04 Thread John Snow
Add support for taking and passing forward job creation flags. Signed-off-by: John Snow Reviewed-by: Max Reitz Reviewed-by: Jeff Cody --- block/mirror.c| 5 +++-- blockdev.c| 3 ++- include/block/block_int.h | 5 - 3 files changed, 9 insertions(+), 4 deletions(-

[Qemu-block] [PATCH v4 00/15] jobs: Job Exit Refactoring Pt 2

2018-09-04 Thread John Snow
This is part two of a two part series that refactors the exit logic of jobs. This series forces all jobs to use the "finalize" semantics that were introduced previously, but only exposed via the backup jobs. Patches 1-3 add plumbing for the auto-dismiss and auto-finalize flags but do not expose t

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

2018-09-04 Thread John Snow
On 09/03/2018 05:32 AM, Max Reitz wrote: > On 2018-09-01 00:28, 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 | 31

Re: [Qemu-block] [Qemu-devel] [PATCH v3 2/9] jobs: canonize Error object

2018-09-04 Thread John Snow
On 09/03/2018 10:11 AM, Markus Armbruster wrote: > Kevin Wolf writes: > >> Am 01.09.2018 um 09:54 hat Markus Armbruster geschrieben: >>> John Snow writes: >>> On 08/31/2018 02:08 AM, Markus Armbruster wrote: > Eric Blake writes: > >> On 08/29/2018 08:57 PM, John Snow wrote:

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

2018-09-04 Thread Kevin Wolf
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: > > >> >> libvirt-3-format is read-write and all other node names are > > >> >> readonly in the above example. > > >> >>

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

2018-09-04 Thread Peter Krempa
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: > >> >> libvirt-3-format is read-write and all other node names are > >> >> readonly in the above example. > >> >> > >> >> The same also happens when using filenames: > >> >> >

Re: [Qemu-block] [RFC PATCH 4/5] block: Drop AioContext lock in bdrv_drain_poll_top_level()

2018-09-04 Thread Kevin Wolf
Am 24.08.2018 um 09:24 hat Fam Zheng geschrieben: > On Fri, 08/17 19:02, Kevin Wolf wrote: > > Simimlar to AIO_WAIT_WHILE(), bdrv_drain_poll_top_level() needs to > > release the AioContext lock of the node to be drained before calling > > aio_poll(). Otherwise, callbacks called by aio_poll() would

Re: [Qemu-block] [RFC PATCH 3/5] job: Drop AioContext lock around aio_poll()

2018-09-04 Thread Kevin Wolf
Am 24.08.2018 um 09:22 hat Fam Zheng geschrieben: > On Fri, 08/17 19:02, Kevin Wolf wrote: > > Simimlar to AIO_WAIT_WHILE(), job_finish_sync() needs to release the > > AioContext lock of the job before calling aio_poll(). Otherwise, > > callbacks called by aio_poll() would possibly take the lock a

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

2018-09-04 Thread Alberto Garcia
On Tue 04 Sep 2018 04:17:30 PM CEST, Peter Krempa wrote: >> >> libvirt-3-format is read-write and all other node names are >> >> readonly in the above example. >> >> >> >> The same also happens when using filenames: >> >> >> >> {"execute":"block-commit", >> >> "arguments" : {"device":"libvirt-3-

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

2018-09-04 Thread Peter Krempa
On Mon, Sep 03, 2018 at 17:03:11 +0200, Kevin Wolf wrote: > Am 28.08.2018 um 16:26 hat Peter Krempa geschrieben: > > On Fri, Aug 10, 2018 at 18:26:57 +0200, Kevin Wolf wrote: > > > The block-commit QMP command required specifying the top and base nodes > > > of the commit jobs using the file name o

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

2018-09-04 Thread Peter Krempa
On Tue, Sep 04, 2018 at 15:13:44 +0200, Alberto Garcia wrote: > On Mon 03 Sep 2018 05:03:11 PM CEST, Kevin Wolf wrote: > >> libvirt-3-format is read-write and all other node names are readonly in > >> the above example. > >> > >> The same also happens when using filenames: > >> > >> {"execute":"b

Re: [Qemu-block] [PATCH for-3.1 v10 05/31] block: Respect backing bs in bdrv_refresh_filename

2018-09-04 Thread Alberto Garcia
On Wed 29 Aug 2018 11:44:52 AM CEST, Max Reitz wrote: > On 2018-08-28 15:26, Alberto Garcia wrote: >> On Thu 09 Aug 2018 11:35:02 PM CEST, Max Reitz wrote: >>> +backing_overridden = bdrv_backing_overridden(bs); >>> + >>> +if (bs->open_flags & BDRV_O_NO_IO) { >>> +/* Without I/O, the

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

2018-09-04 Thread Alberto Garcia
On Mon 03 Sep 2018 05:03:11 PM CEST, Kevin Wolf wrote: >> libvirt-3-format is read-write and all other node names are readonly in >> the above example. >> >> The same also happens when using filenames: >> >> {"execute":"block-commit", >> "arguments" : {"device":"libvirt-3-format", >>