From nobody Sat Apr 20 06:53:39 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1555174562; cv=none; d=zoho.com; s=zohoarc; b=RSHJ5rR1MypHXuzsOzqeAe2wY6sjl8V4GBUbmj0SKAJbhjoAkECx/RkkNO6EjzUfDsFwREtHYwFTybTUy5WSGppb8sPqknM/B+mEZeEqWOZed9PySVxeV7ga1DusnMuDNh/vKrw5H3gKIr7mCVhfDiTb3adtH2FSP5uoNS9Ui9Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1555174562; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=EIXWufkR5OXH0mTZKCprrpFQLSfY8JdxeB0p5GiPqxU=; b=mnIEALOiVA85rzA3xlMjkAXoPjI4GCxF+5qWkHMbvJTfKTENL+P0WL6hx6AaOAUZryu1g4Lq0UB3ccFKBOMqZIFP7Km5pYSIuPnfSnY8LLjvftrO50nRKrgoT+UhNl7EuWt+7k6AZ1btHsjcbyZNxI44RlJB1iQ1j/wCvo0kQWw= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1555174562934411.81897832599645; Sat, 13 Apr 2019 09:56:02 -0700 (PDT) Received: from localhost ([127.0.0.1]:53843 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hFLwT-0008FU-H1 for importer@patchew.org; Sat, 13 Apr 2019 12:55:49 -0400 Received: from eggs.gnu.org ([209.51.188.92]:57800) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hFLua-00074M-Mw for qemu-devel@nongnu.org; Sat, 13 Apr 2019 12:53:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hFLuZ-0002fx-M1 for qemu-devel@nongnu.org; Sat, 13 Apr 2019 12:53:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40572) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hFLuX-0002cP-5H; Sat, 13 Apr 2019 12:53:49 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7271FC05D266; Sat, 13 Apr 2019 16:53:48 +0000 (UTC) Received: from localhost (ovpn-204-66.brq.redhat.com [10.40.204.66]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 099BF60C18; Sat, 13 Apr 2019 16:53:47 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Date: Sat, 13 Apr 2019 18:53:37 +0200 Message-Id: <20190413165343.9018-2-mreitz@redhat.com> In-Reply-To: <20190413165343.9018-1-mreitz@redhat.com> References: <20190413165343.9018-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Sat, 13 Apr 2019 16:53:48 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v3 1/7] qemu-img: Move quiet into ImgConvertState 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: Kevin Wolf , Vladimir Sementsov-Ogievskiy , qemu-devel@nongnu.org, Max Reitz , "Denis V . Lunev" , Andrey Shinkevich Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" Move img_convert()'s quiet flag into the ImgConvertState so it is accessible by nested functions. -q dictates that it suppresses anything but errors, so if those functions want to emit warnings, they need to query this flag first. (There currently are no such warnings, but there will be as of the next patch.) Signed-off-by: Max Reitz Reviewed-by: Eric Blake Reviewed-by: Vladimir Sementsov-Ogievskiy --- qemu-img.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/qemu-img.c b/qemu-img.c index aa6f81f1ea..c53666aa41 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -1569,6 +1569,7 @@ typedef struct ImgConvertState { int64_t target_backing_sectors; /* negative if unknown */ bool wr_in_order; bool copy_range; + bool quiet; int min_sparse; int alignment; size_t cluster_sectors; @@ -2005,7 +2006,7 @@ static int img_convert(int argc, char **argv) QDict *open_opts =3D NULL; char *options =3D NULL; Error *local_err =3D NULL; - bool writethrough, src_writethrough, quiet =3D false, image_opts =3D f= alse, + bool writethrough, src_writethrough, image_opts =3D false, skip_create =3D false, progress =3D false, tgt_image_opts =3D fal= se; int64_t ret =3D -EINVAL; bool force_share =3D false; @@ -2113,7 +2114,7 @@ static int img_convert(int argc, char **argv) src_cache =3D optarg; break; case 'q': - quiet =3D true; + s.quiet =3D true; break; case 'n': skip_create =3D true; @@ -2202,7 +2203,7 @@ static int img_convert(int argc, char **argv) } =20 /* Initialize before goto out */ - if (quiet) { + if (s.quiet) { progress =3D false; } qemu_progress_init(progress, 1.0); @@ -2213,7 +2214,7 @@ static int img_convert(int argc, char **argv) =20 for (bs_i =3D 0; bs_i < s.src_num; bs_i++) { s.src[bs_i] =3D img_open(image_opts, argv[optind + bs_i], - fmt, src_flags, src_writethrough, quiet, + fmt, src_flags, src_writethrough, s.quiet, force_share); if (!s.src[bs_i]) { ret =3D -1; @@ -2376,7 +2377,7 @@ static int img_convert(int argc, char **argv) =20 if (skip_create) { s.target =3D img_open(tgt_image_opts, out_filename, out_fmt, - flags, writethrough, quiet, false); + flags, writethrough, s.quiet, false); } else { /* TODO ultimately we should allow --target-image-opts * to be used even when -n is not given. @@ -2384,7 +2385,7 @@ static int img_convert(int argc, char **argv) * to allow filenames in option syntax */ s.target =3D img_open_file(out_filename, open_opts, out_fmt, - flags, writethrough, quiet, false); + flags, writethrough, s.quiet, false); open_opts =3D NULL; /* blk_new_open will have freed it */ } if (!s.target) { --=20 2.20.1 From nobody Sat Apr 20 06:53:39 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1555174694; cv=none; d=zoho.com; s=zohoarc; b=Og+vAQViQYa3FVN+Yx09y6yKXJbE5cGQ2EurFefW+G75X8DRPm8rAUWyBhyHgoHipqSfuw6N+YupVPODkP0srfFFxR3NNFbUaWuaqX4UhBix7eIRYXl3vOigAeZ3+QTseExXYqZ08g/N68MfjLMRk04nTUF1rPtna3Sowfx7rUc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1555174694; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=7yl1qzBVvojfuorJ+kpWPDjKcUsuhFIUbKMM7J/rpRI=; b=XYhXWAFqA4Ddw1Z6w4SRBZR/7IT29L/Jk8BCn3yjqd8ZlAicmvEMuEXv1kmy6obj4Y4L12XpQ3vHpaZkbf30rYPTujQnc5TkkUx61J3FeQTRzlMvLat/OnDNdnFhHxuPplBVSlSgQnDRaK6sSRNIuVcKY5XMhrOnoVy+/CJlbvI= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1555174694765127.10673176037085; Sat, 13 Apr 2019 09:58:14 -0700 (PDT) Received: from localhost ([127.0.0.1]:53877 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hFLyk-0002LK-NO for importer@patchew.org; Sat, 13 Apr 2019 12:58:10 -0400 Received: from eggs.gnu.org ([209.51.188.92]:57837) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hFLue-000770-Hz for qemu-devel@nongnu.org; Sat, 13 Apr 2019 12:53:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hFLud-0002iP-4G for qemu-devel@nongnu.org; Sat, 13 Apr 2019 12:53:56 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58020) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hFLuZ-0002fj-O9; Sat, 13 Apr 2019 12:53:52 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0A04F3091740; Sat, 13 Apr 2019 16:53:51 +0000 (UTC) Received: from localhost (ovpn-204-66.brq.redhat.com [10.40.204.66]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 677085C219; Sat, 13 Apr 2019 16:53:50 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Date: Sat, 13 Apr 2019 18:53:38 +0200 Message-Id: <20190413165343.9018-3-mreitz@redhat.com> In-Reply-To: <20190413165343.9018-1-mreitz@redhat.com> References: <20190413165343.9018-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Sat, 13 Apr 2019 16:53:51 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v3 2/7] qemu-img: Add salvaging mode to convert 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: Kevin Wolf , Vladimir Sementsov-Ogievskiy , qemu-devel@nongnu.org, Max Reitz , "Denis V . Lunev" , Andrey Shinkevich Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" This adds a salvaging mode (--salvage) to qemu-img convert which ignores read errors and treats the respective areas as containing only zeroes. This can be used for instance to at least partially recover the data from terminally corrupted qcow2 images. Signed-off-by: Max Reitz Reviewed-by: Vladimir Sementsov-Ogievskiy --- qemu-img.c | 90 +++++++++++++++++++++++++++++++++++++----------- qemu-img-cmds.hx | 4 +-- qemu-img.texi | 4 +++ 3 files changed, 75 insertions(+), 23 deletions(-) diff --git a/qemu-img.c b/qemu-img.c index c53666aa41..1637ab9ac7 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -66,6 +66,7 @@ enum { OPTION_SIZE =3D 264, OPTION_PREALLOCATION =3D 265, OPTION_SHRINK =3D 266, + OPTION_SALVAGE =3D 267, }; =20 typedef enum OutputFormat { @@ -1569,6 +1570,7 @@ typedef struct ImgConvertState { int64_t target_backing_sectors; /* negative if unknown */ bool wr_in_order; bool copy_range; + bool salvage; bool quiet; int min_sparse; int alignment; @@ -1616,25 +1618,44 @@ static int convert_iteration_sectors(ImgConvertStat= e *s, int64_t sector_num) } =20 if (s->sector_next_status <=3D sector_num) { - int64_t count =3D n * BDRV_SECTOR_SIZE; + uint64_t offset =3D (sector_num - src_cur_offset) * BDRV_SECTOR_SI= ZE; + int64_t count; =20 - if (s->target_has_backing) { + do { + count =3D n * BDRV_SECTOR_SIZE; + + if (s->target_has_backing) { + ret =3D bdrv_block_status(blk_bs(s->src[src_cur]), offset, + count, &count, NULL, NULL); + } else { + ret =3D bdrv_block_status_above(blk_bs(s->src[src_cur]), N= ULL, + offset, count, &count, NULL, + NULL); + } + + if (ret < 0) { + if (s->salvage) { + if (n =3D=3D 1) { + if (!s->quiet) { + warn_report("error while reading block status = at " + "offset %" PRIu64 ": %s", offset, + strerror(-ret)); + } + /* Just try to read the data, then */ + ret =3D BDRV_BLOCK_DATA; + count =3D BDRV_SECTOR_SIZE; + } else { + /* Retry on a shorter range */ + n =3D DIV_ROUND_UP(n, 4); + } + } else { + error_report("error while reading block status at offs= et " + "%" PRIu64 ": %s", offset, strerror(-ret)= ); + return ret; + } + } + } while (ret < 0); =20 - ret =3D bdrv_block_status(blk_bs(s->src[src_cur]), - (sector_num - src_cur_offset) * - BDRV_SECTOR_SIZE, - count, &count, NULL, NULL); - } else { - ret =3D bdrv_block_status_above(blk_bs(s->src[src_cur]), NULL, - (sector_num - src_cur_offset) * - BDRV_SECTOR_SIZE, - count, &count, NULL, NULL); - } - if (ret < 0) { - error_report("error while reading block status of sector %" PR= Id64 - ": %s", sector_num, strerror(-ret)); - return ret; - } n =3D DIV_ROUND_UP(count, BDRV_SECTOR_SIZE); =20 if (ret & BDRV_BLOCK_ZERO) { @@ -1671,6 +1692,7 @@ static int convert_iteration_sectors(ImgConvertState = *s, int64_t sector_num) static int coroutine_fn convert_co_read(ImgConvertState *s, int64_t sector= _num, int nb_sectors, uint8_t *buf) { + uint64_t single_read_until =3D 0; int n, ret; QEMUIOVector qiov; =20 @@ -1679,6 +1701,7 @@ static int coroutine_fn convert_co_read(ImgConvertSta= te *s, int64_t sector_num, BlockBackend *blk; int src_cur; int64_t bs_sectors, src_cur_offset; + uint64_t offset; =20 /* In the case of compression with multiple source files, we can g= et a * nb_sectors that spreads into the next part. So we must be able = to @@ -1687,14 +1710,30 @@ static int coroutine_fn convert_co_read(ImgConvertS= tate *s, int64_t sector_num, blk =3D s->src[src_cur]; bs_sectors =3D s->src_sectors[src_cur]; =20 + offset =3D (sector_num - src_cur_offset) << BDRV_SECTOR_BITS; + n =3D MIN(nb_sectors, bs_sectors - (sector_num - src_cur_offset)); + if (single_read_until > offset) { + n =3D 1; + } qemu_iovec_init_buf(&qiov, buf, n << BDRV_SECTOR_BITS); =20 - ret =3D blk_co_preadv( - blk, (sector_num - src_cur_offset) << BDRV_SECTOR_BITS, - n << BDRV_SECTOR_BITS, &qiov, 0); + ret =3D blk_co_preadv(blk, offset, n << BDRV_SECTOR_BITS, &qiov, 0= ); if (ret < 0) { - return ret; + if (s->salvage) { + if (n > 1) { + single_read_until =3D offset + (n << BDRV_SECTOR_BITS); + continue; + } else { + if (!s->quiet) { + warn_report("error while reading offset %" PRIu64 + ": %s", offset, strerror(-ret)); + } + memset(buf, 0, BDRV_SECTOR_SIZE); + } + } else { + return ret; + } } =20 sector_num +=3D n; @@ -2028,6 +2067,7 @@ static int img_convert(int argc, char **argv) {"image-opts", no_argument, 0, OPTION_IMAGE_OPTS}, {"force-share", no_argument, 0, 'U'}, {"target-image-opts", no_argument, 0, OPTION_TARGET_IMAGE_OPTS= }, + {"salvage", no_argument, 0, OPTION_SALVAGE}, {0, 0, 0, 0} }; c =3D getopt_long(argc, argv, ":hf:O:B:Cco:l:S:pt:T:qnm:WU", @@ -2145,6 +2185,9 @@ static int img_convert(int argc, char **argv) case OPTION_IMAGE_OPTS: image_opts =3D true; break; + case OPTION_SALVAGE: + s.salvage =3D true; + break; case OPTION_TARGET_IMAGE_OPTS: tgt_image_opts =3D true; break; @@ -2171,6 +2214,11 @@ static int img_convert(int argc, char **argv) goto fail_getopt; } =20 + if (s.copy_range && s.salvage) { + error_report("Cannot use copy offloading in salvaging mode"); + goto fail_getopt; + } + if (tgt_image_opts && !skip_create) { error_report("--target-image-opts requires use of -n flag"); goto fail_getopt; diff --git a/qemu-img-cmds.hx b/qemu-img-cmds.hx index 4b47f7495d..1c93e6d185 100644 --- a/qemu-img-cmds.hx +++ b/qemu-img-cmds.hx @@ -44,9 +44,9 @@ STEXI ETEXI =20 DEF("convert", img_convert, - "convert [--object objectdef] [--image-opts] [--target-image-opts] [-U= ] [-C] [-c] [-p] [-q] [-n] [-f fmt] [-t cache] [-T src_cache] [-O output_fm= t] [-B backing_file] [-o options] [-l snapshot_param] [-S sparse_size] [-m = num_coroutines] [-W] filename [filename2 [...]] output_filename") + "convert [--object objectdef] [--image-opts] [--target-image-opts] [-U= ] [-C] [-c] [-p] [-q] [-n] [-f fmt] [-t cache] [-T src_cache] [-O output_fm= t] [-B backing_file] [-o options] [-l snapshot_param] [-S sparse_size] [-m = num_coroutines] [-W] [--salvage] filename [filename2 [...]] output_filename= ") STEXI -@item convert [--object @var{objectdef}] [--image-opts] [--target-image-op= ts] [-U] [-C] [-c] [-p] [-q] [-n] [-f @var{fmt}] [-t @var{cache}] [-T @var{= src_cache}] [-O @var{output_fmt}] [-B @var{backing_file}] [-o @var{options}= ] [-l @var{snapshot_param}] [-S @var{sparse_size}] [-m @var{num_coroutines}= ] [-W] @var{filename} [@var{filename2} [...]] @var{output_filename} +@item convert [--object @var{objectdef}] [--image-opts] [--target-image-op= ts] [-U] [-C] [-c] [-p] [-q] [-n] [-f @var{fmt}] [-t @var{cache}] [-T @var{= src_cache}] [-O @var{output_fmt}] [-B @var{backing_file}] [-o @var{options}= ] [-l @var{snapshot_param}] [-S @var{sparse_size}] [-m @var{num_coroutines}= ] [-W] [--salvage] @var{filename} [@var{filename2} [...]] @var{output_filen= ame} ETEXI =20 DEF("create", img_create, diff --git a/qemu-img.texi b/qemu-img.texi index 724f244ba1..ba11a2c665 100644 --- a/qemu-img.texi +++ b/qemu-img.texi @@ -175,6 +175,10 @@ improve performance if the data is remote, such as wit= h NFS or iSCSI backends, but will not automatically sparsify zero sectors, and may result in a fully allocated target image depending on the host support for getting allocation information. +@item --salvage +Try to ignore I/O errors when reading. Unless in quiet mode (@code{-q}), = errors +will still be printed. Areas that cannot be read from the source will be +treated as containing only zeroes. @end table =20 Parameters to dd subcommand: --=20 2.20.1 From nobody Sat Apr 20 06:53:39 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1555174567; cv=none; d=zoho.com; s=zohoarc; b=FG/HfQBR04zvZTHTufPUpLGlIy2ndhXrgwL61VyLOUlfmFa/K2tTrEwZteyxWGveJvTMEyNs8aZIwGmE2rUT31RprqsukMvu99JUg5et9MReloc2+g0roXw8t47LyEcgxpxvgHGpPClgW+iQI0Oz+LkAu3qwYrQTC6PgryBx/uk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1555174567; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=n4hAixH1RaW+K7tOvZ2VkdkWDHhHCS5HmkaOc0CPM9I=; b=P0TQw+Xyle5PjBIFxMLkHUmw6DcAXCBLOwHWBDq2DzdMat5qyLcYIv5MIebVltznBhSLYwoTU8j+uFSwS51bnGISR34uhhfknPnd+9WHgEqZCv6RnEKLq5g+G2PR4dIlTwcp9/X9bVQ02C35uTRUPwY6WzegSK3jph/P6YdJBxc= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 155517456711931.952120575160166; Sat, 13 Apr 2019 09:56:07 -0700 (PDT) Received: from localhost ([127.0.0.1]:53847 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hFLwb-0008MU-Vo for importer@patchew.org; Sat, 13 Apr 2019 12:55:58 -0400 Received: from eggs.gnu.org ([209.51.188.92]:57870) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hFLug-00079U-U5 for qemu-devel@nongnu.org; Sat, 13 Apr 2019 12:54:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hFLuf-0002kS-J2 for qemu-devel@nongnu.org; Sat, 13 Apr 2019 12:53:58 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48256) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hFLuc-0002hc-CH; Sat, 13 Apr 2019 12:53:54 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A48197E9C1; Sat, 13 Apr 2019 16:53:53 +0000 (UTC) Received: from localhost (ovpn-204-66.brq.redhat.com [10.40.204.66]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0268B600C8; Sat, 13 Apr 2019 16:53:52 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Date: Sat, 13 Apr 2019 18:53:39 +0200 Message-Id: <20190413165343.9018-4-mreitz@redhat.com> In-Reply-To: <20190413165343.9018-1-mreitz@redhat.com> References: <20190413165343.9018-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Sat, 13 Apr 2019 16:53:53 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v3 3/7] blkdebug: Add @iotype error option 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: Kevin Wolf , Vladimir Sementsov-Ogievskiy , qemu-devel@nongnu.org, Max Reitz , "Denis V . Lunev" , Andrey Shinkevich Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" This new error option allows users of blkdebug to inject errors only on certain kinds of I/O operations. Users usually want to make a very specific operation fail, not just any; but right now they simply hope that the event that triggers the error injection is followed up with that very operation. That may not be true, however, because the block layer is changing (including blkdebug, which may increase the number of types of I/O operations on which to inject errors). The new option's default has been chosen to keep backwards compatibility. Note that similar to the internal representation, we could choose to expose this option as a list of I/O types. But there is no practical use for this, because as described above, users usually know exactly which kind of operation they want to make fail, so there is no need to specify multiple I/O types at once. In addition, exposing this option as a list would require non-trivial changes to qemu_opts_absorb_qdict(). Signed-off-by: Max Reitz Reviewed-by: Vladimir Sementsov-Ogievskiy --- qapi/block-core.json | 26 +++++++++++++++++++++++ block/blkdebug.c | 50 ++++++++++++++++++++++++++++++++++++-------- 2 files changed, 67 insertions(+), 9 deletions(-) diff --git a/qapi/block-core.json b/qapi/block-core.json index 7ccbfff9d0..5141e91172 100644 --- a/qapi/block-core.json +++ b/qapi/block-core.json @@ -3235,6 +3235,26 @@ 'l1_shrink_write_table', 'l1_shrink_free_l2_clusters', 'cor_write'] } =20 +## +# @BlkdebugIOType: +# +# Kinds of I/O that blkdebug can inject errors in. +# +# @read: .bdrv_co_preadv() +# +# @write: .bdrv_co_pwritev() +# +# @write-zeroes: .bdrv_co_pwrite_zeroes() +# +# @discard: .bdrv_co_pdiscard() +# +# @flush: .bdrv_co_flush_to_disk() +# +# Since: 4.1 +## +{ 'enum': 'BlkdebugIOType', + 'data': [ 'read', 'write', 'write-zeroes', 'discard', 'flush' ] } + ## # @BlkdebugInjectErrorOptions: # @@ -3245,6 +3265,11 @@ # @state: the state identifier blkdebug needs to be in to # actually trigger the event; defaults to "any" # +# @iotype: the type of I/O operations on which this error should +# be injected; defaults to "all read, write, +# write-zeroes, discard, and flush operations" +# (since: 4.1) +# # @errno: error identifier (errno) to be returned; defaults to # EIO # @@ -3262,6 +3287,7 @@ { 'struct': 'BlkdebugInjectErrorOptions', 'data': { 'event': 'BlkdebugEvent', '*state': 'int', + '*iotype': 'BlkdebugIOType', '*errno': 'int', '*sector': 'int', '*once': 'bool', diff --git a/block/blkdebug.c b/block/blkdebug.c index efd9441625..ca84b12e32 100644 --- a/block/blkdebug.c +++ b/block/blkdebug.c @@ -75,6 +75,7 @@ typedef struct BlkdebugRule { int state; union { struct { + uint64_t iotype_mask; int error; int immediately; int once; @@ -91,6 +92,9 @@ typedef struct BlkdebugRule { QSIMPLEQ_ENTRY(BlkdebugRule) active_next; } BlkdebugRule; =20 +QEMU_BUILD_BUG_MSG(BLKDEBUGIO_TYPE__MAX > 64, + "BlkdebugIOType mask does not fit into an uint64_t"); + static QemuOptsList inject_error_opts =3D { .name =3D "inject-error", .head =3D QTAILQ_HEAD_INITIALIZER(inject_error_opts.head), @@ -103,6 +107,10 @@ static QemuOptsList inject_error_opts =3D { .name =3D "state", .type =3D QEMU_OPT_NUMBER, }, + { + .name =3D "iotype", + .type =3D QEMU_OPT_STRING, + }, { .name =3D "errno", .type =3D QEMU_OPT_NUMBER, @@ -162,6 +170,8 @@ static int add_rule(void *opaque, QemuOpts *opts, Error= **errp) int event; struct BlkdebugRule *rule; int64_t sector; + BlkdebugIOType iotype; + Error *local_error =3D NULL; =20 /* Find the right event for the rule */ event_name =3D qemu_opt_get(opts, "event"); @@ -192,6 +202,26 @@ static int add_rule(void *opaque, QemuOpts *opts, Erro= r **errp) sector =3D qemu_opt_get_number(opts, "sector", -1); rule->options.inject.offset =3D sector =3D=3D -1 ? -1 : sector * BDRV_SECTOR_SIZE; + + iotype =3D qapi_enum_parse(&BlkdebugIOType_lookup, + qemu_opt_get(opts, "iotype"), + BLKDEBUGIO_TYPE__MAX, &local_error); + if (local_error) { + error_propagate(errp, local_error); + return -1; + } + if (iotype !=3D BLKDEBUGIO_TYPE__MAX) { + rule->options.inject.iotype_mask =3D (1ull << iotype); + } else { + /* Apply the default */ + rule->options.inject.iotype_mask =3D + (1ull << BLKDEBUGIO_TYPE_READ) + | (1ull << BLKDEBUGIO_TYPE_WRITE) + | (1ull << BLKDEBUGIO_TYPE_WRITE_ZEROES) + | (1ull << BLKDEBUGIO_TYPE_DISCARD) + | (1ull << BLKDEBUGIO_TYPE_FLUSH); + } + break; =20 case ACTION_SET_STATE: @@ -470,7 +500,8 @@ out: return ret; } =20 -static int rule_check(BlockDriverState *bs, uint64_t offset, uint64_t byte= s) +static int rule_check(BlockDriverState *bs, uint64_t offset, uint64_t byte= s, + BlkdebugIOType iotype) { BDRVBlkdebugState *s =3D bs->opaque; BlkdebugRule *rule =3D NULL; @@ -480,9 +511,10 @@ static int rule_check(BlockDriverState *bs, uint64_t o= ffset, uint64_t bytes) QSIMPLEQ_FOREACH(rule, &s->active_rules, active_next) { uint64_t inject_offset =3D rule->options.inject.offset; =20 - if (inject_offset =3D=3D -1 || - (bytes && inject_offset >=3D offset && - inject_offset < offset + bytes)) + if ((inject_offset =3D=3D -1 || + (bytes && inject_offset >=3D offset && + inject_offset < offset + bytes)) && + (rule->options.inject.iotype_mask & (1ull << iotype))) { break; } @@ -521,7 +553,7 @@ blkdebug_co_preadv(BlockDriverState *bs, uint64_t offse= t, uint64_t bytes, assert(bytes <=3D bs->bl.max_transfer); } =20 - err =3D rule_check(bs, offset, bytes); + err =3D rule_check(bs, offset, bytes, BLKDEBUGIO_TYPE_READ); if (err) { return err; } @@ -542,7 +574,7 @@ blkdebug_co_pwritev(BlockDriverState *bs, uint64_t offs= et, uint64_t bytes, assert(bytes <=3D bs->bl.max_transfer); } =20 - err =3D rule_check(bs, offset, bytes); + err =3D rule_check(bs, offset, bytes, BLKDEBUGIO_TYPE_WRITE); if (err) { return err; } @@ -552,7 +584,7 @@ blkdebug_co_pwritev(BlockDriverState *bs, uint64_t offs= et, uint64_t bytes, =20 static int blkdebug_co_flush(BlockDriverState *bs) { - int err =3D rule_check(bs, 0, 0); + int err =3D rule_check(bs, 0, 0, BLKDEBUGIO_TYPE_FLUSH); =20 if (err) { return err; @@ -586,7 +618,7 @@ static int coroutine_fn blkdebug_co_pwrite_zeroes(Block= DriverState *bs, assert(bytes <=3D bs->bl.max_pwrite_zeroes); } =20 - err =3D rule_check(bs, offset, bytes); + err =3D rule_check(bs, offset, bytes, BLKDEBUGIO_TYPE_WRITE_ZEROES); if (err) { return err; } @@ -620,7 +652,7 @@ static int coroutine_fn blkdebug_co_pdiscard(BlockDrive= rState *bs, assert(bytes <=3D bs->bl.max_pdiscard); } =20 - err =3D rule_check(bs, offset, bytes); + err =3D rule_check(bs, offset, bytes, BLKDEBUGIO_TYPE_DISCARD); if (err) { return err; } --=20 2.20.1 From nobody Sat Apr 20 06:53:39 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1555174698; cv=none; d=zoho.com; s=zohoarc; b=emS8cpP2HvV10R6hlfOW/M+vGOhZw878XjYq/nyFzFZ/w1xnkTUOQhxLtlw0sqEX+Hw2RPW3cQmJMptKYxYoIeqRs04ttpSC2HoWZOZXOBfXbdqdrxkZjqzRG/F01fIGp1fsGplGHpB8OV1fTiGvG5rcvfvTRdJEtwXN9nnGD5Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1555174698; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=2W/MwsVxGXZJFuOLklsXbm/Mu6L55Pc0K7W9gWtIrjE=; b=TVvrjTR/xe5d2dKenhCerul+FXIx4AwjuSvtu/UQNzLV0oMG4CDZ+f+dsVN/4qQLS2Jy18xq2d/O3YfysLbhbT9OFiWVmyMLicqzy8UfGq2QYJjkKKl8Vk8h0yQ4AarM67Qje8HCUcIHWD14aUiDLY6mqIPRzTW3JGAIVc9JQaM= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1555174698617727.3067667789057; Sat, 13 Apr 2019 09:58:18 -0700 (PDT) Received: from localhost ([127.0.0.1]:53879 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hFLyp-0002PR-M4 for importer@patchew.org; Sat, 13 Apr 2019 12:58:15 -0400 Received: from eggs.gnu.org ([209.51.188.92]:57892) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hFLuh-0007AZ-U4 for qemu-devel@nongnu.org; Sat, 13 Apr 2019 12:54:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hFLuh-0002lg-09 for qemu-devel@nongnu.org; Sat, 13 Apr 2019 12:53:59 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48244) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hFLue-0002jE-Ra; Sat, 13 Apr 2019 12:53:57 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0E40381E1B; Sat, 13 Apr 2019 16:53:56 +0000 (UTC) Received: from localhost (ovpn-204-66.brq.redhat.com [10.40.204.66]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9898F5D71A; Sat, 13 Apr 2019 16:53:55 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Date: Sat, 13 Apr 2019 18:53:40 +0200 Message-Id: <20190413165343.9018-5-mreitz@redhat.com> In-Reply-To: <20190413165343.9018-1-mreitz@redhat.com> References: <20190413165343.9018-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Sat, 13 Apr 2019 16:53:56 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v3 4/7] blkdebug: Add "none" event 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: Kevin Wolf , Vladimir Sementsov-Ogievskiy , qemu-devel@nongnu.org, Max Reitz , "Denis V . Lunev" , Andrey Shinkevich Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" Together with @iotypes and @sector, this can be used to trap e.g. the first read or write access to a certain sector without having to know what happens internally in the block layer, i.e. which "real" events happen right before such an access. Signed-off-by: Max Reitz Reviewed-by: Vladimir Sementsov-Ogievskiy --- qapi/block-core.json | 4 +++- block/blkdebug.c | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/qapi/block-core.json b/qapi/block-core.json index 5141e91172..717b13f7f5 100644 --- a/qapi/block-core.json +++ b/qapi/block-core.json @@ -3215,6 +3215,8 @@ # # @cor_write: a write due to copy-on-read (since 2.11) # +# @none: triggers once at creation of the blkdebug node (since 4.1) +# # Since: 2.9 ## { 'enum': 'BlkdebugEvent', 'prefix': 'BLKDBG', @@ -3233,7 +3235,7 @@ 'pwritev_rmw_tail', 'pwritev_rmw_after_tail', 'pwritev', 'pwritev_zero', 'pwritev_done', 'empty_image_prepare', 'l1_shrink_write_table', 'l1_shrink_free_l2_clusters', - 'cor_write'] } + 'cor_write', 'none' ] } =20 ## # @BlkdebugIOType: diff --git a/block/blkdebug.c b/block/blkdebug.c index ca84b12e32..69c608be6f 100644 --- a/block/blkdebug.c +++ b/block/blkdebug.c @@ -491,6 +491,8 @@ static int blkdebug_open(BlockDriverState *bs, QDict *o= ptions, int flags, goto out; } =20 + bdrv_debug_event(bs, BLKDBG_NONE); + ret =3D 0; out: if (ret < 0) { --=20 2.20.1 From nobody Sat Apr 20 06:53:39 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1555174775; cv=none; d=zoho.com; s=zohoarc; b=abIK8pRifRI1URIe8rdmec22K/zbhyGRBzJWLaGkxe47VKE1bl+NQDc2Ma1onKRGpGIpK1ZiOeyYaJSLR9HkLXaoJ/PR5HC1N5XqE48XllPxwqgT0Lhz9Xenah7w83tMfrX7+0uHxtoEq4i5MxrnYzX5j5hTKCqov7MtaluEbVc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1555174775; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=rZU4AMtMYtHmjFtB0Vtz1wVrhpK9WEMCPWYeWu7hZ+U=; b=eNNlSCeTmFrTpJdMw5atoDXW8PVw75yGZwOhs0XVUju1MAZU3cYZZzdoA/szXA5kPWXw4fYl261ZOdA6pAmpIiR7utB8XiW0b2e5iS5MUEf5C1BrIEyRfqu0LewzR47tbsjkILUa6jgSfHFWExeHIf9g/qoMJUvOjclxzT05tDg= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1555174775931958.0776978164653; Sat, 13 Apr 2019 09:59:35 -0700 (PDT) Received: from localhost ([127.0.0.1]:53891 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hFM05-0003Kc-0j for importer@patchew.org; Sat, 13 Apr 2019 12:59:33 -0400 Received: from eggs.gnu.org ([209.51.188.92]:57921) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hFLuk-0007DO-Gl for qemu-devel@nongnu.org; Sat, 13 Apr 2019 12:54:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hFLuj-0002oH-K6 for qemu-devel@nongnu.org; Sat, 13 Apr 2019 12:54:02 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33996) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hFLuh-0002lQ-B7; Sat, 13 Apr 2019 12:53:59 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9C4BD821C6; Sat, 13 Apr 2019 16:53:58 +0000 (UTC) Received: from localhost (ovpn-204-66.brq.redhat.com [10.40.204.66]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 04BA9600C8; Sat, 13 Apr 2019 16:53:57 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Date: Sat, 13 Apr 2019 18:53:41 +0200 Message-Id: <20190413165343.9018-6-mreitz@redhat.com> In-Reply-To: <20190413165343.9018-1-mreitz@redhat.com> References: <20190413165343.9018-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Sat, 13 Apr 2019 16:53:58 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v3 5/7] blkdebug: Inject errors on .bdrv_co_block_status() 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: Kevin Wolf , Vladimir Sementsov-Ogievskiy , qemu-devel@nongnu.org, Max Reitz , "Denis V . Lunev" , Andrey Shinkevich Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" Signed-off-by: Max Reitz Reviewed-by: Eric Blake Reviewed-by: Vladimir Sementsov-Ogievskiy --- qapi/block-core.json | 5 ++++- block/blkdebug.c | 8 ++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/qapi/block-core.json b/qapi/block-core.json index 717b13f7f5..2aa675a192 100644 --- a/qapi/block-core.json +++ b/qapi/block-core.json @@ -3252,10 +3252,13 @@ # # @flush: .bdrv_co_flush_to_disk() # +# @block-status: .bdrv_co_block_status() +# # Since: 4.1 ## { 'enum': 'BlkdebugIOType', - 'data': [ 'read', 'write', 'write-zeroes', 'discard', 'flush' ] } + 'data': [ 'read', 'write', 'write-zeroes', 'discard', 'flush', + 'block-status' ] } =20 ## # @BlkdebugInjectErrorOptions: diff --git a/block/blkdebug.c b/block/blkdebug.c index 69c608be6f..df9c8b1673 100644 --- a/block/blkdebug.c +++ b/block/blkdebug.c @@ -670,7 +670,15 @@ static int coroutine_fn blkdebug_co_block_status(Block= DriverState *bs, int64_t *map, BlockDriverState **file) { + int err; + assert(QEMU_IS_ALIGNED(offset | bytes, bs->bl.request_alignment)); + + err =3D rule_check(bs, offset, bytes, BLKDEBUGIO_TYPE_BLOCK_STATUS); + if (err) { + return err; + } + return bdrv_co_block_status_from_file(bs, want_zero, offset, bytes, pnum, map, file); } --=20 2.20.1 From nobody Sat Apr 20 06:53:39 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1555174849; cv=none; d=zoho.com; s=zohoarc; b=fk7KcwOEiyyPgM3qDQ4nZjcCWwfnrXAPprhRHosTSF3/oYp+SWiWuFbAmF71OrA5ZlH+5vQOKW0+OLPcCcgZ0YByNzI285NxRPPDLcX+VKKvUyq5/VCVi9gCN2oqwA1fY4kS5nXdvTw/Ipb9JT4TpYdZXa/sa1YzGru58lzpgkQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1555174849; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=Ih6sceAqQIN7VoLGWVxfDJLpQtosdlnKl7mR0xTp0O0=; b=BpTXFmF1qK00S56ghkmhzfp/5bCPhwlZtXGflbUWEt1jpQctZB+Pz0hyK7/GIS+Sk2gwbbGCcUIWgu5Spijqp89+wUDpb9ZhDRlMrst9+juZzDO/f/+1its+ZvzW+dWVeuQNsy8S7k58wC2w91/NjDdM4cs5UWZaRY57Ep9gIXE= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1555174849532425.1761045391995; Sat, 13 Apr 2019 10:00:49 -0700 (PDT) Received: from localhost ([127.0.0.1]:53929 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hFM1F-00042V-IG for importer@patchew.org; Sat, 13 Apr 2019 13:00:45 -0400 Received: from eggs.gnu.org ([209.51.188.92]:57958) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hFLup-0007IF-Ed for qemu-devel@nongnu.org; Sat, 13 Apr 2019 12:54:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hFLun-0002qt-Nm for qemu-devel@nongnu.org; Sat, 13 Apr 2019 12:54:07 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40446) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hFLuj-0002o6-Vl; Sat, 13 Apr 2019 12:54:02 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4191D30842A9; Sat, 13 Apr 2019 16:54:01 +0000 (UTC) Received: from localhost (ovpn-204-66.brq.redhat.com [10.40.204.66]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 94881600C8; Sat, 13 Apr 2019 16:54:00 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Date: Sat, 13 Apr 2019 18:53:42 +0200 Message-Id: <20190413165343.9018-7-mreitz@redhat.com> In-Reply-To: <20190413165343.9018-1-mreitz@redhat.com> References: <20190413165343.9018-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Sat, 13 Apr 2019 16:54:01 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v3 6/7] iotests: Test qemu-img convert --salvage 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: Kevin Wolf , Vladimir Sementsov-Ogievskiy , qemu-devel@nongnu.org, Max Reitz , "Denis V . Lunev" , Andrey Shinkevich Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" This test converts a simple image to another, but blkdebug injects block_status and read faults at some offsets. The resulting image should be the same as the input image, except that sectors that could not be read have to be 0. Signed-off-by: Max Reitz --- tests/qemu-iotests/249 | 163 +++++++++++++++++++++++++++++++++++++ tests/qemu-iotests/249.out | 43 ++++++++++ tests/qemu-iotests/group | 1 + 3 files changed, 207 insertions(+) create mode 100755 tests/qemu-iotests/249 create mode 100644 tests/qemu-iotests/249.out diff --git a/tests/qemu-iotests/249 b/tests/qemu-iotests/249 new file mode 100755 index 0000000000..d3883d75f3 --- /dev/null +++ b/tests/qemu-iotests/249 @@ -0,0 +1,163 @@ +#!/bin/bash +# +# Test qemu-img convert --salvage +# +# Copyright (C) 2018 Red Hat, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# + +# creator +owner=3Dmreitz@redhat.com + +seq=3D$(basename $0) +echo "QA output created by $seq" + +here=3D$PWD +status=3D1 # failure is the default! + +_cleanup() +{ + _cleanup_test_img +} +trap "_cleanup; exit \$status" 0 1 2 3 15 + +# get standard environment, filters and checks +. ./common.rc +. ./common.filter +. ./common.qemu + +_supported_fmt generic +_supported_proto file +_supported_os Linux + + +TEST_IMG=3D"$TEST_IMG.orig" _make_test_img 64M + +$QEMU_IO -c 'write -P 42 0 64M' "$TEST_IMG.orig" | _filter_qemu_io + + +sector_size=3D512 + +# Offsets on which to fail block-status. Keep in ascending order so +# the indexing done by _filter_offsets will appear in ascending order +# in the output as well. +status_fail_offsets=3D"$((16 * 1024 * 1024 + 8192)) + $((33 * 1024 * 1024 + 512))" + +# Offsets on which to fail reads. Keep in ascending order for the +# same reason. +# Element 1 is shared with $status_fail_offsets on purpose. +# Elements 2 and later test what happens when a continuous range of +# sectors is inaccessible. +read_fail_offsets=3D"$((32 * 1024 * 1024 - 65536)) + $((33 * 1024 * 1024 + 512)) + $(seq $((34 * 1024 * 1024)) $sector_size \ + $((34 * 1024 * 1024 + 4096 - $sector_size)))" + + +# blkdebug must be above the format layer so it can intercept all +# block-status events +source_img=3D"json:{'driver': 'blkdebug', + 'image': { + 'driver': '$IMGFMT', + 'file': { + 'driver': 'file', + 'filename': '$TEST_IMG.orig' + } + }, + 'inject-error': [" + +for ofs in $status_fail_offsets +do + source_img+=3D"{ 'event': 'none', + 'iotype': 'block-status', + 'errno': 5, + 'sector': $((ofs / sector_size)) }," +done + +for ofs in $read_fail_offsets +do + source_img+=3D"{ 'event': 'none', + 'iotype': 'read', + 'errno': 5, + 'sector': $((ofs / sector_size)) }," +done + +# Remove the trailing comma and terminate @inject-error and json:{} +source_img=3D"${source_img%,} ] }" + + +echo + + +_filter_offsets() { + filters=3D + + index=3D0 + for ofs in $2 + do + filters+=3D" -e s/$(printf "$1" $ofs)/status_fail_offset_$index/" + index=3D$((index + 1)) + done + + index=3D0 + for ofs in $3 + do + filters+=3D" -e s/$(printf "$1" $ofs)/read_fail_offset_$index/" + index=3D$((index + 1)) + done + + sed $filters +} + +# While determining the number of allocated sectors in the input +# image, we should see one block status warning per element of +# $status_fail_offsets. +# +# Then, the image is read. Since the block status is queried in +# basically the same way, the same warnings as in the previous step +# should reappear. Interleaved with those we should see a read +# warning per element of $read_fail_offsets. +# Note that $read_fail_offsets and $status_fail_offsets share an +# element (read_fail_offset_1 =3D=3D status_fail_offset_1), so +# "status_fail_offset_1" in the output is the same as +# "read_fail_offset_1". +$QEMU_IMG convert --salvage "$source_img" "$TEST_IMG" 2>&1 \ + | _filter_offsets '%i' "$status_fail_offsets" "$read_fail_offsets" + +echo + +# The offsets where the block status could not be determined should +# have been treated as containing data and thus should be correct in +# the output image. +# The offsets where reading failed altogether should be 0. Make them +# 0 in the input image, too, so we can compare both images. +for ofs in $read_fail_offsets +do + $QEMU_IO -c "write -z $ofs $sector_size" "$TEST_IMG.orig" \ + | _filter_qemu_io \ + | _filter_offsets '%i' '' "$read_fail_offsets" +done + +echo + +# These should be equal now. +$QEMU_IMG compare "$TEST_IMG.orig" "$TEST_IMG" + + +# success, all done +echo "*** done" +rm -f $seq.full +status=3D0 diff --git a/tests/qemu-iotests/249.out b/tests/qemu-iotests/249.out new file mode 100644 index 0000000000..9213d3e450 --- /dev/null +++ b/tests/qemu-iotests/249.out @@ -0,0 +1,43 @@ +QA output created by 249 +Formatting 'TEST_DIR/t.IMGFMT.orig', fmt=3DIMGFMT size=3D67108864 +wrote 67108864/67108864 bytes at offset 0 +64 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) + +qemu-img: warning: error while reading block status at offset status_fail_= offset_0: Input/output error +qemu-img: warning: error while reading block status at offset status_fail_= offset_1: Input/output error +qemu-img: warning: error while reading block status at offset status_fail_= offset_0: Input/output error +qemu-img: warning: error while reading offset read_fail_offset_0: Input/ou= tput error +qemu-img: warning: error while reading block status at offset status_fail_= offset_1: Input/output error +qemu-img: warning: error while reading offset status_fail_offset_1: Input/= output error +qemu-img: warning: error while reading offset read_fail_offset_2: Input/ou= tput error +qemu-img: warning: error while reading offset read_fail_offset_3: Input/ou= tput error +qemu-img: warning: error while reading offset read_fail_offset_4: Input/ou= tput error +qemu-img: warning: error while reading offset read_fail_offset_5: Input/ou= tput error +qemu-img: warning: error while reading offset read_fail_offset_6: Input/ou= tput error +qemu-img: warning: error while reading offset read_fail_offset_7: Input/ou= tput error +qemu-img: warning: error while reading offset read_fail_offset_8: Input/ou= tput error +qemu-img: warning: error while reading offset read_fail_offset_9: Input/ou= tput error + +wrote 512/512 bytes at offset read_fail_offset_0 +512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +wrote 512/512 bytes at offset read_fail_offset_1 +512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +wrote 512/512 bytes at offset read_fail_offset_2 +512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +wrote 512/512 bytes at offset read_fail_offset_3 +512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +wrote 512/512 bytes at offset read_fail_offset_4 +512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +wrote 512/512 bytes at offset read_fail_offset_5 +512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +wrote 512/512 bytes at offset read_fail_offset_6 +512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +wrote 512/512 bytes at offset read_fail_offset_7 +512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +wrote 512/512 bytes at offset read_fail_offset_8 +512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +wrote 512/512 bytes at offset read_fail_offset_9 +512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) + +Images are identical. +*** done diff --git a/tests/qemu-iotests/group b/tests/qemu-iotests/group index bae7718380..a2e2f507e8 100644 --- a/tests/qemu-iotests/group +++ b/tests/qemu-iotests/group @@ -248,3 +248,4 @@ 246 rw auto quick 247 rw auto quick 248 rw auto quick +249 auto quick --=20 2.20.1 From nobody Sat Apr 20 06:53:39 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1555174590; cv=none; d=zoho.com; s=zohoarc; b=Rx+Rqy7917lkaQ6+Qn59Ty8yfTwxg2cwpyCrLNPDC1//RXxZKFMIGY0s7W8pcC7nX3F7mx0AQyRoDKrDTnpUrSngZAG1CO9xCJoDxLBd4CLQU533ffSIdeNE2ZGsqk6re6VwGjqvSwipigfQ/AjHJhctd2IcpMbrdeq6I1nVtYo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1555174590; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=v1lY0RTYWSpWRi+eexDQ1E9/9lwd14Sk/rjlqPc74RE=; b=JxngjargFGxGM2GwiYlknvI4DbY5iAHH0+lmmdf4NMQzDVya2MjrG6NI7keRqRr/wai3ppmx7yHVeghg9SPkXFrlEcZHtrHMkbSKOm8oefODG84Jz60KCDqDqdEJR7wd6LP8S5duKSnixh3lKqvk9u26T5lKq/Um1zS3RqCjmQE= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 155517459016314.573227700696748; Sat, 13 Apr 2019 09:56:30 -0700 (PDT) Received: from localhost ([127.0.0.1]:53852 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hFLx4-0000Sd-57 for importer@patchew.org; Sat, 13 Apr 2019 12:56:26 -0400 Received: from eggs.gnu.org ([209.51.188.92]:57960) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hFLup-0007IG-FI for qemu-devel@nongnu.org; Sat, 13 Apr 2019 12:54:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hFLuo-0002rY-IM for qemu-devel@nongnu.org; Sat, 13 Apr 2019 12:54:07 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53754) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hFLum-0002pe-Cb; Sat, 13 Apr 2019 12:54:04 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A96FD30BDBCE; Sat, 13 Apr 2019 16:54:03 +0000 (UTC) Received: from localhost (ovpn-204-66.brq.redhat.com [10.40.204.66]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3EA765D71A; Sat, 13 Apr 2019 16:54:03 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Date: Sat, 13 Apr 2019 18:53:43 +0200 Message-Id: <20190413165343.9018-8-mreitz@redhat.com> In-Reply-To: <20190413165343.9018-1-mreitz@redhat.com> References: <20190413165343.9018-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Sat, 13 Apr 2019 16:54:03 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v3 7/7] iotests: Test qemu-img convert -C --salvage 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: Kevin Wolf , Vladimir Sementsov-Ogievskiy , qemu-devel@nongnu.org, Max Reitz , "Denis V . Lunev" , Andrey Shinkevich Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" We do not support this combination (yet), so this should yield an error message. Signed-off-by: Max Reitz Reviewed-by: Vladimir Sementsov-Ogievskiy Tested-by: Vladimir Sementsov-Ogievskiy --- tests/qemu-iotests/082 | 1 + tests/qemu-iotests/082.out | 3 +++ 2 files changed, 4 insertions(+) diff --git a/tests/qemu-iotests/082 b/tests/qemu-iotests/082 index d0afa46e9a..c58b37127f 100755 --- a/tests/qemu-iotests/082 +++ b/tests/qemu-iotests/082 @@ -163,6 +163,7 @@ echo =3D=3D=3D convert: -C and other options =3D=3D=3D run_qemu_img convert -C -S 4k -O $IMGFMT "$TEST_IMG" "$TEST_IMG".target run_qemu_img convert -C -S 8k -O $IMGFMT "$TEST_IMG" "$TEST_IMG".target run_qemu_img convert -C -c -O $IMGFMT "$TEST_IMG" "$TEST_IMG".target +run_qemu_img convert -C --salvage -O $IMGFMT "$TEST_IMG" "$TEST_IMG".target =20 echo echo =3D=3D=3D amend: Options specified more than once =3D=3D=3D diff --git a/tests/qemu-iotests/082.out b/tests/qemu-iotests/082.out index d36938da9b..9d4f7574c9 100644 --- a/tests/qemu-iotests/082.out +++ b/tests/qemu-iotests/082.out @@ -555,6 +555,9 @@ qemu-img: Cannot enable copy offloading when -S is used Testing: convert -C -c -O qcow2 TEST_DIR/t.qcow2 TEST_DIR/t.qcow2.target qemu-img: Cannot enable copy offloading when -c is used =20 +Testing: convert -C --salvage -O qcow2 TEST_DIR/t.qcow2 TEST_DIR/t.qcow2.t= arget +qemu-img: Cannot use copy offloading in salvaging mode + =3D=3D=3D amend: Options specified more than once =3D=3D=3D =20 Testing: amend -f foo -f qcow2 -o lazy_refcounts=3Don TEST_DIR/t.qcow2 --=20 2.20.1