From nobody Fri Mar 29 11:25:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1487683241415492.7152626135244; Tue, 21 Feb 2017 05:20:41 -0800 (PST) Received: from localhost ([::1]:44529 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cgAMv-0007vm-UA for importer@patchew.org; Tue, 21 Feb 2017 08:20:38 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47317) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cg9a2-0003Rm-07 for qemu-devel@nongnu.org; Tue, 21 Feb 2017 07:30:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cg9Zx-0006Uy-UH for qemu-devel@nongnu.org; Tue, 21 Feb 2017 07:30:05 -0500 Received: from mx-v6.kamp.de ([2a02:248:0:51::16]:41359 helo=mx01.kamp.de) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cg9Zx-0006Uf-Io for qemu-devel@nongnu.org; Tue, 21 Feb 2017 07:30:01 -0500 Received: (qmail 23314 invoked by uid 89); 21 Feb 2017 12:29:58 -0000 Received: from [195.62.97.28] by client-16-kamp (envelope-from , uid 89) with qmail-scanner-2010/03/19-MF (clamdscan: 0.99.2/23102. avast: 1.2.2/17010300. spamassassin: 3.4.1. Clear:RC:1(195.62.97.28):. Processed in 0.109439 secs); 21 Feb 2017 12:29:58 -0000 Received: from smtp.kamp.de (HELO submission.kamp.de) ([195.62.97.28]) by mx01.kamp.de with ESMTPS (DHE-RSA-AES256-GCM-SHA384 encrypted); 21 Feb 2017 12:29:56 -0000 Received: (qmail 11511 invoked from network); 21 Feb 2017 12:29:56 -0000 Received: from lieven-pc.kamp-intra.net (HELO lieven-pc) (relay@kamp.de@::ffff:172.21.12.60) by submission.kamp.de with ESMTPS (DHE-RSA-AES256-GCM-SHA384 encrypted) ESMTPA; 21 Feb 2017 12:29:56 -0000 Received: by lieven-pc (Postfix, from userid 1000) id 853D8209B6; Tue, 21 Feb 2017 13:29:56 +0100 (CET) X-GL_Whitelist: yes From: Peter Lieven To: qemu-devel@nongnu.org Date: Tue, 21 Feb 2017 13:29:51 +0100 Message-Id: <1487680191-13096-1-git-send-email-pl@kamp.de> X-Mailer: git-send-email 1.9.1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a02:248:0:51::16 Subject: [Qemu-devel] [PATCH] qemu-img: make convert async X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, famz@redhat.com, qemu-block@nongnu.org, stefanha@gmail.com, Peter Lieven , ct@flyingcircus.io, mreitz@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" the convert process is currently completely implemented with sync operation= s. 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 can be a big performance hit when the convert process reads and writes to devices which do not benefit from kernel readahead or pagecache. In our environment we heavily have the following two use cases when using qemu-img convert. a) reading from NFS and writing to iSCSI for deploying templates b) reading from iSCSI and writing to NFS for backups In both processes we use libiscsi and libnfs so we have no kernel cache. This patch changes the convert process to work with parallel running corout= ines which can significantly improve performance for network storage devices: qemu-img (master) nfs -> iscsi 22.8 secs nfs -> ram 11.7 secs ram -> iscsi 12.3 secs qemu-img-async (8 coroutines, in-order write disabled) nfs -> iscsi 11.0 secs nfs -> ram 10.4 secs ram -> iscsi 9.0 secs This patches introduces 2 new cmdline parameters. The -m parameter to speci= fy the number of coroutines running in parallel (defaults to 8). And the -W pa= remeter to 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 Reviewed-by: Stefan Hajnoczi --- RFC->V1: - add documentation - add missing coroutine_fn annotation [Stefan] - add a comment why it is safe to call coroutine_enter [Stefan] - check -m paramater for values < 1 [Stefan] - disallow -W parameter with compression [Stefan] RFC V3->V4: - avoid to prepare a request queue upfront [Kevin] - do not ignore the BLK_BACKING_FILE status [Kevin] - redesign the interface to the read and write routines [Kevin] =20 RFC V2->V3: - updated stats in the commit msg from a host with a better net= work card - only wake up the coroutine that is acutally waiting for a wri= te to complete. this was not only overhead, but also breaking at least linux = AIO. - fix coding style complaints - rename some variables and structs =20 RFC V1->V2: - using coroutine as worker "threads". [Max] - keeping the request queue as otherwise it happens that we wait on BLK_ZERO chunks while keeping the write order. it also avoids redundant calls to get_block_status and helps to skip some conditions for fully allocated imaged (!s->min_s= parse) qemu-img-cmds.hx | 4 +- qemu-img.c | 276 ++++++++++++++++++++++++++++++++++++++++-----------= ---- qemu-img.texi | 16 +++- 3 files changed, 220 insertions(+), 76 deletions(-) diff --git a/qemu-img-cmds.hx b/qemu-img-cmds.hx index f054599..9c9702c 100644 --- a/qemu-img-cmds.hx +++ b/qemu-img-cmds.hx @@ -40,9 +40,9 @@ STEXI ETEXI =20 DEF("convert", img_convert, - "convert [--object objectdef] [--image-opts] [-c] [-p] [-q] [-n] [-f f= mt] [-t cache] [-T src_cache] [-O output_fmt] [-o options] [-s snapshot_id_= or_name] [-l snapshot_param] [-S sparse_size] filename [filename2 [...]] ou= tput_filename") + "convert [--object objectdef] [--image-opts] [-c] [-p] [-q] [-n] [-f f= mt] [-t cache] [-T src_cache] [-O output_fmt] [-o options] [-s snapshot_id_= or_name] [-l snapshot_param] [-S sparse_size] [-m num_coroutines] [-W] file= name [filename2 [...]] output_filename") STEXI -@item convert [--object @var{objectdef}] [--image-opts] [-c] [-p] [-q] [-n= ] [-f @var{fmt}] [-t @var{cache}] [-T @var{src_cache}] [-O @var{output_fmt}= ] [-o @var{options}] [-s @var{snapshot_id_or_name}] [-l @var{snapshot_param= }] [-S @var{sparse_size}] @var{filename} [@var{filename2} [...]] @var{outpu= t_filename} +@item convert [--object @var{objectdef}] [--image-opts] [-c] [-p] [-q] [-n= ] [-f @var{fmt}] [-t @var{cache}] [-T @var{src_cache}] [-O @var{output_fmt}= ] [-o @var{options}] [-s @var{snapshot_id_or_name}] [-l @var{snapshot_param= }] [-S @var{sparse_size}] [-m @var{num_coroutines}] [-W] @var{filename} [@v= ar{filename2} [...]] @var{output_filename} ETEXI =20 DEF("dd", img_dd, diff --git a/qemu-img.c b/qemu-img.c index cff22e3..00609f4 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -156,6 +156,11 @@ static void QEMU_NORETURN help(void) " kinds of errors, with a higher risk of choosing the wro= ng fix or\n" " hiding corruption that has already occurred.\n" "\n" + "Parameters to convert subcommand:\n" + " '-m' specifies how many coroutines work in parallel during t= he convert\n" + " process (defaults to 8)\n" + " '-W' allow to write to the target out of order rather than s= equential\n" + "\n" "Parameters to snapshot subcommand:\n" " 'snapshot' is the name of the snapshot to create, apply or d= elete\n" " '-a' applies a snapshot (revert disk to saved state)\n" @@ -1448,6 +1453,8 @@ enum ImgConvertBlockStatus { BLK_BACKING_FILE, }; =20 +#define MAX_COROUTINES 16 + typedef struct ImgConvertState { BlockBackend **src; int64_t *src_sectors; @@ -1455,15 +1462,25 @@ typedef struct ImgConvertState { int64_t src_cur_offset; int64_t total_sectors; int64_t allocated_sectors; + int64_t allocated_done; + int64_t sector_num; + int64_t wr_offs; enum ImgConvertBlockStatus status; int64_t sector_next_status; BlockBackend *target; bool has_zero_init; bool compressed; bool target_has_backing; + bool wr_in_order; int min_sparse; size_t cluster_sectors; size_t buf_sectors; + int num_coroutines; + int running_coroutines; + Coroutine *co[MAX_COROUTINES]; + int64_t wait_sector_num[MAX_COROUTINES]; + CoMutex lock; + int ret; } ImgConvertState; =20 static void convert_select_part(ImgConvertState *s, int64_t sector_num) @@ -1544,11 +1561,12 @@ static int convert_iteration_sectors(ImgConvertStat= e *s, int64_t sector_num) return n; } =20 -static int convert_read(ImgConvertState *s, int64_t sector_num, int nb_sec= tors, - uint8_t *buf) +static int coroutine_fn convert_co_read(ImgConvertState *s, int64_t sector= _num, + int nb_sectors, uint8_t *buf) { - int n; - int ret; + int n, ret; + QEMUIOVector qiov; + struct iovec iov; =20 assert(nb_sectors <=3D s->buf_sectors); while (nb_sectors > 0) { @@ -1563,9 +1581,13 @@ static int convert_read(ImgConvertState *s, int64_t = sector_num, int nb_sectors, bs_sectors =3D s->src_sectors[s->src_cur]; =20 n =3D MIN(nb_sectors, bs_sectors - (sector_num - s->src_cur_offset= )); - ret =3D blk_pread(blk, - (sector_num - s->src_cur_offset) << BDRV_SECTOR_BI= TS, - buf, n << BDRV_SECTOR_BITS); + iov.iov_base =3D buf; + iov.iov_len =3D n << BDRV_SECTOR_BITS; + qemu_iovec_init_external(&qiov, &iov, 1); + + ret =3D blk_co_preadv( + blk, (sector_num - s->src_cur_offset) << BDRV_SECTOR_BITS, + n << BDRV_SECTOR_BITS, &qiov, 0); if (ret < 0) { return ret; } @@ -1578,15 +1600,18 @@ static int convert_read(ImgConvertState *s, int64_t= sector_num, int nb_sectors, return 0; } =20 -static int convert_write(ImgConvertState *s, int64_t sector_num, int nb_se= ctors, - const uint8_t *buf) + +static int coroutine_fn convert_co_write(ImgConvertState *s, int64_t secto= r_num, + int nb_sectors, uint8_t *buf, + enum ImgConvertBlockStatus status) { int ret; + QEMUIOVector qiov; + struct iovec iov; =20 while (nb_sectors > 0) { int n =3D nb_sectors; - - switch (s->status) { + switch (status) { case BLK_BACKING_FILE: /* If we have a backing file, leave clusters unallocated that = are * unallocated in the source image, so that the backing file is @@ -1607,9 +1632,13 @@ static int convert_write(ImgConvertState *s, int64_t= sector_num, int nb_sectors, break; } =20 - ret =3D blk_pwrite_compressed(s->target, - sector_num << BDRV_SECTOR_BITS, - buf, n << BDRV_SECTOR_BITS); + iov.iov_base =3D buf; + iov.iov_len =3D n << BDRV_SECTOR_BITS; + qemu_iovec_init_external(&qiov, &iov, 1); + + ret =3D blk_co_pwritev(s->target, sector_num << BDRV_SECTO= R_BITS, + n << BDRV_SECTOR_BITS, &qiov, + BDRV_REQ_WRITE_COMPRESSED); if (ret < 0) { return ret; } @@ -1622,8 +1651,12 @@ static int convert_write(ImgConvertState *s, int64_t= sector_num, int nb_sectors, if (!s->min_sparse || is_allocated_sectors_min(buf, n, &n, s->min_sparse)) { - ret =3D blk_pwrite(s->target, sector_num << BDRV_SECTOR_BI= TS, - buf, n << BDRV_SECTOR_BITS, 0); + iov.iov_base =3D buf; + iov.iov_len =3D n << BDRV_SECTOR_BITS; + qemu_iovec_init_external(&qiov, &iov, 1); + + ret =3D blk_co_pwritev(s->target, sector_num << BDRV_SECTO= R_BITS, + n << BDRV_SECTOR_BITS, &qiov, 0); if (ret < 0) { return ret; } @@ -1635,8 +1668,9 @@ static int convert_write(ImgConvertState *s, int64_t = sector_num, int nb_sectors, if (s->has_zero_init) { break; } - ret =3D blk_pwrite_zeroes(s->target, sector_num << BDRV_SECTOR= _BITS, - n << BDRV_SECTOR_BITS, 0); + ret =3D blk_co_pwrite_zeroes(s->target, + sector_num << BDRV_SECTOR_BITS, + n << BDRV_SECTOR_BITS, 0); if (ret < 0) { return ret; } @@ -1651,12 +1685,122 @@ static int convert_write(ImgConvertState *s, int64= _t sector_num, int nb_sectors, return 0; } =20 -static int convert_do_copy(ImgConvertState *s) +static void coroutine_fn convert_co_do_copy(void *opaque) { + ImgConvertState *s =3D opaque; uint8_t *buf =3D NULL; - int64_t sector_num, allocated_done; - int ret; - int n; + int ret, i; + int index =3D -1; + + for (i =3D 0; i < s->num_coroutines; i++) { + if (s->co[i] =3D=3D qemu_coroutine_self()) { + index =3D i; + break; + } + } + assert(index >=3D 0); + + s->running_coroutines++; + buf =3D blk_blockalign(s->target, s->buf_sectors * BDRV_SECTOR_SIZE); + + while (1) { + int n; + int64_t sector_num; + enum ImgConvertBlockStatus status; + + qemu_co_mutex_lock(&s->lock); + if (s->ret !=3D -EINPROGRESS || s->sector_num >=3D s->total_sector= s) { + qemu_co_mutex_unlock(&s->lock); + goto out; + } + n =3D convert_iteration_sectors(s, s->sector_num); + if (n < 0) { + qemu_co_mutex_unlock(&s->lock); + s->ret =3D n; + goto out; + } + /* safe current sector and allocation status to local variables */ + sector_num =3D s->sector_num; + status =3D s->status; + if (!s->min_sparse && s->status =3D=3D BLK_ZERO) { + n =3D MIN(n, s->buf_sectors); + } + /* increment global sector counter so that other coroutines can + * already continue reading beyond this request */ + s->sector_num +=3D n; + qemu_co_mutex_unlock(&s->lock); + + if (status =3D=3D BLK_DATA || (!s->min_sparse && s->status =3D=3D = BLK_ZERO)) { + s->allocated_done +=3D n; + qemu_progress_print(100.0 * s->allocated_done / + s->allocated_sectors, 0); + } + + if (status =3D=3D BLK_DATA) { + ret =3D convert_co_read(s, sector_num, n, buf); + if (ret < 0) { + error_report("error while reading sector %" PRId64 + ": %s", sector_num, strerror(-ret)); + s->ret =3D ret; + goto out; + } + } else if (!s->min_sparse && s->status =3D=3D BLK_ZERO) { + status =3D BLK_DATA; + memset(buf, 0x00, n * BDRV_SECTOR_SIZE); + } + + if (s->wr_in_order) { + /* keep writes in order */ + while (s->wr_offs !=3D sector_num) { + if (s->ret !=3D -EINPROGRESS) { + goto out; + } + s->wait_sector_num[index] =3D sector_num; + qemu_coroutine_yield(); + } + s->wait_sector_num[index] =3D -1; + } + + ret =3D convert_co_write(s, sector_num, n, buf, status); + if (ret < 0) { + error_report("error while writing sector %" PRId64 + ": %s", sector_num, strerror(-ret)); + s->ret =3D ret; + goto out; + } + + if (s->wr_in_order) { + /* reenter the coroutine that might have waited + * for this write to complete */ + s->wr_offs =3D sector_num + n; + for (i =3D 0; i < s->num_coroutines; i++) { + if (s->co[i] && s->wait_sector_num[i] =3D=3D s->wr_offs) { + /* + * A -> B -> A cannot occur because A has + * s->wait_sector_num[i] =3D=3D -1 during A -> B. Ther= efore + * B will never enter A during this time window. + */ + qemu_coroutine_enter(s->co[i]); + break; + } + } + } + } + +out: + qemu_vfree(buf); + s->co[index] =3D NULL; + s->running_coroutines--; + if (!s->running_coroutines && s->ret =3D=3D -EINPROGRESS) { + /* the convert job finished successfully */ + s->ret =3D 0; + } +} + +static int convert_do_copy(ImgConvertState *s) +{ + int ret, i, n; + int64_t sector_num =3D 0; =20 /* Check whether we have zero initialisation or can get it efficiently= */ s->has_zero_init =3D s->min_sparse && !s->target_has_backing @@ -1677,21 +1821,15 @@ static int convert_do_copy(ImgConvertState *s) if (s->compressed) { if (s->cluster_sectors <=3D 0 || s->cluster_sectors > s->buf_secto= rs) { error_report("invalid cluster size"); - ret =3D -EINVAL; - goto fail; + return -EINVAL; } s->buf_sectors =3D s->cluster_sectors; } - buf =3D blk_blockalign(s->target, s->buf_sectors * BDRV_SECTOR_SIZE); =20 - /* Calculate allocated sectors for progress */ - s->allocated_sectors =3D 0; - sector_num =3D 0; while (sector_num < s->total_sectors) { n =3D convert_iteration_sectors(s, sector_num); if (n < 0) { - ret =3D n; - goto fail; + return n; } if (s->status =3D=3D BLK_DATA || (!s->min_sparse && s->status =3D= =3D BLK_ZERO)) { @@ -1704,58 +1842,28 @@ static int convert_do_copy(ImgConvertState *s) s->src_cur =3D 0; s->src_cur_offset =3D 0; s->sector_next_status =3D 0; + s->ret =3D -EINPROGRESS; =20 - sector_num =3D 0; - allocated_done =3D 0; - - while (sector_num < s->total_sectors) { - n =3D convert_iteration_sectors(s, sector_num); - if (n < 0) { - ret =3D n; - goto fail; - } - if (s->status =3D=3D BLK_DATA || (!s->min_sparse && s->status =3D= =3D BLK_ZERO)) - { - allocated_done +=3D n; - qemu_progress_print(100.0 * allocated_done / s->allocated_sect= ors, - 0); - } - - if (s->status =3D=3D BLK_DATA) { - ret =3D convert_read(s, sector_num, n, buf); - if (ret < 0) { - error_report("error while reading sector %" PRId64 - ": %s", sector_num, strerror(-ret)); - goto fail; - } - } else if (!s->min_sparse && s->status =3D=3D BLK_ZERO) { - n =3D MIN(n, s->buf_sectors); - memset(buf, 0, n * BDRV_SECTOR_SIZE); - s->status =3D BLK_DATA; - } - - ret =3D convert_write(s, sector_num, n, buf); - if (ret < 0) { - error_report("error while writing sector %" PRId64 - ": %s", sector_num, strerror(-ret)); - goto fail; - } + qemu_co_mutex_init(&s->lock); + for (i =3D 0; i < s->num_coroutines; i++) { + s->co[i] =3D qemu_coroutine_create(convert_co_do_copy, s); + s->wait_sector_num[i] =3D -1; + qemu_coroutine_enter(s->co[i]); + } =20 - sector_num +=3D n; + while (s->ret =3D=3D -EINPROGRESS) { + main_loop_wait(false); } =20 - if (s->compressed) { + if (s->compressed && !s->ret) { /* signal EOF to align */ ret =3D blk_pwrite_compressed(s->target, 0, NULL, 0); if (ret < 0) { - goto fail; + return ret; } } =20 - ret =3D 0; -fail: - qemu_vfree(buf); - return ret; + return s->ret; } =20 static int img_convert(int argc, char **argv) @@ -1783,6 +1891,8 @@ static int img_convert(int argc, char **argv) QemuOpts *sn_opts =3D NULL; ImgConvertState state; bool image_opts =3D false; + bool wr_in_order =3D true; + int num_coroutines =3D 8; =20 fmt =3D NULL; out_fmt =3D "raw"; @@ -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 =3D getopt_long(argc, argv, "hf:O:B:ce6o:s:l:S:pt:T:qn", + c =3D getopt_long(argc, argv, "hf:O:B:ce6o:s:l:S:pt:T:qnm:W", long_options, NULL); if (c =3D=3D -1) { break; @@ -1890,6 +2000,18 @@ static int img_convert(int argc, char **argv) case 'n': skip_create =3D 1; break; + case 'm': + num_coroutines =3D atoi(optarg); + if (num_coroutines < 1 || num_coroutines > MAX_COROUTINES) { + error_report("Allowed number of coroutines is between 1 an= d %d", + MAX_COROUTINES); + ret =3D -1; + goto fail_getopt; + } + break; + case 'W': + wr_in_order =3D false; + break; case OPTION_OBJECT: opts =3D qemu_opts_parse_noisily(&qemu_object_opts, optarg, true); @@ -1909,6 +2031,12 @@ static int img_convert(int argc, char **argv) goto fail_getopt; } =20 + if (!wr_in_order && compress) { + error_report("Out of order write and compress are mutually exclusi= ve"); + ret =3D -1; + goto fail_getopt; + } + /* Initialize before goto out */ if (quiet) { progress =3D 0; @@ -2149,6 +2277,8 @@ static int img_convert(int argc, char **argv) .min_sparse =3D min_sparse, .cluster_sectors =3D cluster_sectors, .buf_sectors =3D bufsectors, + .wr_in_order =3D wr_in_order, + .num_coroutines =3D num_coroutines, }; ret =3D convert_do_copy(&state); =20 diff --git a/qemu-img.texi b/qemu-img.texi index 174aae3..6715ff3 100644 --- a/qemu-img.texi +++ b/qemu-img.texi @@ -137,6 +137,12 @@ Parameters to convert subcommand: =20 @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 pe= rformance, +but is only recommened for preallocated devices like host devices or other +raw block devices. @end table =20 Parameters to dd subcommand: @@ -296,7 +302,7 @@ Error on reading data =20 @end table =20 -@item convert [-c] [-p] [-n] [-f @var{fmt}] [-t @var{cache}] [-T @var{src_= cache}] [-O @var{output_fmt}] [-o @var{options}] [-s @var{snapshot_id_or_na= me}] [-l @var{snapshot_param}] [-S @var{sparse_size}] @var{filename} [@var{= filename2} [...]] @var{output_filename} +@item convert [-c] [-p] [-n] [-f @var{fmt}] [-t @var{cache}] [-T @var{src_= cache}] [-O @var{output_fmt}] [-o @var{options}] [-s @var{snapshot_id_or_na= me}] [-l @var{snapshot_param}] [-m @var{num_coroutines}] [-W] {[-S @var{spa= rse_size}] @var{filename} [@var{filename2} [...]] @var{output_filename} =20 Convert the disk image @var{filename} or a snapshot @var{snapshot_param}(@= var{snapshot_id_or_name} is deprecated) to disk image @var{output_filename} using format @var{output_fmt}. It can = be optionally compressed (@code{-c} @@ -326,6 +332,14 @@ skipped. This is useful for formats such as @code{rbd}= if the target volume has already been created with site specific options that cannot be supplied through qemu-img. =20 +With option @code{-W} specified, it is allowed to write out of order to th= e target. +This is option improves performance, but is only recommened for preallocat= ed devices +like host devices or other raw block devices. Out of order write does not = work +in combination with creating compressed images. + +@var{num_coroutines} specifies how many coroutines work in parallel during +the convert process (defaults to 8). + @item dd [-f @var{fmt}] [-O @var{output_fmt}] [bs=3D@var{block_size}] [cou= nt=3D@var{blocks}] [skip=3D@var{blocks}] if=3D@var{input} of=3D@var{output} =20 Dd copies from @var{input} file to @var{output} file converting it from --=20 1.9.1