From: Eric Blake <eblake@redhat.com>
To: Peter Lieven <pl@kamp.de>, qemu-devel@nongnu.org
Cc: qemu-block@nongnu.org, kwolf@redhat.com, stefanha@gmail.com,
ct@flyingcircus.io, mreitz@redhat.com, famz@redhat.com
Subject: Re: [Qemu-devel] [PATCH V2] qemu-img: make convert async
Date: Mon, 27 Feb 2017 15:09:57 -0600 [thread overview]
Message-ID: <07ef9e24-a17b-536b-8ef3-9a105cfe6bc6@redhat.com> (raw)
In-Reply-To: <1488193394-28453-1-git-send-email-pl@kamp.de>
[-- Attachment #1: Type: text/plain, Size: 2467 bytes --]
On 02/27/2017 05:03 AM, Peter Lieven wrote:
> the convert process is currently completely implemented with sync operations.
> That means it reads one buffer and then writes it. No parallelism and each sync
> request takes as long as it takes until it is completed.
>
>
> This patches introduces 2 new cmdline parameters. The -m parameter to specify
> the number of coroutines running in parallel (defaults to 8). And the -W paremeter to
s/paremeter/parameter/
> allow qemu-img to write to the target out of order rather than sequential. This improves
> performance as the writes do not have to wait for each other to complete.
>
> Signed-off-by: Peter Lieven <pl@kamp.de>
> ---
> @@ -1798,7 +1908,7 @@ static int img_convert(int argc, char **argv)
> {"image-opts", no_argument, 0, OPTION_IMAGE_OPTS},
> {0, 0, 0, 0}
> };
> - c = getopt_long(argc, argv, "hf:O:B:ce6o:s:l:S:pt:T:qn",
> + c = getopt_long(argc, argv, "hf:O:B:ce6o:s:l:S:pt:T:qnm:W",
> long_options, NULL);
> if (c == -1) {
> break;
> @@ -1890,6 +2000,18 @@ static int img_convert(int argc, char **argv)
> case 'n':
> skip_create = 1;
> break;
> + case 'm':
> + num_coroutines = atoi(optarg);
atoi() should be avoided. It has no error checking, so it treats '-m 1'
and '-m 1k' identically. You are a bit justified in that '-m junk' gets
treated like '-m 0' and rejected, but it's still a poor error message in
that case.
> + if (num_coroutines < 1 || num_coroutines > MAX_COROUTINES) {
> + error_report("Allowed number of coroutines is between 1 and %d",
> + MAX_COROUTINES);
> +++ b/qemu-img.texi
> @@ -137,6 +137,12 @@ Parameters to convert subcommand:
>
> @item -n
> Skip the creation of the target volume
> +@item -m
> +Number of parallel coroutines for the convert process
> +@item -W
> +Allow to write out of order to the destination. This is option improves performance,
Grammar suggestion:
Allow out-of-order writes to the destination. This option ...
> +but is only recommened for preallocated devices like host devices or other
s/recommened/recommended/
> +raw block devices.
> @end table
>
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]
next prev parent reply other threads:[~2017-02-27 21:10 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-27 11:03 [Qemu-devel] [PATCH V2] qemu-img: make convert async Peter Lieven
2017-02-27 13:32 ` Stefan Hajnoczi
2017-02-27 20:37 ` Kevin Wolf
2017-02-27 21:09 ` Eric Blake [this message]
2017-02-28 9:59 ` Peter Lieven
2017-02-28 10:30 ` Kevin Wolf
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=07ef9e24-a17b-536b-8ef3-9a105cfe6bc6@redhat.com \
--to=eblake@redhat.com \
--cc=ct@flyingcircus.io \
--cc=famz@redhat.com \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=pl@kamp.de \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@gmail.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).