summaryrefslogtreecommitdiff
path: root/qapi
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2018-02-05 14:59:05 +0100
committerKevin Wolf <kwolf@redhat.com>2018-03-09 15:17:47 +0100
commitec2f54182c5690387ba72a4acfcbdd961fcdcfc6 (patch)
treeef5b9e9f04c7c011c249350d5fecd3163644df53 /qapi
parent16e4bdb1bff83c41b73ed9c915d6bfc31d3e7ac8 (diff)
downloadqemu-ec2f54182c5690387ba72a4acfcbdd961fcdcfc6.tar.gz
ssh: QAPIfy host-key-check option
This makes the host-key-check option available in blockdev-add. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com>
Diffstat (limited to 'qapi')
-rw-r--r--qapi/block-core.json63
1 files changed, 61 insertions, 2 deletions
diff --git a/qapi/block-core.json b/qapi/block-core.json
index fd444421fc..4814bb7db7 100644
--- a/qapi/block-core.json
+++ b/qapi/block-core.json
@@ -2553,6 +2553,63 @@
'*encrypt': 'BlockdevQcow2Encryption' } }
##
+# @SshHostKeyCheckMode:
+#
+# @none Don't check the host key at all
+# @hash Compare the host key with a given hash
+# @known_hosts Check the host key against the known_hosts file
+#
+# Since: 2.12
+##
+{ 'enum': 'SshHostKeyCheckMode',
+ 'data': [ 'none', 'hash', 'known_hosts' ] }
+
+##
+# @SshHostKeyCheckHashType:
+#
+# @md5 The given hash is an md5 hash
+# @sha1 The given hash is an sha1 hash
+#
+# Since: 2.12
+##
+{ 'enum': 'SshHostKeyCheckHashType',
+ 'data': [ 'md5', 'sha1' ] }
+
+##
+# @SshHostKeyHash:
+#
+# @type The hash algorithm used for the hash
+# @hash The expected hash value
+#
+# Since: 2.12
+##
+{ 'struct': 'SshHostKeyHash',
+ 'data': { 'type': 'SshHostKeyCheckHashType',
+ 'hash': 'str' }}
+
+##
+# @SshHostKeyDummy:
+#
+# For those union branches that don't need additional fields.
+#
+# Since: 2.12
+##
+{ 'struct': 'SshHostKeyDummy',
+ 'data': {} }
+
+##
+# @SshHostKeyCheck:
+#
+# Since: 2.12
+##
+{ 'union': 'SshHostKeyCheck',
+ 'base': { 'mode': 'SshHostKeyCheckMode' },
+ 'discriminator': 'mode',
+ 'data': { 'none': 'SshHostKeyDummy',
+ 'hash': 'SshHostKeyHash',
+ 'known_hosts': 'SshHostKeyDummy' } }
+
+##
# @BlockdevOptionsSsh:
#
# @server: host address
@@ -2562,14 +2619,16 @@
# @user: user as which to connect, defaults to current
# local user name
#
-# TODO: Expose the host_key_check option in QMP
+# @host-key-check: Defines how and what to check the host key against
+# (default: known_hosts)
#
# Since: 2.9
##
{ 'struct': 'BlockdevOptionsSsh',
'data': { 'server': 'InetSocketAddress',
'path': 'str',
- '*user': 'str' } }
+ '*user': 'str',
+ '*host-key-check': 'SshHostKeyCheck' } }
##