aboutsummaryrefslogtreecommitdiff
path: root/qemu-img.c
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2011-04-13 15:51:47 +0100
committerKevin Wolf <kwolf@redhat.com>2011-04-27 11:12:50 +0200
commit9a9d9dba3ea45b2bd1539db021ff7c2d7bfc2a98 (patch)
tree40cf717dcfcbd28cfcefbe6958cb6046bd675bf1 /qemu-img.c
parent430a3c18064fd3c007048d757e8bd0fff45fcc99 (diff)
qemu-img: allow rebase to a NULL backing file when unsafe
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 <aliguori@us.ibm.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'qemu-img.c')
-rw-r--r--qemu-img.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/qemu-img.c b/qemu-img.c
index d9c2c12fa0..ed5ba91117 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++];