From 2bb7aa4e3dabbd9cf5693902715f79fedbe869de Mon Sep 17 00:00:00 2001 Message-Id: <2bb7aa4e3dabbd9cf5693902715f79fedbe869de.1368180503.git.minovotn@redhat.com> From: Kevin Wolf Date: Wed, 17 Apr 2013 12:33:14 +0200 Subject: [PATCH 1/5] qemu-img: allow rebase to a NULL backing file when unsafe RH-Author: Kevin Wolf Message-id: <1366201995-17212-2-git-send-email-kwolf@redhat.com> Patchwork-id: 50612 O-Subject: [RHEL-6.5 qemu-kvm PATCH 1/2] qemu-img: allow rebase to a NULL backing file when unsafe Bugzilla: 670162 RH-Acked-by: Eric Blake RH-Acked-by: Miroslav Rezanina RH-Acked-by: Stefan Hajnoczi From: Anthony Liguori Bugzilla: 670162 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 (cherry picked from commit 9a9d9dba3ea45b2bd1539db021ff7c2d7bfc2a98) --- qemu-img.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Signed-off-by: Michal Novotny --- qemu-img.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qemu-img.c b/qemu-img.c index 384868f..8d22d70 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -1494,7 +1494,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.11.7