From patchwork Wed Jul 12 11:46:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Butsykin X-Patchwork-Id: 9836559 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 A27B760363 for ; Wed, 12 Jul 2017 11:55:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8F7F1285F1 for ; Wed, 12 Jul 2017 11:55:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 820A1285F3; Wed, 12 Jul 2017 11:55:38 +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 9FACF285F1 for ; Wed, 12 Jul 2017 11:55:37 +0000 (UTC) Received: from localhost ([::1]:52039 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVGEy-0000N2-UF for patchwork-qemu-devel@patchwork.kernel.org; Wed, 12 Jul 2017 07:55:36 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49430) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVG7A-00035U-Bv for qemu-devel@nongnu.org; Wed, 12 Jul 2017 07:47:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dVG78-0003ko-9n for qemu-devel@nongnu.org; Wed, 12 Jul 2017 07:47:31 -0400 Received: from mail-ve1eur01on0107.outbound.protection.outlook.com ([104.47.1.107]:46733 helo=EUR01-VE1-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 1dVG71-0003eJ-QU; Wed, 12 Jul 2017 07:47:24 -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=V++ZVojLnuwQnK+vSoOVMKvXFE+PPJAT1AyBcIMx3Z4=; b=Hxz7H8ck/bfPpqWaIaWF56rrLiIa7ZQwBjHzV2dfJBtr6MRqxRgk+ZOc31U+Q3HEPzVybrPJSTjMSliicSHOB6xwlTD/CAD1H+scQXYakR5YP9VjlC9RJ6VYjQOvljw3STjlQfNdqeGO2rrCPfEmXrIU9oa3sftWLui4Olp1cC8= 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 DB6PR0802MB2551.eurprd08.prod.outlook.com (2603:10a6:4:a1::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1261.13; Wed, 12 Jul 2017 11:47:17 +0000 From: Pavel Butsykin To: qemu-block@nongnu.org, qemu-devel@nongnu.org Date: Wed, 12 Jul 2017 14:46:57 +0300 Message-Id: <20170712114700.20008-2-pbutsykin@virtuozzo.com> X-Mailer: git-send-email 2.13.0 In-Reply-To: <20170712114700.20008-1-pbutsykin@virtuozzo.com> References: <20170712114700.20008-1-pbutsykin@virtuozzo.com> MIME-Version: 1.0 X-Originating-IP: [195.214.232.6] X-ClientProxiedBy: AM5PR0201CA0023.eurprd02.prod.outlook.com (2603:10a6:203:3d::33) To DB6PR0802MB2551.eurprd08.prod.outlook.com (2603:10a6:4:a1::21) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b940df2b-4e09-4adf-c346-08d4c91bbfbe 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:DB6PR0802MB2551; X-Microsoft-Exchange-Diagnostics: 1; DB6PR0802MB2551; 3:slRaf6HoJwk1UD+hgI0j13xCkI4QJOSJgLnYBXThnzO0MmKHshLq1BwrMFfzn6y6HgIGapnPeKUds62Qeawlrc+vCR4RWhO118RJcolnbZVRXAzpAhjGxu8S8JtJjcm1GvbozYYjjgG8oJL7XjC7+9dFo0lW9WUOuI4EAQpenGl70onO9JtRcOvopqZo3zJLo+NO0JQxQxqc9WDbNpGo2mOy41fT3oQ6QLbTnxrB6wdVEBFLHURpqj2wHCmDOXf6GC1+oPZBOfGHKhyIxbsEHXQ9ZoqysYtDqI/+APIhOJ+Z1yCspYC/vQGnQshrjNALTLsuQYaVAhZheH0Z/3cZY+KwQv8wuqDacqSt7aGxUbx/EosL524OIG+I4QTCMoJb0xvW09WSX/MtLF4pISnahRw9DeGkJscDrJsG5GtlO5+V68VViuCvz0D5dOXf0iUxDBFEsL35m5O85+83xaEYwIqTNYUdekQf5a3WaLEsvOQLWNRCWUA3rJemt4y2LguuWsfEYA3+b1P8lkO7JsTxiF3Pwi2vNImsNAMtHTwrwVEmPbPqhDX71yKkcr21K+mV9OiuVmD8p/eo0qm+x+ViahEiXzOElVfN0EC7v8zEn0Zju1xmoUfaTC0Gbg8EZ2qpqU9M+uZmf2xA2VQmX5sYTYSt3qasV8pEed4Vg3Gp3FAl2IrV2Ifwsnwj4MJrZ8Y5LwrYffEmIViJyXoYPd0y3R92WikFfpZ2sOHyWLjDB9c= X-MS-TrafficTypeDiagnostic: DB6PR0802MB2551: X-Microsoft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RRZLh7KnaL5Q= X-Exchange-Antispam-Report-Test: UriScan:(236129657087228)(148574349560750)(17755550239193); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(2017060910075)(5005006)(8121501046)(3002001)(10201501046)(100000703101)(100105400095)(93006095)(93001095)(6041248)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123562025)(20161123555025)(20161123564025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DB6PR0802MB2551; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DB6PR0802MB2551; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DB6PR0802MB2551; 4:L0bTZBt7SddOKWlCcmGmP+tDEUbx2wunItAH/+Nh?= =?us-ascii?Q?t+DCFRHkjGY21CXD9yXVmJ0QrAmaLOAaZ8gb8Bv2bankV4GDv834xv8UWq7i?= =?us-ascii?Q?COsEkKJW4r0ygeJveL3ks/l3WnU84AyPBIEqmDj8inFAzTFA9LZ9f6GgYOsT?= =?us-ascii?Q?3QpQ6WfqJIfybE/tyEGDx0kSQQO94X5HPEyG1LiYh28fHLyMu2S7EMbM+GDM?= =?us-ascii?Q?6CnbHf6hUyYviHbOpy2ZAmgLDkoswCZjenCfs+3USbzgPYxpxaIriwsQ/And?= =?us-ascii?Q?lYDDe7etQ2ok/iAEWkqmRbrkSj2pgboDI6CuCPbN2mSSRGeuXsb0vzJgBpcR?= =?us-ascii?Q?dqCA+RU15er8rKKgxpMML60Qw2XxEnxCzZWGJlOxawAAMGYYFncuw3qvU8LC?= =?us-ascii?Q?ez0sgglXdHuTM4hJiV3upUlxIWS+GFzN4yYSt8vNGwMbgTiXvUAYxCWTSUJj?= =?us-ascii?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ront-Antispam-Report: SFV:NSPM; SFS:(10019020)(7370300001)(4630300001)(6009001)(39410400002)(39400400002)(39830400002)(39450400003)(6486002)(66066001)(478600001)(10056002)(6512007)(81166006)(7736002)(4326008)(8676002)(3846002)(5660300001)(42186005)(86362001)(53416004)(1076002)(110136004)(33646002)(6116002)(53936002)(76176999)(50986999)(2906002)(38730400002)(107886003)(5003940100001)(36756003)(25786009)(6506006)(189998001)(50226002)(305945005)(50466002)(6666003)(47776003)(48376002)(2950100002)(7350300001); DIR:OUT; SFP:1102; SCL:1; SRVR:DB6PR0802MB2551; H:pavelb-Z68P-DS3.sw.ru; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DB6PR0802MB2551; 23:8B0ZPwaJ5zrd1Pm6jcUxPpA8KRyQbQxfzeaAYOg?= =?us-ascii?Q?j59OXlONcpuuT2Qz9maTXjO1QWZIezwEblIBNkoIQRJ4HWT9jwK3z7TW7G35?= =?us-ascii?Q?9udCsKbYt8WGnNcCN0DgrLMwYmyj5+0fmZMucXYm0skvK3tHDfyAP3gtG0wJ?= =?us-ascii?Q?7Dqb4Rodwfqfy9++71RZ+HIFrzfFy/jnaYy/5QG51ycdgySmXgd7isWNPRQL?= =?us-ascii?Q?rt7ZP7nuBBvBFhzpiSqDs1E0IQWY3FfrJJiXhJgeMRuMSaum1/c5JDn/k1iu?= =?us-ascii?Q?OvFtd5tT+j7Rr8jFyE1sWldHmb3ZuDuztFQ1TQX3ITK6n/a3JMYUa7jbvUat?= =?us-ascii?Q?3C5Xi00Lv7g1OxnZP3oSXAhcdVIhjUGdWqtahKONYuao/iG8xpidKukCux77?= =?us-ascii?Q?1JDDFWWQ7r2D2g6oZR/qqDG0GVVvRFIcHVn8prpdcLvhSaDUzoz4Pm983GYf?= =?us-ascii?Q?ooHApTkEPw/fiUXhKAZU/MG+Kq1cmUNxnrpNDQ5Dr2GqD25YR0owaLz4aOy6?= =?us-ascii?Q?zstkDs43Lz353GcXvI6TF4pRRURphyaC1lJopb69Fdi2yYvmH5hhDU7wD3L9?= =?us-ascii?Q?WRLk6bHNfLZaWgNa93LK8AtEtCwIM13PKLRysJTGVZENn7WH9Yn1GnqX7YfH?= =?us-ascii?Q?KYpgH3xcHoQpuKkYHVCEB/xrXYZ6lW9VH9Q6wkTQxgR//V1nzcUJD0fhByot?= =?us-ascii?Q?0Nvbct/fY6Y232L5C2Xp7e3B3XizsO4inuOKBxJ86gR9N7ehEOCuODc5HsDp?= =?us-ascii?Q?cdV8HWjjvLrGclDaYOX6P0uCZprc5mBOlhQXPWZbGKutFSLmgiudzrWVYAju?= =?us-ascii?Q?4zYPJAbrhXHL1oCWP/1pnwUP5I2F173gFi3vY6m54AJ5HVjU9Q0QAtBTRXQk?= =?us-ascii?Q?Kj7d7uck4xdZelUfWkuotta1ww4aoaVJDnwhZi2oCd/OVisCEu2KQmndwIiR?= =?us-ascii?Q?UneFy4G/iWCA1VRUi6KEfVEggPOBdS68v9S7/Ik73axV6hyawsiXxgtJ32IU?= =?us-ascii?Q?WDqVsIs8jrV1UQJsJ2EPcANy6xTvG+PAwi+srVoB2ClDtvoRCAPCrQpBW/Ip?= =?us-ascii?Q?+c9m3tS0DZygQleNOZ7V2nRC7TVPKQIEYRN5QYkE6qwHzKJRDRLMOdXZH9jD?= =?us-ascii?Q?39TYowCyBLBs=3D?= X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DB6PR0802MB2551; 6:ytdf840uT4iXfqU755VQRKRGttJnkyw6Z7yxeAiz?= =?us-ascii?Q?FHW947xUeHFfFF0eADC0ImbSNJOMXMchNIpbcd4JziFQ+uEAIaRhpycnSBJN?= =?us-ascii?Q?P0tsuNOxsjDIU5w84ysgwZv4OgtpXNYT0L2BQNM1P2mC1dSDzNyK/R2kRu1R?= =?us-ascii?Q?STauHBJ2rmBfpHHHaVgoNVUsH28dkCkIEXMbuMlSz7Vn5cOE4MnYfQAFVCFI?= =?us-ascii?Q?So0G1cUzf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dRu7KkrXqViTjjqflpbPxh12Ovd2sa/G9qAGz3P8ibOg5bWVo6Ndj75Ma02B5C9aafSXOisEhKVjbGGxW1B/Z/KPJYPLTKroLVFF1EsPq/dsTloCPIviuocmh7Jtd8D0GUiOGZ31dKS1et8ngi11cccEq3bBGokb+rQUdDPq6ss+Rq2gHEHQ8qcoNcGYqyURvYE96WVE5GTi4EKUB+PoZtCz/cR6XpEL+4PYru4kPRyyUSLW6NRpnHUjbBh/10HFPR2MQdCM3lEaft8WlgUtZTBzCJkfrh2ubGROR7r9kLaU3JVXmh6hVDFxP7EazlU7+PXkMCLjZABmzu4rQmRujdNVtj9W3B2hyMXUhQ= X-Microsoft-Exchange-Diagnostics: 1; DB6PR0802MB2551; 20:fvBrfqbyJjJOyAjiduBggUH9jW1RyMDMIOdExrGD8VTxEnzzjDvbtqDhzqs3sKW5GkEPJeQPc4kDbs9/Hb+TCabKHBiqPOGP4hg6OH+F8UfOTb3RlKe6r+qH6pCH0p5d7jt1+8CQkcsMkZcaHUJpY+lzRy3sHhWdiKHuSOpRfe8= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jul 2017 11:47:17.7457 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0802MB2551 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.1.107 Subject: [Qemu-devel] [PATCH v5 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 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 --- qemu-img-cmds.hx | 4 ++-- qemu-img.c | 23 +++++++++++++++++++++++ qemu-img.texi | 6 +++++- tests/qemu-iotests/102 | 4 ++-- 4 files changed, 32 insertions(+), 5 deletions(-) diff --git a/qemu-img-cmds.hx b/qemu-img-cmds.hx index ac5946bc4f..e36957a2ca 100644 --- a/qemu-img-cmds.hx +++ b/qemu-img-cmds.hx @@ -82,9 +82,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 28022145d5..b4dc4bb5c4 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -64,6 +64,7 @@ enum { OPTION_TARGET_IMAGE_OPTS = 263, OPTION_SIZE = 264, OPTION_PREALLOCATION = 265, + OPTION_SHRINK = 266, }; typedef enum OutputFormat { @@ -3430,6 +3431,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. */ @@ -3448,6 +3450,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", @@ -3491,6 +3494,9 @@ static int img_resize(int argc, char **argv) return 1; } break; + case OPTION_SHRINK: + shrink = true; + break; } } if (optind != argc - 1) { @@ -3564,6 +3570,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 f11f6036ad..9a930f5e6d 100644 --- a/qemu-img.texi +++ b/qemu-img.texi @@ -529,7 +529,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}. @@ -537,6 +537,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/'