From patchwork Wed Apr 13 14:51:47 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: qemu-img: allow rebase to a NULL backing file when unsafe Date: Wed, 13 Apr 2011 04:51:47 -0000 From: Stefan Hajnoczi X-Patchwork-Id: 91018 Message-Id: <1302706307-16627-1-git-send-email-stefanha@linux.vnet.ibm.com> To: 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++];