qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [4977] qemu-img: set encrypted disk image password (Laurent Vivier)
@ 2008-08-01 15:00 Anthony Liguori
  0 siblings, 0 replies; only message in thread
From: Anthony Liguori @ 2008-08-01 15:00 UTC (permalink / raw)
  To: qemu-devel

Revision: 4977
          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=4977
Author:   aliguori
Date:     2008-08-01 15:00:04 +0000 (Fri, 01 Aug 2008)

Log Message:
-----------
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>

Modified Paths:
--------------
    trunk/qemu-img.c

Modified: trunk/qemu-img.c
===================================================================
--- trunk/qemu-img.c	2008-08-01 14:51:02 UTC (rev 4976)
+++ trunk/qemu-img.c	2008-08-01 15:00:04 UTC (rev 4977)
@@ -208,6 +208,7 @@
     uint64_t size;
     const char *p;
     BlockDriver *drv;
+    BlockDriverState *bs;
 
     flags = 0;
     for(;;) {
@@ -237,7 +238,6 @@
     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 @@
             error("Error while formatting");
         }
     }
+    /* to set password */
+    bs = bdrv_new_open(filename, NULL);
+    bdrv_delete(bs);
     return 0;
 }
 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-08-01 15:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-01 15:00 [Qemu-devel] [4977] qemu-img: set encrypted disk image password (Laurent Vivier) Anthony Liguori

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).