From nobody Sun Feb 8 16:24:12 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1615222565; cv=none; d=zohomail.com; s=zohoarc; b=d3PPzI/Bt/bhKzCBWmwuhJM8HPW5UYTmjAGqUXAA/5LfOadIl+YtJ4bU1ywjuYJClbEP4zbOGL+kw3fLQGB6ZnYQBbnwEO0MB5zZH41Wm0unTVYNyWVWnIPAJME04zNnlhK5ncC+S8NxCE1T5cIBpwMz1DYByRzloOrdZ73+82A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1615222565; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=pN/jGMxLsOBcWUJpXUI7YE/gp07yl+wpd2gxHprRbOw=; b=JO77K4ldP3CpEgaJOy0Ln6fyp67zTeILmYwhUrsMM5znfQlW9O2CzyipBqLFdtQ7MvDmL8ZBxvgGSAweCduN7JRuUeUEcje+RtKt3OAiFakkz/KXoZ4Ug8ITtnRrX97o/bLj+t/uBbgVnrPpJXaudxHX95pAhO/JQEqhbixfqKU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1615222565505668.0829327614312; Mon, 8 Mar 2021 08:56:05 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-263-woZ90IyHPwato96kZPfrNA-1; Mon, 08 Mar 2021 11:56:02 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id AE27984BA68; Mon, 8 Mar 2021 16:55:55 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8A7035944F; Mon, 8 Mar 2021 16:55:55 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 5325557DC5; Mon, 8 Mar 2021 16:55:55 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 128GtsqC022770 for ; Mon, 8 Mar 2021 11:55:54 -0500 Received: by smtp.corp.redhat.com (Postfix) id A7E864278; Mon, 8 Mar 2021 16:55:54 +0000 (UTC) Received: from merkur.fritz.box (ovpn-112-100.ams2.redhat.com [10.36.112.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id D502A5D9DC; Mon, 8 Mar 2021 16:55:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1615222564; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=pN/jGMxLsOBcWUJpXUI7YE/gp07yl+wpd2gxHprRbOw=; b=XJkDEPNynCZs2P8ndZBdo2a+PtieoMC5BoRmjXs1JDFdsKzRPmVQEKNw0WlITi8M3wcs2+ PIXVnWMsSVFyqxt7mKp8A3FvkvvG24yktbLK9dzFC8G9W/Y3pHZXxf7mcjzWSQLNk3v1ez q+NIPaiRe4dpAE50wDz6UD2BxzS+0ww= X-MC-Unique: woZ90IyHPwato96kZPfrNA-1 From: Kevin Wolf To: qemu-devel@nongnu.org Subject: [PATCH v3 09/30] qapi/qom: Add ObjectOptions for secret*, deprecate 'loaded' Date: Mon, 8 Mar 2021 17:54:19 +0100 Message-Id: <20210308165440.386489-10-kwolf@redhat.com> In-Reply-To: <20210308165440.386489-1-kwolf@redhat.com> References: <20210308165440.386489-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Cc: kwolf@redhat.com, lvivier@redhat.com, thuth@redhat.com, pkrempa@redhat.com, ehabkost@redhat.com, qemu-block@nongnu.org, libvir-list@redhat.com, jasowang@redhat.com, mreitz@redhat.com, kraxel@redhat.com, pbonzini@redhat.com, dgilbert@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" 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 Acked-by: Peter Krempa Reviewed-by: Eric Blake Acked-by: Daniel P. Berrang=C3=A9 --- 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 op= tion +# and will probably fail when processing the next option. Don't u= se; +# 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 unencry= pted. +# +# @iv: the random initialization vector used for encryption of this partic= ular +# secret. Should be a base64 encrypted string of the 16-byte IV. Mand= atory +# if @keyid is given. Ignored if @keyid is absent. +# +# Features: +# @deprecated: Member @loaded is deprecated. Setting true doesn't make se= nse, +# 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' } =20 ## # =3D QEMU Object Model (QOM) @@ -451,6 +452,8 @@ 'rng-builtin', 'rng-egd', 'rng-random', + 'secret', + 'secret_keyring', 'throttle-group' ] } =20 @@ -487,6 +490,8 @@ 'rng-builtin': 'RngProperties', 'rng-egd': 'RngEgdProperties', 'rng-random': 'RngRandomProperties', + 'secret': 'SecretProperties', + 'secret_keyring': 'SecretKeyringProperties', 'throttle-group': 'ThrottleGroupProperties' } } =20 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 h= ave no effect (if ``opened`` was the last option) or cause errors. The property is therefore useless and should not be specified. =20 +``loaded`` property of ``secret`` and ``secret_keyring`` objects (since 6.= 0.0) +''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''= '''' + +The only effect of specifying ``loaded=3Don`` in the command line or QMP +``object-add`` is that the secret is loaded immediately, possibly before a= ll +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 ------------------------------------ =20 --=20 2.29.2