All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: qemu-devel@nongnu.org
Cc: kwolf@redhat.com, lvivier@redhat.com, thuth@redhat.com,
	pkrempa@redhat.com, berrange@redhat.com, ehabkost@redhat.com,
	qemu-block@nongnu.org, libvir-list@redhat.com,
	jasowang@redhat.com, armbru@redhat.com, mreitz@redhat.com,
	kraxel@redhat.com, pbonzini@redhat.com, dgilbert@redhat.com
Subject: [PATCH v3 09/30] qapi/qom: Add ObjectOptions for secret*, deprecate 'loaded'
Date: Mon,  8 Mar 2021 17:54:19 +0100	[thread overview]
Message-ID: <20210308165440.386489-10-kwolf@redhat.com> (raw)
In-Reply-To: <20210308165440.386489-1-kwolf@redhat.com>

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: Peter Krempa <pkrempa@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 0721a636f9..e4bbddd986 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)
@@ -451,6 +452,8 @@
     'rng-builtin',
     'rng-egd',
     'rng-random',
+    'secret',
+    'secret_keyring',
     'throttle-group'
   ] }
 
@@ -487,6 +490,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 3dac79f600..f4e8226963 100644
--- a/docs/system/deprecated.rst
+++ b/docs/system/deprecated.rst
@@ -162,6 +162,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



  parent reply	other threads:[~2021-03-08 17:10 UTC|newest]

