From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KOw72-0004iM-WF for qemu-devel@nongnu.org; Fri, 01 Aug 2008 11:00:13 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KOw72-0004hK-5a for qemu-devel@nongnu.org; Fri, 01 Aug 2008 11:00:12 -0400 Received: from [199.232.76.173] (port=50697 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KOw71-0004h6-Sv for qemu-devel@nongnu.org; Fri, 01 Aug 2008 11:00:11 -0400 Received: from savannah.gnu.org ([199.232.41.3]:43984 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KOw71-0005Tt-KH for qemu-devel@nongnu.org; Fri, 01 Aug 2008 11:00:11 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1KOw6z-0004xG-3L for qemu-devel@nongnu.org; Fri, 01 Aug 2008 15:00:10 +0000 Received: from aliguori by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1KOw6x-0004w9-3N for qemu-devel@nongnu.org; Fri, 01 Aug 2008 15:00:08 +0000 MIME-Version: 1.0 Errors-To: aliguori Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Anthony Liguori Message-Id: Date: Fri, 01 Aug 2008 15:00:07 +0000 Subject: [Qemu-devel] [4977] qemu-img: set encrypted disk image password (Laurent Vivier) Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org 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 Signed-off-by: Anthony Liguori 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; }