summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>2008-08-01 15:00:04 +0000
committeraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>2008-08-01 15:00:04 +0000
commit61fce45f12964d8775313e3c7f56318bac913902 (patch)
tree0d57c1c8001ad860c17612266e0c0210b3672733 /qemu-img.c
parentAsk password when encrypted disk image is used (Laurent Vivier) (diff)
downloadqemu-kvm-61fce45f12964d8775313e3c7f56318bac913902.tar.gz
qemu-kvm-61fce45f12964d8775313e3c7f56318bac913902.tar.bz2
qemu-kvm-61fce45f12964d8775313e3c7f56318bac913902.zip
qemu-img: set encrypted disk image password (Laurent Vivier)
This patch modify qemu-img to ask and set a password when an encrypted disk image is created. Signed-off-by: Laurent Vivier <Laurent.Vivier@bull.net> Signed-off-by: Anthony Liguori <anthony@codemonkey.ws> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4977 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'qemu-img.c')
-rw-r--r--qemu-img.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/qemu-img.c b/qemu-img.c
index f9d8b7d99..e2cc92635 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -208,6 +208,7 @@ static int img_create(int argc, char **argv)
uint64_t size;
const char *p;
BlockDriver *drv;
+ BlockDriverState *bs;
flags = 0;
for(;;) {
@@ -237,7 +238,6 @@ static int img_create(int argc, char **argv)
filename = argv[optind++];
size = 0;
if (base_filename) {
- BlockDriverState *bs;
bs = bdrv_new_open(base_filename, NULL);
bdrv_get_geometry(bs, &size);
size *= 512;
@@ -279,6 +279,9 @@ static int img_create(int argc, char **argv)
error("Error while formatting");
}
}
+ /* to set password */
+ bs = bdrv_new_open(filename, NULL);
+ bdrv_delete(bs);
return 0;
}