From patchwork Fri Jul 7 14:30:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Butsykin X-Patchwork-Id: 9830575 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id F0A5760352 for ; Fri, 7 Jul 2017 14:32:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E3F0B28697 for ; Fri, 7 Jul 2017 14:32:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D8B76286A9; Fri, 7 Jul 2017 14:32:45 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0BC5728697 for ; Fri, 7 Jul 2017 14:32:45 +0000 (UTC) Received: from localhost ([::1]:56839 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dTUJI-00019J-92 for patchwork-qemu-devel@patchwork.kernel.org; Fri, 07 Jul 2017 10:32:44 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48914) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dTUHq-00016y-03 for qemu-devel@nongnu.org; Fri, 07 Jul 2017 10:31:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dTUHo-0007h6-LM for qemu-devel@nongnu.org; Fri, 07 Jul 2017 10:31:14 -0400 Received: from mail-db5eur01on0112.outbound.protection.outlook.com ([104.47.2.112]:47294 helo=EUR01-DB5-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dTUHh-0007VU-Fu; Fri, 07 Jul 2017 10:31:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=UZrn7/5rLoVRypFu6Tt6l0nx2JfznDaigpChwkjWuLk=; b=RphKNzrMnWVMT01ZqR3z7Vy0YM2FXiDFTCi/dyzJJFaGPZ9Xx68Aymsg2jwbc0vWcqBlT3yGVM68P+9FKKHSdBDpA4AyCruVx/WeoizISK1Q3Le/rjxZATp8obtmzgyuiMPT9z8pAVp03nrYVHOR0H+sNIlMGICcZRhQ2dQLudM= Authentication-Results: nongnu.org; dkim=none (message not signed) header.d=none; nongnu.org; dmarc=none action=none header.from=virtuozzo.com; Received: from pavelb-Z68P-DS3.sw.ru (195.214.232.6) by AM5PR0802MB2546.eurprd08.prod.outlook.com (2603:10a6:203:a0::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1240.13; Fri, 7 Jul 2017 14:30:57 +0000 From: Pavel Butsykin To: qemu-block@nongnu.org, qemu-devel@nongnu.org Date: Fri, 7 Jul 2017 17:30:25 +0300 Message-Id: <20170707143028.692-2-pbutsykin@virtuozzo.com> X-Mailer: git-send-email 2.13.0 In-Reply-To: <20170707143028.692-1-pbutsykin@virtuozzo.com> References: <20170707143028.692-1-pbutsykin@virtuozzo.com> MIME-Version: 1.0 X-Originating-IP: [195.214.232.6] X-ClientProxiedBy: KL1P15301CA0023.APCP153.PROD.OUTLOOK.COM (2603:1096:802:2::33) To AM5PR0802MB2546.eurprd08.prod.outlook.com (2603:10a6:203:a0::22) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1e965796-7ff7-4460-fc96-08d4c544cb7d X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(300000503095)(300135400095)(201703131423075)(201703031133081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:AM5PR0802MB2546; X-Microsoft-Exchange-Diagnostics: 1; AM5PR0802MB2546; 3:QFqwEhYHJ6akEl4fCjJDBmKOoeDGW0i9RhbHFdKyB/olkKpcLsi2p5gV/0t8j+0p/mhtW6v9s+qbafjRNRKqw/otsgx46SzMICtHW6UALj/EYuMdPavpm9mmoUfsn457t9B0Gc0AOBL4QSoGcnY8HldcCqVA4Micf3xRoTvInRlFcdhLD3zm3+FGpOCa11JcbElPtppmMMb81a5TD7yBb+c3lllJq0aX+MDFBezcJ/JdqEm9qb7MtNKZjkApIYaYZ03ucZmtFu+MVHRQNE43osvpUqSaI6y1G5Nek5EnJJ8Pqbb9fXo2Y6+LsOOqL5AqEeWHuubMHY0AuocstrS0ZF8sGTAyQs12Y55Qt83NNFaU/qONGRLPunMW8zJ/8TYTlQ7HPQ3HAtFY5t6cWYL3dLIWCxSpFtvjV+ac8ehCTgELzGdhbF5i1THrrXS0Mpok3qw+r5NTvCtWWAGCr3dWhSETVURmn1LLLyKIeiUb/6UwpIS+OSfVSbkrok1nyTck1rCXz4eTUZjK+EBqh0Sn+qv2B7Qqp6ZlHiA1mPkAa6Wfyl5880jXb8khqUfx3+bmS8BSAkd6Kg4GDiDEYloRd3bNFyTQv3Ac5473Vr4eHHsnumbA7k/eq/b53WF1nzRyBmuw+87jp9BPC9WF55XaO08sAkXXEXsrmoaBDA7etjwoHxRU8Y6qVQnSdOg4smzPfesip77YUWC1uKx9fKID+Euk9MJr4JWc/OPlDgSzPBgDCZMpKkZgMUhxUd7KFeqM X-MS-TrafficTypeDiagnostic: AM5P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oIeZf617kmgNjAHUepYPNbEvo= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(236129657087228)(148574349560750)(17755550239193); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(2017060910064)(93006095)(93001095)(10201501046)(100000703101)(100105400095)(3002001)(6041248)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123562025)(20161123564025)(20161123560025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:AM5PR0802MB2546; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:AM5PR0802MB2546; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM5PR0802MB2546; 4:xOjPd0zKcxoF2x9KdB1l29EM7GWsd9LgYWDJb23U?= =?us-ascii?Q?YpXLePqGqoT1/rQC2kd7vYyH0+VhLG31BjKbxefCDEJXlJxpK0Fs48f/l8iU?= =?us-ascii?Q?vaUNa2gsdeavGUrlgs4vIobm8nTmBB2DaQFGkCxFq2TRNPSpDOzh9YGkVp09?= =?us-ascii?Q?RRqxON87FmAF9MnlEimgvvlcwwZ9qTlvUiRT2Q2X6onTBcKfxk9+Pdjqb5aX?= =?us-ascii?Q?zLX8FhNjQwIc7Ve2ur3ZvFpYrOw/dQLWDIFIv+nyXE/fCB1Pa6MYqfiNhBUL?= =?us-ascii?Q?vkna6jgJJas7SMSPHhjGlirABiRM6S2+Ewe57LtkWiIwj3SpohV2kDqHs+fl?= =?us-ascii?Q?BP1q/h2oV4t+HwfX397+7DdGH33Tr7kZHBhxVYCRUseOH+Ul1MGbnZVPyw+9?= =?us-ascii?Q?3etlA2q3gc8VAN0QDKA69hLieIVo72F18X7OqwMxSvdQFyFJBo3tfeTE3S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0361212EA8 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(39410400002)(39840400002)(39450400003)(39400400002)(81166006)(36756003)(53416004)(8676002)(42186005)(50226002)(10056002)(5003940100001)(189998001)(33646002)(6666003)(2950100002)(5660300001)(1076002)(47776003)(76176999)(50986999)(6512007)(25786009)(48376002)(50466002)(305945005)(3846002)(7736002)(6486002)(53936002)(86362001)(66066001)(6506006)(6116002)(38730400002)(478600001)(107886003)(110136004)(4326008)(2906002); DIR:OUT; SFP:1102; SCL:1; SRVR:AM5PR0802MB2546; H:pavelb-Z68P-DS3.sw.ru; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM5PR0802MB2546; 23:kdeYzopb5PgX5O+l5ZFJ4FFAYabt1/fhRplbHPW?= =?us-ascii?Q?Y+6PbTueLBQw0uc9eSf1+9a0zhMLGkBI2gozQHAFaPMxeN1lO1Zva7dL9h1o?= =?us-ascii?Q?WER2A6CuK5fEGQaGYiAzITbZxJPfUBcV2cRjpqi0/MJZAh99nFZkH/shLyew?= =?us-ascii?Q?h5Qbj669TJBexQH+GdbPctJoXtZD6ICBmAhkT/oQX92yArgTxQEAWo6jiYO1?= =?us-ascii?Q?tQf/7KettXvJJoDT7Vo7f/xgqI/ndJiYkOUy8ztUTwO43VvJePtvlsnbX3em?= =?us-ascii?Q?k/mkQ8AAqse4fE7iRPDU4YPQQJ+RsQKSomBIedazLzJyN5R3cRADZ5Z/1CkQ?= =?us-ascii?Q?pjCRoEMOEqbX/HjRuxGf9Z37Hv7MmVjwjjI9wcbAOWw995tqJGLx8RL5eeZj?= =?us-ascii?Q?fmoqQWjwTlK6kY3fCamfOJS9A8HFx6BvM4qlxYcQDaUhnovOGStrLcH9A3tz?= =?us-ascii?Q?HTBHSZtAaCxHYKMaDweLP2RFjCqa95qCOBg6DUX/nnCfhd3w3rgZMD3SptB/?= =?us-ascii?Q?gFsyhRv6PjhGYMcM9OBPe+n7Jy8HuebNjbx8BOba15T/M14T/kbGSaTbcwX+?= =?us-ascii?Q?2eFmF09s7wqR3r6N9boONjN+isY2M2N7q4kU/wDHEiqjZryEMlbawkXRiJq2?= =?us-ascii?Q?ezEhS5pZ971L6GYMkvndMITuJBsIt/0NJ8gTXNoHnWxA27lkq5AHrPi+JL+k?= =?us-ascii?Q?eBmBviN11LnNjTBHHqfW295e/r+OwgeMPNgWLWd4y/ATPn+Re6a8GGKBwn+n?= =?us-ascii?Q?vIeJu7SNl9o4ax+h04tc65Sw57rGZhEhZsknl8x58o+XOXBRJwM8B9yPqIJO?= =?us-ascii?Q?ta0K2V/xFkf7CoJM+sbca1IRrcNDWFAC5hNPY6BTFiO21n5X4vaTZkCLk7uG?= =?us-ascii?Q?yA2KQZ5AblHMyMxpbE4olciLBXe8Dtae81mjLbAXElqgKi7IpWZgZcTGWcvT?= =?us-ascii?Q?sTk7v4T56FensGtU4rDFPlN2jiFR7gbyC/DbLzpDN5M/B47+Gq5VIU7N6cgA?= =?us-ascii?Q?LqIUOurTRfBEithUSkevH5+ctjSNjdgMijKpYlYrIjcdtdECeiHFt7tOze6g?= =?us-ascii?Q?Pl+Tyh/A=3D?= X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM5PR0802MB2546; 6:h65XmvR1nsr/8mevZmVuGxoUSXs8Vfnmyw7IW759?= =?us-ascii?Q?SB7zutVDZmV8EBxpgWtTO+I0oMnIJuxL1xyI9dZq0KqWbMU5wpqsP3uqgBDP?= =?us-ascii?Q?VLJf41RMSoa5DlOKH9kT1gFBCBhnYx2uRHX9XbPXF+/COF8YCPrvuf+OZi2k?= =?us-ascii?Q?Gx3ah24vPldd+EBdC+HZPWSGmVCQAb8vSbPAdDjTuxzC5w9CRd0qAtial/fu?= =?us-ascii?Q?GtaEHCiPEPqbP1UX+7qsrOC40O3KVTXFiYwul0p/UWXxmHHkRZN17IqCePpG?= =?us-ascii?Q?6cl/Rv5lul2ALW4EYYftBZ+0fY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cHGLNtB+thWlYsJuNzxI5thoImz434Hkr6WR1hPH758df94366SQ0WLro4gdT5+F9h1ISUP4asEtD2uMt6EqPH48/exgb8ITXY7CGA181ci7zhOY73rxOWmTl5AfsgUMt0aQe09n/xNQ2nD3+17DreSnwlY5vmfjUI4Vg4/w8OY5UCh20xNNPkte6bZLWeGadg+bDmddUlkOLQdB6n5n/ohaizkSKC3/B0dzdgb7UKhc4YjYLENXJ4WRd1fBh5iQGWi18K1I70Wz0DSvQQrp2CqRvKnAXYt/o7wf7GtKIRAkfziIB0CR9JYzV1eM59GUc44M1FGZ5dq0aZL43RUCGwar7VeHM34CeKl; 24:tKKVKwuRaj3xHp9f00B/hsq9MAIMe5x9cFoRoT25cwicr4xkfxjs8KfpQklEZwFnM79SbwQa9Kc7hORZEisAAPRnDvsOHpDO0t4YjhQJYto= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; AM5PR0802MB2546; 7:fq31tzTdyC4u0BuFenPDhpdaG3grV0NqM2nBKnOdghkvSYQ4V2Mp7p+aqTiY2Iw0wOmeObXFSuAmARALNa6zERjMSXf/1qDrH9qWQI7+FzDG7fQVLVyUA+VANT6zR3lf0ltLUgQrqE3bpD5ITy/WMTrmAHLmugDCDIrpMgCf3SyrN0Svs7W2fdvSCgrd7OARrnnFsCS/L2BhVmK7tB8oxJJ5BMV3bvNagTOH4WD0hYroare9GbGBnErxWnyTgg+XY/wlkc9SGpgaJgHomxGI4RIMnysrJI2TNCGLkogpMdKfbqbOiHLGi/fc2wOUV2zJrk30Zw4Oevhq3h5iHINMiKmd302XBx5u0nGFaFGUVf694i+An37wOWAzz3UiBkCp+oYtOwvKtLi/RoQycIAiq5JSreAvi9GhYss9TBCJCGcf2Va7mwTBT/uOX9HyxMp8XRTop+eN3HM+zuKOHsMyDPPl0c4iY/lQL//gRrTGZeLBO5PPpIIP1vFB3T/Xyqd13Jp31Pb16VTafaLvxTonEIUuEIXitXKcWQPxeGURjLMHLRFh0uHFumeYelRnK3ZsjeVyA7K2rh0hVRAbMsNAKiDZV+0knbQ6+J3oG1Xnnfp1F389uwIhHTRtJeDqwxO8+sCCyqwrMrFKSB1NsZUytrnTxqmMntydKkxLUFGzjiwHZJTD7HFSKh3LDigzO227vbeB9b1sPMJ05cBiTCcVGqNb4PAJhWUeR27LXxmA+TabQ9b+tncpqQE1wN/IIxCzlV8xPfUEd0xLUSO4s8hiZ9hsu8t5IF1GdBQ6RHVfMdo= X-Microsoft-Exchange-Diagnostics: 1; AM5PR0802MB2546; 20:cWkqpJX8wxi4Un+APzYAMRfnl7KR3usUQZT4LfqErKb3Adt+agZgtFdzEudkjmy3IdYQEU1YexPhl1P1zK+HvhyTAozNvTM0yNgZ/WvGH+FJuiRLo3v0uouk8MHw+dq/dASR3ImcHxz+zjHtxgXXD9eJTgzz8tDuOnVaUyIV+Po= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2017 14:30:57.9499 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0802MB2546 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.2.112 Subject: [Qemu-devel] [PATCH v3 1/4] qemu-img: add --shrink flag for resize 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, pbutsykin@virtuozzo.com, armbru@redhat.com, mreitz@redhat.com, den@openvz.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP The flag as additional precaution of data loss. Perhaps in the future the operation shrink without this flag will be blocked for all formats, but while we need to maintain compatibility with raw. Signed-off-by: Pavel Butsykin Reviewed-by: Max Reitz --- qemu-img-cmds.hx | 4 ++-- qemu-img.c | 23 +++++++++++++++++++++++ qemu-img.texi | 7 ++++++- tests/qemu-iotests/102 | 4 ++-- 4 files changed, 33 insertions(+), 5 deletions(-) diff --git a/qemu-img-cmds.hx b/qemu-img-cmds.hx index a39fcdba71..3b2eab9d20 100644 --- a/qemu-img-cmds.hx +++ b/qemu-img-cmds.hx @@ -76,9 +76,9 @@ STEXI ETEXI DEF("resize", img_resize, - "resize [--object objectdef] [--image-opts] [-q] filename [+ | -]size") + "resize [--object objectdef] [--image-opts] [-q] [--shrink] filename [+ | -]size") STEXI -@item resize [--object @var{objectdef}] [--image-opts] [-q] @var{filename} [+ | -]@var{size} +@item resize [--object @var{objectdef}] [--image-opts] [-q] [--shrink] @var{filename} [+ | -]@var{size} ETEXI DEF("amend", img_amend, diff --git a/qemu-img.c b/qemu-img.c index 91ad6bebbf..9773e835e4 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -61,6 +61,7 @@ enum { OPTION_FLUSH_INTERVAL = 261, OPTION_NO_DRAIN = 262, OPTION_TARGET_IMAGE_OPTS = 263, + OPTION_SHRINK = 264, }; typedef enum OutputFormat { @@ -3458,6 +3459,7 @@ static int img_resize(int argc, char **argv) }, }; bool image_opts = false; + bool shrink = false; /* Remove size from argv manually so that negative numbers are not treated * as options by getopt. */ @@ -3475,6 +3477,7 @@ static int img_resize(int argc, char **argv) {"help", no_argument, 0, 'h'}, {"object", required_argument, 0, OPTION_OBJECT}, {"image-opts", no_argument, 0, OPTION_IMAGE_OPTS}, + {"shrink", no_argument, 0, OPTION_SHRINK}, {0, 0, 0, 0} }; c = getopt_long(argc, argv, ":f:hq", @@ -3509,6 +3512,9 @@ static int img_resize(int argc, char **argv) case OPTION_IMAGE_OPTS: image_opts = true; break; + case OPTION_SHRINK: + shrink = true; + break; } } if (optind != argc - 1) { @@ -3568,6 +3574,23 @@ static int img_resize(int argc, char **argv) goto out; } + if (total_size < blk_getlength(blk) && !shrink) { + error_report("Warning: Shrinking an image will delete all data beyond" + "the shrunken image's end. Before performing such an" + "operation, make sure there is no important data there."); + + if (g_strcmp0(bdrv_get_format_name(blk_bs(blk)), "raw") != 0) { + error_report( + "Use the --shrink option to perform a shrink operation."); + ret = -1; + goto out; + } else { + error_report("Using the --shrink option will suppress this message." + "Note that future versions of qemu-img may refuse to " + "shrink images without this option!"); + } + } + ret = blk_truncate(blk, total_size, &err); if (!ret) { qprintf(quiet, "Image resized.\n"); diff --git a/qemu-img.texi b/qemu-img.texi index 5b925ecf41..6324abef48 100644 --- a/qemu-img.texi +++ b/qemu-img.texi @@ -499,7 +499,7 @@ qemu-img rebase -b base.img diff.qcow2 At this point, @code{modified.img} can be discarded, since @code{base.img + diff.qcow2} contains the same information. -@item resize @var{filename} [+ | -]@var{size} +@item resize [--shrink] @var{filename} [+ | -]@var{size} Change the disk image as if it had been created with @var{size}. @@ -507,6 +507,11 @@ Before using this command to shrink a disk image, you MUST use file system and partitioning tools inside the VM to reduce allocated file systems and partition sizes accordingly. Failure to do so will result in data loss! +@code{--shrink} informs qemu-img that the user is certain about wanting +to shrink an image and is aware that any data beyond the truncated +image's end will be lost. Trying to shrink an image without this option +results in a warning; future versions may make it an error. + After using this command to grow a disk image, you must use file system and partitioning tools inside the VM to actually begin using the new space on the device. diff --git a/tests/qemu-iotests/102 b/tests/qemu-iotests/102 index 87db1bb1bf..d7ad8d9840 100755 --- a/tests/qemu-iotests/102 +++ b/tests/qemu-iotests/102 @@ -54,7 +54,7 @@ _make_test_img $IMG_SIZE $QEMU_IO -c 'write 0 64k' "$TEST_IMG" | _filter_qemu_io # Remove data cluster from image (first cluster: image header, second: reftable, # third: refblock, fourth: L1 table, fifth: L2 table) -$QEMU_IMG resize -f raw "$TEST_IMG" $((5 * 64 * 1024)) +$QEMU_IMG resize -f raw --shrink "$TEST_IMG" $((5 * 64 * 1024)) $QEMU_IO -c map "$TEST_IMG" $QEMU_IMG map "$TEST_IMG" @@ -69,7 +69,7 @@ $QEMU_IO -c 'write 0 64k' "$TEST_IMG" | _filter_qemu_io qemu_comm_method=monitor _launch_qemu -drive if=none,file="$TEST_IMG",id=drv0 -$QEMU_IMG resize -f raw "$TEST_IMG" $((5 * 64 * 1024)) +$QEMU_IMG resize -f raw --shrink "$TEST_IMG" $((5 * 64 * 1024)) _send_qemu_cmd $QEMU_HANDLE 'qemu-io drv0 map' 'allocated' \ | sed -e 's/^(qemu).*qemu-io drv0 map...$/(qemu) qemu-io drv0 map/'