[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 19/38] qapi/qom: Add ObjectOptions for secret*, deprecate 'loaded'
From: |
Kevin Wolf |
Subject: |
[PULL 19/38] qapi/qom: Add ObjectOptions for secret*, deprecate 'loaded' |
Date: |
Thu, 11 Mar 2021 15:47:52 +0100 |
This adds a QAPI schema for the properties of the secret* objects.
The 'loaded' property doesn't seem to make sense as an external
interface: It is automatically set to true in ucc->complete, and
explicitly setting it to true earlier just means that additional options
will be silently ignored.
In other words, the 'loaded' property is useless. Mark it as deprecated
in the schema from the start.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Acked-by: Peter Krempa <pkrempa@redhat.com>
Acked-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
---
qapi/crypto.json | 61 ++++++++++++++++++++++++++++++++++++++
qapi/qom.json | 5 ++++
docs/system/deprecated.rst | 11 +++++++
3 files changed, 77 insertions(+)
diff --git a/qapi/crypto.json b/qapi/crypto.json
index 2aebe6fa20..0fef3de66d 100644
--- a/qapi/crypto.json
+++ b/qapi/crypto.json
@@ -381,3 +381,64 @@
'discriminator': 'format',
'data': {
'luks': 'QCryptoBlockAmendOptionsLUKS' } }
+
+##
+# @SecretCommonProperties:
+#
+# Properties for objects of classes derived from secret-common.
+#
+# @loaded: if true, the secret is loaded immediately when applying this option
+# and will probably fail when processing the next option. Don't use;
+# only provided for compatibility. (default: false)
+#
+# @format: the data format that the secret is provided in (default: raw)
+#
+# @keyid: the name of another secret that should be used to decrypt the
+# provided data. If not present, the data is assumed to be unencrypted.
+#
+# @iv: the random initialization vector used for encryption of this particular
+# secret. Should be a base64 encrypted string of the 16-byte IV. Mandatory
+# if @keyid is given. Ignored if @keyid is absent.
+#
+# Features:
+# @deprecated: Member @loaded is deprecated. Setting true doesn't make sense,
+# and false is already the default.
+#
+# Since: 2.6
+##
+{ 'struct': 'SecretCommonProperties',
+ 'data': { '*loaded': { 'type': 'bool', 'features': ['deprecated'] },
+ '*format': 'QCryptoSecretFormat',
+ '*keyid': 'str',
+ '*iv': 'str' } }
+
+##
+# @SecretProperties:
+#
+# Properties for secret objects.
+#
+# Either @data or @file must be provided, but not both.
+#
+# @data: the associated with the secret from
+#
+# @file: the filename to load the data associated with the secret from
+#
+# Since: 2.6
+##
+{ 'struct': 'SecretProperties',
+ 'base': 'SecretCommonProperties',
+ 'data': { '*data': 'str',
+ '*file': 'str' } }
+
+##
+# @SecretKeyringProperties:
+#
+# Properties for secret_keyring objects.
+#
+# @serial: serial number that identifies a key to get from the kernel
+#
+# Since: 5.1
+##
+{ 'struct': 'SecretKeyringProperties',
+ 'base': 'SecretCommonProperties',
+ 'data': { 'serial': 'int32' } }
diff --git a/qapi/qom.json b/qapi/qom.json
index fa56083a0b..a9ab10c124 100644
--- a/qapi/qom.json
+++ b/qapi/qom.json
@@ -7,6 +7,7 @@
{ 'include': 'authz.json' }
{ 'include': 'block-core.json' }
{ 'include': 'common.json' }
+{ 'include': 'crypto.json' }
##
# = QEMU Object Model (QOM)
@@ -453,6 +454,8 @@
'rng-builtin',
'rng-egd',
'rng-random',
+ 'secret',
+ 'secret_keyring',
'throttle-group'
] }
@@ -489,6 +492,8 @@
'rng-builtin': 'RngProperties',
'rng-egd': 'RngEgdProperties',
'rng-random': 'RngRandomProperties',
+ 'secret': 'SecretProperties',
+ 'secret_keyring': 'SecretKeyringProperties',
'throttle-group': 'ThrottleGroupProperties'
} }
diff --git a/docs/system/deprecated.rst b/docs/system/deprecated.rst
index 3ce4fe7581..3e9e3a26f6 100644
--- a/docs/system/deprecated.rst
+++ b/docs/system/deprecated.rst
@@ -175,6 +175,17 @@ other options have been processed. This will either have
no effect (if
``opened`` was the last option) or cause errors. The property is therefore
useless and should not be specified.
+``loaded`` property of ``secret`` and ``secret_keyring`` objects (since 6.0.0)
+''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
+
+The only effect of specifying ``loaded=on`` in the command line or QMP
+``object-add`` is that the secret is loaded immediately, possibly before all
+other options have been processed. This will either have no effect (if
+``loaded`` was the last option) or cause options to be effectively ignored as
+if they were not given. The property is therefore useless and should not be
+specified.
+
+
QEMU Machine Protocol (QMP) commands
------------------------------------
--
2.29.2
- [PULL 09/38] vhost-user-blk-test: test discard/write zeroes invalid inputs, (continued)
- [PULL 09/38] vhost-user-blk-test: test discard/write zeroes invalid inputs, Kevin Wolf, 2021/03/11
- [PULL 10/38] tests: Drop 'props' from object-add calls, Kevin Wolf, 2021/03/11
- [PULL 12/38] qapi/qom: Add ObjectOptions for iothread, Kevin Wolf, 2021/03/11
- [PULL 11/38] qapi/qom: Drop deprecated 'props' from object-add, Kevin Wolf, 2021/03/11
- [PULL 15/38] qapi/qom: Add ObjectOptions for dbus-vmstate, Kevin Wolf, 2021/03/11
- [PULL 13/38] qapi/qom: Add ObjectOptions for authz-*, Kevin Wolf, 2021/03/11
- [PULL 14/38] qapi/qom: Add ObjectOptions for cryptodev-*, Kevin Wolf, 2021/03/11
- [PULL 18/38] qapi/qom: Add ObjectOptions for throttle-group, Kevin Wolf, 2021/03/11
- [PULL 16/38] qapi/qom: Add ObjectOptions for memory-backend-*, Kevin Wolf, 2021/03/11
- [PULL 07/38] test: new qTest case to test the vhost-user-blk-server, Kevin Wolf, 2021/03/11
- [PULL 19/38] qapi/qom: Add ObjectOptions for secret*, deprecate 'loaded',
Kevin Wolf <=
- [PULL 17/38] qapi/qom: Add ObjectOptions for rng-*, deprecate 'opened', Kevin Wolf, 2021/03/11
- [PULL 21/38] qapi/qom: Add ObjectOptions for can-*, Kevin Wolf, 2021/03/11
- [PULL 20/38] qapi/qom: Add ObjectOptions for tls-*, deprecate 'loaded', Kevin Wolf, 2021/03/11
- [PULL 24/38] qapi/qom: Add ObjectOptions for pr-manager-helper, Kevin Wolf, 2021/03/11
- [PULL 22/38] qapi/qom: Add ObjectOptions for colo-compare, Kevin Wolf, 2021/03/11
- [PULL 27/38] qapi/qom: Add ObjectOptions for x-remote-object, Kevin Wolf, 2021/03/11
- [PULL 23/38] qapi/qom: Add ObjectOptions for filter-*, Kevin Wolf, 2021/03/11
- [PULL 29/38] qom: Make "object" QemuOptsList optional, Kevin Wolf, 2021/03/11
- [PULL 32/38] qom: Factor out user_creatable_process_cmdline(), Kevin Wolf, 2021/03/11
- [PULL 31/38] qom: Remove user_creatable_add_dict(), Kevin Wolf, 2021/03/11