]> www.infradead.org Git - users/dwmw2/qemu.git/commitdiff
qmp: query-block: add 'encryption_key_missing' field
authorLuiz Capitulino <lcapitulino@redhat.com>
Thu, 26 Jul 2012 23:28:44 +0000 (20:28 -0300)
committerLuiz Capitulino <lcapitulino@redhat.com>
Mon, 13 Aug 2012 16:20:06 +0000 (13:20 -0300)
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
block.c
qapi-schema.json

diff --git a/block.c b/block.c
index 24323c11d0439039bebc166997d003a45b73892f..016858bf8c58accd6b8c938f3953d5c34481f2cc 100644 (file)
--- a/block.c
+++ b/block.c
@@ -2445,6 +2445,7 @@ BlockInfoList *qmp_query_block(Error **errp)
             info->value->inserted->ro = bs->read_only;
             info->value->inserted->drv = g_strdup(bs->drv->format_name);
             info->value->inserted->encrypted = bs->encrypted;
+            info->value->inserted->encryption_key_missing = bdrv_key_required(bs);
             if (bs->backing_file[0]) {
                 info->value->inserted->has_backing_file = true;
                 info->value->inserted->backing_file = g_strdup(bs->backing_file);
index bd9c450029c083006c13ea6b599ad262b79055ef..a62bf6867b32013b919a4307e968fc5264768a50 100644 (file)
 #
 # @encrypted: true if the backing device is encrypted
 #
+# @encryption_key_missing: true if the backing device is encrypted but an
+#                          valid encryption key is missing
+#
 # @bps: total throughput limit in bytes per second is specified
 #
 # @bps_rd: read throughput limit in bytes per second is specified
 { 'type': 'BlockDeviceInfo',
   'data': { 'file': 'str', 'ro': 'bool', 'drv': 'str',
             '*backing_file': 'str', 'backing_file_depth': 'int',
-            'encrypted': 'bool', 'bps': 'int', 'bps_rd': 'int',
-            'bps_wr': 'int', 'iops': 'int', 'iops_rd': 'int',
-            'iops_wr': 'int'} }
+            'encrypted': 'bool', 'encryption_key_missing': 'bool',
+            'bps': 'int', 'bps_rd': 'int', 'bps_wr': 'int',
+            'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int'} }
 
 ##
 # @BlockDeviceIoStatus: