From patchwork Mon Sep 18 12:42:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Butsykin X-Patchwork-Id: 9956625 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 5E8C360568 for ; Mon, 18 Sep 2017 12:46:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4F38228D0C for ; Mon, 18 Sep 2017 12:46:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 43E9D28D14; Mon, 18 Sep 2017 12:46:46 +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 933C028D13 for ; Mon, 18 Sep 2017 12:46:45 +0000 (UTC) Received: from localhost ([::1]:36405 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dtvRk-0005jX-A3 for patchwork-qemu-devel@patchwork.kernel.org; Mon, 18 Sep 2017 08:46:44 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33482) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dtvOI-0003UV-7X for qemu-devel@nongnu.org; Mon, 18 Sep 2017 08:43:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dtvOD-0003Tx-5b for qemu-devel@nongnu.org; Mon, 18 Sep 2017 08:43:10 -0400 Received: from mail-eopbgr00136.outbound.protection.outlook.com ([40.107.0.136]:6071 helo=EUR02-AM5-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 1dtvNz-0003Gr-VJ; Mon, 18 Sep 2017 08:42:52 -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=FWGUUX/4DpwZw9u+hxmAJ/FaWjFDKdEL878GQWuOznY=; b=Jsbgrqq32ZdJuxJOwPvNbDobYWPD2+I9ReE53GcbwEVMhRbbL+PflJO1wzvN8E4WpAE94KPcMAGlrc/59MH54xfs9fJcwYakECwRkKsAQ3R0I9hkEXUAi4URvD/4qbKlThy2UmLpDlQMKcNq2HN6IS2xge/pFeiA9kBoq2Q0sdc= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=pbutsykin@virtuozzo.com; Received: from pavelb-Z68P-DS3.sw.ru (195.214.232.6) by DB6PR0802MB2549.eurprd08.prod.outlook.com (2603:10a6:4:a1::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.35.12; Mon, 18 Sep 2017 12:42:47 +0000 From: Pavel Butsykin To: qemu-block@nongnu.org, qemu-devel@nongnu.org Date: Mon, 18 Sep 2017 15:42:27 +0300 Message-Id: <20170918124230.8152-2-pbutsykin@virtuozzo.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20170918124230.8152-1-pbutsykin@virtuozzo.com> References: <20170918124230.8152-1-pbutsykin@virtuozzo.com> MIME-Version: 1.0 X-Originating-IP: [195.214.232.6] X-ClientProxiedBy: DB6PR0202CA0006.eurprd02.prod.outlook.com (2603:10a6:4:29::16) To DB6PR0802MB2549.eurprd08.prod.outlook.com (2603:10a6:4:a1::19) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 65e9f52c-e9cd-40fd-e273-08d4fe92c490 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(300000503095)(300135400095)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:DB6PR0802MB2549; X-Microsoft-Exchange-Diagnostics: 1; DB6PR0802MB2549; 3:EoJjZSwDr5NpRtkHvYeWx24DwZ/yynSCHEhpn0MV3YR/jPhhjXASATkCvXwGiOzHgW8BPlJj3nOw40eTUBa3y3/FBIgf0e0R8yQsbCrNLtalUJFcTo7bN4G9XpE2NSz2JdTHsv+rd+ast83R1L6FdQigqWQgGM4tfpoDUvsPVNRcu9ZvTs3KWVtrGb78PTKLJFoxoIDitgwvwwAWoMjWmKcOvq2m0pKfXbj/IqfEi0zgSI4eJ0SzK8XqPzMny7T9; 25:+WkpghTk0UPaNSlsoAOVccZyjW3ANcBPRuQOrRafQb+d1AggoScvrmS+Wwp1EPX7J/8UdHUsfIs8Ext4+lrtkC19nqxYuYqrbOOTNTBIOEhaVoHzD+H0AMcMk500QLa+BBmhb+VWN+gLUf7qmX1BV8ZIIJANSQglvZSkf8zU5wb4LZVEAESnicoWeJRmy4P31FTaCyr3wX29rVpwI14iPnhvcni0DH52s9ndYD+lKo2K74vxK18B3wu1Z41BRK2k+/9bx/E5MouYjm8gmJ1dxdVOUFNy8D/fnxcVRcemNkET9RXdolhShoi99vs6TB6B/clfviWcv0TjwHoivw0jAg==; 31:ev0+oLzqwqCrmEEZkcFTbKygfOwR5CbU1EliBpg1RlhyNU80JxOtbEqnmZhE5zo4Jhp+VCTAOwJ8XY6HDWmSGRK4dI6eLqwewbFraggJjPy7y3A+dGKQ+x1wqOziRG6AIOcH1TSt9e/16axYmME/FwHw7NLIHIdfFLPMTM9CwPuAYgTqA+/QcgcLywRbh0xUelWmwtvmC3I2HGqfQTrhJBZTeGv3mnO6wGUvfmxiPiQ= X-MS-TrafficTypeDiagnostic: DB6PR0802MB2549: X-Microsoft-Exchange-Diagnostics: 1; DB6PR0802MB2549; 20:Q5zPb/fWlALc82YKd3OiLARpi9QrIj15z1Dk9Woravn1SQj3kpFoXUtAtyan3p0LoZjGul/ThLQP1eJRNq/hVXDbOp0NRTxQpLMS+D1KGCL5D2nOjhbZm8CvRHDeof5rP9Ydf51mk4W0/XI91k6uqVj0RKQTg0BQj/OFybUt7lnj0bkmrFNRSOXfLpMDA4j6vEgr/u/GiCruWiwHzHVZfd/xaDmIXPgL+kgYqXSHVmr/Uol1oKde4cqv87i/2suigR89rA58Dyq0Jv3tyujbJSQCS3P22KPlZcFCw0ltqpxNd8y6cTAfMllQAUwxCsf+8iBFH5fpZyKYIoG2B/I6WaCQwRs6edtzn2Pwg9fnB566C4Fnj4TItLY++k2mhAV5lpV1pLbvO2YwPp2dAB7O4SeyYJHmAYf71/5ommTXDdw=; 4:yyhGLpdZrEztbv+9Gut4IqHArw8Yexye+dTo88tXZmqmGfdJn2/UQ2+4wVKoUBxvLRY1MgnV3rITu1R513X2QFu4oTSyIrOylDTa3ngukk2k/SD1WdlvBb9/mHpDkIvK05wriv3u4qiTRHZYg5dnABp3QKYNEqw/DO/xMdGS/iFvgfS83s9Esfu3LQSmZfIZL8bIMjiLX4rmTT79XShFYtCf1dEQZwIsPNsLpl8b3iG0KyRDKXmqYdtA5zGHp8sYUTwGNpnJ+WTHNAl9y2bLoFioo4HEkcYAXrXUZG+eVcU= X-Exchange-Antispam-Report-Test: UriScan:(17755550239193); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(3002001)(10201501046)(93006095)(93001095)(100000703101)(100105400095)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(20161123558100)(20161123564025)(20161123555025)(20161123560025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DB6PR0802MB2549; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DB6PR0802MB2549; X-Forefront-PRVS: 04347F8039 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(7370300001)(4630300001)(6009001)(346002)(376002)(39830400002)(199003)(189002)(36756003)(48376002)(105586002)(50466002)(107886003)(101416001)(110136004)(53416004)(50226002)(25786009)(305945005)(7736002)(53936002)(81156014)(4326008)(81166006)(6666003)(5003940100001)(68736007)(2906002)(8676002)(6506006)(3846002)(86362001)(478600001)(6486002)(6512007)(1076002)(6116002)(50986999)(76176999)(47776003)(2950100002)(33646002)(16586007)(7350300001)(97736004)(16526017)(10056002)(106356001)(316002)(5660300001)(66066001)(69596002)(189998001); DIR:OUT; SFP:1102; SCL:1; SRVR:DB6PR0802MB2549; H:pavelb-Z68P-DS3.sw.ru; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: virtuozzo.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DB6PR0802MB2549; 23:tfARpZ6AewP8WJOoYFn7362yNnbz9N2PhA2MQtz?= =?us-ascii?Q?RNerYJnNDU+pLewlPv3i0ZPnFYSov+b89YOsPUebVEcyLMNZUz+bWIRQbxKB?= =?us-ascii?Q?NHAsnq5V7H1T5s8KiSFOK06ZfSNpz3HwGx3cewdu2P29Tv9iOM42FfcP67LZ?= =?us-ascii?Q?T7EaVNcOc1/lH8h1Ko9cd8dN208xAkHwTWfV8MbdooGAYcY8B7G5haMRn6cO?= =?us-ascii?Q?uFVNVViP6iJ1Im9q7yS2hAutlTwOFsQC408xvdYaNiTeLY8jTpw6p7eyaTxy?= =?us-ascii?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ange-Diagnostics: 1; DB6PR0802MB2549; 20:RxGsr2KkQpmfTYwZha9WOy2w3Z3eQYqA9iNj9fcqdqW1DVOk3NGVZCbFX/RxjYPVoWbOWNYsUlvFC5PNP/MOb+rcfXlMQ9v6CiX+6UNkKD7b3WNLmMuiFxwEE/uHyV8BgjDPDbzuvTwqi3QLbqAwmFaQVzgmAIwhxwndci4FbGc= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Sep 2017 12:42:47.4936 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0802MB2549 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 40.107.0.136 Subject: [Qemu-devel] [PATCH v8 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, jsnow@redhat.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 is additional precaution against data loss. Perhaps in the future the operation shrink without this flag will be blocked for all formats, but for now we need to maintain compatibility with raw. Signed-off-by: Pavel Butsykin Reviewed-by: Max Reitz Reviewed-by: John Snow --- qemu-img-cmds.hx | 4 ++-- qemu-img.c | 23 +++++++++++++++++++++++ qemu-img.texi | 6 +++++- tests/qemu-iotests/102 | 4 ++-- tests/qemu-iotests/106 | 2 +- 5 files changed, 33 insertions(+), 6 deletions(-) diff --git a/qemu-img-cmds.hx b/qemu-img-cmds.hx index b47d409665..2fe31893cf 100644 --- a/qemu-img-cmds.hx +++ b/qemu-img-cmds.hx @@ -89,9 +89,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 STEXI diff --git a/qemu-img.c b/qemu-img.c index 56ef49e214..b7b2386cbd 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -65,6 +65,7 @@ enum { OPTION_TARGET_IMAGE_OPTS = 263, OPTION_SIZE = 264, OPTION_PREALLOCATION = 265, + OPTION_SHRINK = 266, }; typedef enum OutputFormat { @@ -3437,6 +3438,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. */ @@ -3455,6 +3457,7 @@ static int img_resize(int argc, char **argv) {"object", required_argument, 0, OPTION_OBJECT}, {"image-opts", no_argument, 0, OPTION_IMAGE_OPTS}, {"preallocation", required_argument, 0, OPTION_PREALLOCATION}, + {"shrink", no_argument, 0, OPTION_SHRINK}, {0, 0, 0, 0} }; c = getopt_long(argc, argv, ":f:hq", @@ -3498,6 +3501,9 @@ static int img_resize(int argc, char **argv) return 1; } break; + case OPTION_SHRINK: + shrink = true; + break; } } if (optind != argc - 1) { @@ -3571,6 +3577,23 @@ static int img_resize(int argc, char **argv) goto out; } + if (total_size < current_size && !shrink) { + warn_report("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 { + warn_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, prealloc, &err); if (!ret) { qprintf(quiet, "Image resized.\n"); diff --git a/qemu-img.texi b/qemu-img.texi index 72dabd6b3e..ea5d04b873 100644 --- a/qemu-img.texi +++ b/qemu-img.texi @@ -536,7 +536,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 [--preallocation=@var{prealloc}] @var{filename} [+ | -]@var{size} +@item resize [--shrink] [--preallocation=@var{prealloc}] @var{filename} [+ | -]@var{size} Change the disk image as if it had been created with @var{size}. @@ -544,6 +544,10 @@ 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! +When shrinking images, the @code{--shrink} option must be given. This informs +qemu-img that the user acknowledges all loss of data beyond the truncated +image's end. + 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/' diff --git a/tests/qemu-iotests/106 b/tests/qemu-iotests/106 index 32649578fb..bfe71f4e60 100755 --- a/tests/qemu-iotests/106 +++ b/tests/qemu-iotests/106 @@ -83,7 +83,7 @@ echo '=== Testing image shrinking ===' for growth_mode in falloc full off; do echo echo "--- growth_mode=$growth_mode ---" - $QEMU_IMG resize -f "$IMGFMT" --preallocation=$growth_mode "$TEST_IMG" -${GROWTH_SIZE}K + $QEMU_IMG resize -f "$IMGFMT" --shrink --preallocation=$growth_mode "$TEST_IMG" -${GROWTH_SIZE}K done # success, all done