aboutsummaryrefslogtreecommitdiff
path: root/block.c
diff options
context:
space:
mode:
authoraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>2009-03-05 23:00:48 +0000
committeraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>2009-03-05 23:00:48 +0000
commit045df33021d11bba6ed6a9caec37f68d0c615ca1 (patch)
treeae731038091297e9fc482c8fcd0500145d089d64 /block.c
parent51de97605b183fe5a84f96f411cfc99ba6bbb6b1 (diff)
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> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6704 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'block.c')
-rw-r--r--block.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/block.c b/block.c
index 6bbc389ff0..e35c9a65aa 100644
--- a/block.c
+++ b/block.c
@@ -1134,6 +1134,16 @@ void bdrv_info_stats (void)
}
}
+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)
{