From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:42616) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QA1QR-0007YJ-Fy for qemu-devel@nongnu.org; Wed, 13 Apr 2011 10:52:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QA1QL-0006A7-VP for qemu-devel@nongnu.org; Wed, 13 Apr 2011 10:52:11 -0400 Received: from mtagate7.uk.ibm.com ([194.196.100.167]:55866) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QA1QL-00064L-OC for qemu-devel@nongnu.org; Wed, 13 Apr 2011 10:52:05 -0400 Received: from d06nrmr1806.portsmouth.uk.ibm.com (d06nrmr1806.portsmouth.uk.ibm.com [9.149.39.193]) by mtagate7.uk.ibm.com (8.13.1/8.13.1) with ESMTP id p3DEpnVl022033 for ; Wed, 13 Apr 2011 14:51:49 GMT Received: from d06av10.portsmouth.uk.ibm.com (d06av10.portsmouth.uk.ibm.com [9.149.37.251]) by d06nrmr1806.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p3DEqd7G1802470 for ; Wed, 13 Apr 2011 15:52:39 +0100 Received: from d06av10.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av10.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p3DEpngq018300 for ; Wed, 13 Apr 2011 08:51:49 -0600 From: Stefan Hajnoczi Date: Wed, 13 Apr 2011 15:51:47 +0100 Message-Id: <1302706307-16627-1-git-send-email-stefanha@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH] qemu-img: allow rebase to a NULL backing file when unsafe List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Kevin Wolf , Anthony Liguori , Stefan Hajnoczi 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 --- 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++]; -- 1.7.4.1