qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [6704] block: Introduce bdrv_get_encrypted_filename (Jan Kiszka)
@ 2009-03-05 23:00 Anthony Liguori
  0 siblings, 0 replies; only message in thread
From: Anthony Liguori @ 2009-03-05 23:00 UTC (permalink / raw)
  To: qemu-devel

Revision: 6704
          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6704
Author:   aliguori
Date:     2009-03-05 23:00:48 +0000 (Thu, 05 Mar 2009)
Log Message:
-----------
block: Introduce bdrv_get_encrypted_filename (Jan Kiszka)

Introduce bdrv_get_encrypted_filename service to allow more informative
password prompting.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

Modified Paths:
--------------
    trunk/block.c
    trunk/block.h

Modified: trunk/block.c
===================================================================
--- trunk/block.c	2009-03-05 23:00:43 UTC (rev 6703)
+++ trunk/block.c	2009-03-05 23:00:48 UTC (rev 6704)
@@ -1134,6 +1134,16 @@
     }
 }
 
+const char *bdrv_get_encrypted_filename(BlockDriverState *bs)
+{
+    if (bs->backing_hd && bs->backing_hd->encrypted)
+        return bs->backing_file;
+    else if (bs->encrypted)
+        return bs->filename;
+    else
+        return NULL;
+}
+
 void bdrv_get_backing_filename(BlockDriverState *bs,
                                char *filename, int filename_size)
 {

Modified: trunk/block.h
===================================================================
--- trunk/block.h	2009-03-05 23:00:43 UTC (rev 6703)
+++ trunk/block.h	2009-03-05 23:00:48 UTC (rev 6704)
@@ -152,6 +152,7 @@
                           const uint8_t *buf, int nb_sectors);
 int bdrv_get_info(BlockDriverState *bs, BlockDriverInfo *bdi);
 
+const char *bdrv_get_encrypted_filename(BlockDriverState *bs);
 void bdrv_get_backing_filename(BlockDriverState *bs,
                                char *filename, int filename_size);
 int bdrv_snapshot_create(BlockDriverState *bs,

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

only message in thread, other threads:[~2009-03-05 23:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-05 23:00 [Qemu-devel] [6704] block: Introduce bdrv_get_encrypted_filename (Jan Kiszka) 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).