From: Jeff Cody <jcody@redhat.com>
To: John Snow <jsnow@redhat.com>
Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org,
Max Reitz <mreitz@redhat.com>, Kevin Wolf <kwolf@redhat.com>,
Markus Armbruster <armbru@redhat.com>,
"Dr. David Alan Gilbert" <dgilbert@redhat.com>,
Eric Blake <eblake@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v3 02/15] block/mirror: add block job creation flags
Date: Fri, 31 Aug 2018 23:31:07 -0400 [thread overview]
Message-ID: <20180901033106.GB416857@localhost.localdomain> (raw)
In-Reply-To: <20180831222907.16257-3-jsnow@redhat.com>
On Fri, Aug 31, 2018 at 06:28:54PM -0400, John Snow wrote:
> Add support for taking and passing forward job creaton flags.
>
> Signed-off-by: John Snow <jsnow@redhat.com>
> Reviewed-by: Max Reitz <mreitz@redhat.com>
> ---
> block/mirror.c | 5 +++--
> blockdev.c | 3 ++-
> include/block/block_int.h | 5 ++++-
> 3 files changed, 9 insertions(+), 4 deletions(-)
>
> diff --git a/block/mirror.c b/block/mirror.c
> index b8941db6c1..cba555b4ef 100644
> --- a/block/mirror.c
> +++ b/block/mirror.c
> @@ -1639,7 +1639,8 @@ fail:
>
> void mirror_start(const char *job_id, BlockDriverState *bs,
> BlockDriverState *target, const char *replaces,
> - int64_t speed, uint32_t granularity, int64_t buf_size,
> + int creation_flags, int64_t speed,
> + uint32_t granularity, int64_t buf_size,
> MirrorSyncMode mode, BlockMirrorBackingMode backing_mode,
> BlockdevOnError on_source_error,
> BlockdevOnError on_target_error,
> @@ -1655,7 +1656,7 @@ void mirror_start(const char *job_id, BlockDriverState *bs,
> }
> is_none_mode = mode == MIRROR_SYNC_MODE_NONE;
> base = mode == MIRROR_SYNC_MODE_TOP ? backing_bs(bs) : NULL;
> - mirror_start_job(job_id, bs, JOB_DEFAULT, target, replaces,
> + mirror_start_job(job_id, bs, creation_flags, target, replaces,
> speed, granularity, buf_size, backing_mode,
> on_source_error, on_target_error, unmap, NULL, NULL,
> &mirror_job_driver, is_none_mode, base, false,
This is another one of those comments that do not pertain directly to this
patch, so it doesn't affect my r-b. So let's get that out of the way:
Reviewed-by: Jeff Cody <jcody@redhat.com>
Some of the block job functions have an impressive number of arguments now
(and have for a while, this isn't all that new). I don't know if it is a
sign that our data design is a bit out of whack, or what. But for instance,
mirror_start_job() takes 22 (!) parameters. Seems like something worth
examining at some point.
-Jeff
> diff --git a/blockdev.c b/blockdev.c
> index c15a1e624b..6574356708 100644
> --- a/blockdev.c
> +++ b/blockdev.c
> @@ -3590,6 +3590,7 @@ static void blockdev_mirror_common(const char *job_id, BlockDriverState *bs,
> bool has_copy_mode, MirrorCopyMode copy_mode,
> Error **errp)
> {
> + int job_flags = JOB_DEFAULT;
>
> if (!has_speed) {
> speed = 0;
> @@ -3642,7 +3643,7 @@ static void blockdev_mirror_common(const char *job_id, BlockDriverState *bs,
> * and will allow to check whether the node still exist at mirror completion
> */
> mirror_start(job_id, bs, target,
> - has_replaces ? replaces : NULL,
> + has_replaces ? replaces : NULL, job_flags,
> speed, granularity, buf_size, sync, backing_mode,
> on_source_error, on_target_error, unmap, filter_node_name,
> copy_mode, errp);
> diff --git a/include/block/block_int.h b/include/block/block_int.h
> index ffab0b4d3e..b40f0bfc9b 100644
> --- a/include/block/block_int.h
> +++ b/include/block/block_int.h
> @@ -1029,6 +1029,8 @@ void commit_active_start(const char *job_id, BlockDriverState *bs,
> * @target: Block device to write to.
> * @replaces: Block graph node name to replace once the mirror is done. Can
> * only be used when full mirroring is selected.
> + * @creation_flags: Flags that control the behavior of the Job lifetime.
> + * See @BlockJobCreateFlags
> * @speed: The maximum speed, in bytes per second, or 0 for unlimited.
> * @granularity: The chosen granularity for the dirty bitmap.
> * @buf_size: The amount of data that can be in flight at one time.
> @@ -1050,7 +1052,8 @@ void commit_active_start(const char *job_id, BlockDriverState *bs,
> */
> void mirror_start(const char *job_id, BlockDriverState *bs,
> BlockDriverState *target, const char *replaces,
> - int64_t speed, uint32_t granularity, int64_t buf_size,
> + int creation_flags, int64_t speed,
> + uint32_t granularity, int64_t buf_size,
> MirrorSyncMode mode, BlockMirrorBackingMode backing_mode,
> BlockdevOnError on_source_error,
> BlockdevOnError on_target_error,
> --
> 2.14.4
>
next prev parent reply other threads:[~2018-09-01 3:36 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-31 22:28 [Qemu-devel] [PATCH v3 00/15] jobs: Job Exit Refactoring Pt 2 John Snow
2018-08-31 22:28 ` [Qemu-devel] [PATCH v3 01/15] block/commit: add block job creation flags John Snow
2018-09-01 3:17 ` Jeff Cody
2018-08-31 22:28 ` [Qemu-devel] [PATCH v3 02/15] block/mirror: " John Snow
2018-09-01 3:31 ` Jeff Cody [this message]
2018-08-31 22:28 ` [Qemu-devel] [PATCH v3 03/15] block/stream: " John Snow
2018-08-31 22:34 ` Eric Blake
2018-09-01 3:33 ` Jeff Cody
2018-08-31 22:28 ` [Qemu-devel] [PATCH v3 04/15] block/commit: refactor commit to use job callbacks John Snow
2018-08-31 22:28 ` [Qemu-devel] [PATCH v3 05/15] block/mirror: don't install backing chain on abort John Snow
2018-09-03 9:24 ` Max Reitz
2018-09-04 19:15 ` John Snow
2018-09-04 19:30 ` Eric Blake
2018-09-04 20:10 ` John Snow
2018-09-05 9:54 ` Kevin Wolf
2018-09-05 12:59 ` John Snow
2018-08-31 22:28 ` [Qemu-devel] [PATCH v3 06/15] block/mirror: conservative mirror_exit refactor John Snow
2018-09-03 9:32 ` Max Reitz
2018-09-04 16:17 ` John Snow
2018-08-31 22:28 ` [Qemu-devel] [PATCH v3 07/15] block/commit: refactor stream to use job callbacks John Snow
2018-09-03 9:33 ` Max Reitz
2018-08-31 22:29 ` [Qemu-devel] [PATCH v3 08/15] tests/blockjob: replace Blockjob with Job John Snow
2018-08-31 22:29 ` [Qemu-devel] [PATCH v3 09/15] tests/test-blockjob: remove exit callback John Snow
2018-08-31 22:29 ` [Qemu-devel] [PATCH v3 10/15] tests/test-blockjob-txn: move .exit to .clean John Snow
2018-09-03 9:41 ` Max Reitz
2018-08-31 22:29 ` [Qemu-devel] [PATCH v3 11/15] jobs: remove .exit callback John Snow
2018-08-31 22:29 ` [Qemu-devel] [PATCH v3 12/15] qapi/block-commit: expose new job properties John Snow
2018-08-31 22:29 ` [Qemu-devel] [PATCH v3 13/15] qapi/block-mirror: " John Snow
2018-08-31 22:29 ` [Qemu-devel] [PATCH v3 14/15] qapi/block-stream: " John Snow
2018-08-31 22:29 ` [Qemu-devel] [PATCH v3 15/15] block/backup: qapi documentation fixup John Snow
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180901033106.GB416857@localhost.localdomain \
--to=jcody@redhat.com \
--cc=armbru@redhat.com \
--cc=dgilbert@redhat.com \
--cc=eblake@redhat.com \
--cc=jsnow@redhat.com \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.