Thread overview: 78+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-08 16:54 [PATCH v3 00/30] qapi/qom: QAPIfy --object and object-add Kevin Wolf
2021-03-08 16:54 ` [PATCH v3 01/30] qapi/qom: Drop deprecated 'props' from object-add Kevin Wolf
2021-03-08 16:54 ` [PATCH v3 02/30] qapi/qom: Add ObjectOptions for iothread Kevin Wolf
2021-03-08 16:54 ` [PATCH v3 03/30] qapi/qom: Add ObjectOptions for authz-* Kevin Wolf
2021-03-09  9:17   ` Daniel P. Berrangé
2021-03-08 16:54 ` [PATCH v3 04/30] qapi/qom: Add ObjectOptions for cryptodev-* Kevin Wolf
2021-03-08 19:23   ` Eric Blake
2021-03-08 16:54 ` [PATCH v3 05/30] qapi/qom: Add ObjectOptions for dbus-vmstate Kevin Wolf
2021-03-08 16:54 ` [PATCH v3 06/30] qapi/qom: Add ObjectOptions for memory-backend-* Kevin Wolf
2021-03-08 19:25   ` Eric Blake
2021-03-08 16:54 ` [PATCH v3 07/30] qapi/qom: Add ObjectOptions for rng-*, deprecate 'opened' Kevin Wolf
2021-03-08 16:54 ` [PATCH v3 08/30] qapi/qom: Add ObjectOptions for throttle-group Kevin Wolf
2021-03-08 16:54 ` Kevin Wolf [this message]
2021-03-09  9:21   ` [PATCH v3 09/30] qapi/qom: Add ObjectOptions for secret*, deprecate 'loaded' Daniel P. Berrangé
2021-03-08 16:54 ` [PATCH v3 10/30] qapi/qom: Add ObjectOptions for tls-*, " Kevin Wolf
2021-03-09  9:23   ` Daniel P. Berrangé
2021-03-08 16:54 ` [PATCH v3 11/30] qapi/qom: Add ObjectOptions for can-* Kevin Wolf
2021-03-08 16:54 ` [PATCH v3 12/30] qapi/qom: Add ObjectOptions for colo-compare Kevin Wolf
2021-03-08 16:54 ` [PATCH v3 13/30] qapi/qom: Add ObjectOptions for filter-* Kevin Wolf
2021-03-08 16:54 ` [PATCH v3 14/30] qapi/qom: Add ObjectOptions for pr-manager-helper Kevin Wolf
2021-03-08 16:54 ` [PATCH v3 15/30] qapi/qom: Add ObjectOptions for confidential-guest-support Kevin Wolf
2021-03-08 16:54 ` [PATCH v3 16/30] qapi/qom: Add ObjectOptions for input-* Kevin Wolf
2021-03-08 16:54 ` [PATCH v3 17/30] qapi/qom: Add ObjectOptions for x-remote-object Kevin Wolf
2021-03-08 16:54 ` [PATCH v3 18/30] qapi/qom: QAPIfy object-add Kevin Wolf
2021-03-08 16:54 ` [PATCH v3 19/30] qom: Make "object" QemuOptsList optional Kevin Wolf
2021-03-08 16:54 ` [PATCH v3 20/30] qemu-storage-daemon: Implement --object with qmp_object_add() Kevin Wolf
2021-03-08 16:54 ` [PATCH v3 21/30] qom: Remove user_creatable_add_dict() Kevin Wolf
2021-03-08 16:54 ` [PATCH v3 22/30] qom: Factor out user_creatable_process_cmdline() Kevin Wolf
2021-03-13  8:41   ` Markus Armbruster
2021-03-13  9:28     ` Paolo Bonzini
2021-03-15 11:48     ` Kevin Wolf
2021-03-08 16:54 ` [PATCH v3 23/30] qemu-io: Use user_creatable_process_cmdline() for --object Kevin Wolf
2021-03-08 16:54 ` [PATCH v3 24/30] qemu-nbd: " Kevin Wolf
2021-03-08 16:54 ` [PATCH v3 25/30] qom: Add user_creatable_add_from_str() Kevin Wolf
2021-03-08 16:54 ` [PATCH v3 26/30] qemu-img: Use user_creatable_process_cmdline() for --object Kevin Wolf
2021-03-08 19:32   ` Eric Blake
2021-03-13  7:40   ` Markus Armbruster
2021-03-13  7:47     ` Paolo Bonzini
2021-03-13 12:30       ` Markus Armbruster
2021-03-15 11:38         ` Kevin Wolf
2021-03-15 14:15           ` Markus Armbruster
2021-03-15 14:43             ` Kevin Wolf
2021-03-08 16:54 ` [PATCH v3 27/30] hmp: QAPIfy object_add Kevin Wolf
2021-03-13 13:28   ` Markus Armbruster
2021-03-13 14:11     ` Paolo Bonzini
2021-03-15  9:39       ` Markus Armbruster
2021-03-15 11:09         ` Kevin Wolf
2021-03-15 11:38           ` Dr. David Alan Gilbert
2021-03-15 11:58             ` Paolo Bonzini
2021-03-08 16:54 ` [PATCH v3 28/30] qom: Add user_creatable_parse_str() Kevin Wolf
2021-03-08 16:54 ` [PATCH v3 29/30] vl: QAPIfy -object Kevin Wolf
2021-03-08 19:34   ` Eric Blake
2021-03-08 16:54 ` [PATCH v3 30/30] qom: Drop QemuOpts based interfaces Kevin Wolf
2021-03-10 14:22 ` [PATCH v3 00/30] qapi/qom: QAPIfy --object and object-add Peter Krempa
2021-03-10 14:31   ` Paolo Bonzini
2021-03-10 14:48     ` Peter Krempa
2021-03-10 17:30     ` Kevin Wolf
2021-03-11  7:47       ` Peter Krempa
2021-03-11  8:16         ` Paolo Bonzini
2021-03-11  8:37         ` Kevin Wolf
2021-03-11 11:24           ` Peter Krempa
2021-03-11 11:41             ` Kevin Wolf
2021-03-11 12:29               ` Peter Krempa
2021-03-11 14:01               ` Markus Armbruster
2021-03-11  8:14       ` Paolo Bonzini
2021-03-11  8:45         ` Kevin Wolf
2021-03-11  8:49           ` Paolo Bonzini
2021-03-11 10:38       ` Markus Armbruster
2021-03-11 11:00         ` Paolo Bonzini
2021-03-11 14:08           ` Markus Armbruster
2021-03-11 17:50             ` Paolo Bonzini
2021-03-12  8:14               ` Markus Armbruster
2021-03-12  8:46                 ` Paolo Bonzini
2021-03-12  8:52                   ` Peter Krempa
2021-03-13 13:40                 ` Markus Armbruster
2021-03-15 11:36                   ` Kevin Wolf
2021-03-15 15:26                     ` Markus Armbruster
2021-03-15 15:52                       ` Kevin Wolf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210308165440.386489-10-kwolf@redhat.com \
    --to=kwolf@redhat.com \
    --cc=armbru@redhat.com \
    --cc=berrange@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=jasowang@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=libvir-list@redhat.com \
    --cc=lvivier@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=pkrempa@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.