From patchwork Wed Apr 27 13:43:00 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Wolf X-Patchwork-Id: 93054 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id E78BE1007D8 for ; Wed, 27 Apr 2011 23:42:13 +1000 (EST) Received: from localhost ([::1]:57149 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QF50N-0007Mz-6U for incoming@patchwork.ozlabs.org; Wed, 27 Apr 2011 09:42:11 -0400 Received: from eggs.gnu.org ([140.186.70.92]:51746) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QF4z1-0005Rm-B1 for qemu-devel@nongnu.org; Wed, 27 Apr 2011 09:40:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QF4yv-0007ly-Qg for qemu-devel@nongnu.org; Wed, 27 Apr 2011 09:40:47 -0400 Received: from mx1.redhat.com ([209.132.183.28]:3659) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QF4yv-0007lm-GV for qemu-devel@nongnu.org; Wed, 27 Apr 2011 09:40:41 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p3RDedth011994 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 27 Apr 2011 09:40:39 -0400 Received: from dhcp-5-188.str.redhat.com (dhcp-5-175.str.redhat.com [10.32.5.175]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p3RDeaVR016837; Wed, 27 Apr 2011 09:40:38 -0400 From: Kevin Wolf To: anthony@codemonkey.ws Date: Wed, 27 Apr 2011 15:43:00 +0200 Message-Id: <1303911790-27422-2-git-send-email-kwolf@redhat.com> In-Reply-To: <1303911790-27422-1-git-send-email-kwolf@redhat.com> References: <1303911790-27422-1-git-send-email-kwolf@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: kwolf@redhat.com, qemu-devel@nongnu.org Subject: [Qemu-devel] [PATCH 01/11] qemu-img: allow rebase to a NULL backing file when unsafe X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Anthony Liguori QEMU can drop a backing file so that an image file no longer depends on the backing file, but this feature has not been exposed in qemu-img. This is useful in an image streaming usecase or when an image file has been fully allocated and no reads can hit the backing file anymore. Since the dropping the backing file can make the image unusable, only allow this when the unsafe flag has been set. Signed-off-by: Anthony Liguori Signed-off-by: Stefan Hajnoczi Signed-off-by: Kevin Wolf --- qemu-img.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/qemu-img.c b/qemu-img.c index d9c2c12..ed5ba91 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -1240,7 +1240,7 @@ static int img_rebase(int argc, char **argv) } } - if ((optind >= argc) || !out_baseimg) { + if ((optind >= argc) || (!unsafe && !out_baseimg)) { help(); } filename = argv[optind++];