qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Amarnath Valluri <amarnath.valluri@intel.com>, qemu-devel@nongnu.org
Cc: patrick.ohly@intel.com, marcandre.lureau@gmail.com,
	stefanb@linux.vnet.ibm.com, Markus Armbruster <armbru@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v3 5/8] tmp backend: Add new api to read backend TpmInfo
Date: Tue, 2 May 2017 08:35:24 -0500	[thread overview]
Message-ID: <0e67268f-46a0-c0c9-4a3b-0957bc387871@redhat.com> (raw)
In-Reply-To: <1493725969-19518-6-git-send-email-amarnath.valluri@intel.com>

[-- Attachment #1: Type: text/plain, Size: 3406 bytes --]

On 05/02/2017 06:52 AM, Amarnath Valluri wrote:
> TPM configuration options are backend implementation details and shall not be
> part of base TPMBackend object, and these shall not be accessed directly outside
> of the class, hence added a new interface method, get_tpm_options() to
> TPMDriverOps., which shall be implemented by the derived classes to return
> configured tpm options.
> 
> A new tpm backend api - tpm_backend_query_tpm() which uses _get_tpm_options() to
> prepare TpmInfo.
> 
> Made TPMPassthroughOptions type inherited from newly defined TPMOptions base type.
> The TPMOptions base type is intentionally left empty and supposed to be
> inherited by all backend implementations to define their tpm configuration
> options.
> 
> Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
> ---

> +++ b/qapi-schema.json
> @@ -5137,6 +5137,16 @@
>  { 'command': 'query-tpm-types', 'returns': ['TpmType'] }
>  
>  ##
> +# @TPMOptions:
> +#
> +# Base type for TPM options
> +#
> +# Since: 2.10
> +##
> +{ 'struct': 'TPMOptions',
> +  'data': { } }
> +
> +##
>  # @TPMPassthroughOptions:
>  #
>  # Information about the TPM passthrough type
> @@ -5148,20 +5158,9 @@
>  #
>  # Since: 1.5
>  ##
> -{ 'struct': 'TPMPassthroughOptions', 'data': { '*path' : 'str',
> -                                             '*cancel-path' : 'str'} }
> +{ 'struct': 'TPMPassthroughOptions', 'base': 'TPMOptions',
> +  'data': { '*path' : 'str', '*cancel-path' : 'str'} }
>  
> -##
> -# @TpmTypeOptions:
> -#
> -# A union referencing different TPM backend types' configuration options
> -#
> -# @type: 'passthrough' The configuration options for the TPM passthrough type
> -#
> -# Since: 1.5
> -##
> -{ 'union': 'TpmTypeOptions',
> -   'data': { 'passthrough' : 'TPMPassthroughOptions' } }

Getting rid of a simple union is nice.  However,

>  
>  ##
>  # @TPMInfo:
> @@ -5170,6 +5169,8 @@
>  #
>  # @id: The Id of the TPM
>  #
> +# @type: The TPM backend type
> +#
>  # @model: The TPM frontend model
>  #
>  # @options: The TPM (backend) type configuration options
> @@ -5178,8 +5179,9 @@
>  ##
>  { 'struct': 'TPMInfo',
>    'data': {'id': 'str',
> +           'type': 'TpmType',
>             'model': 'TpmModel',
> -           'options': 'TpmTypeOptions' } }
> +           'options': 'TPMOptions' } }
>  
>  ##
>  # @query-tpm:
> @@ -5196,13 +5198,12 @@
>  # <- { "return":
>  #      [
>  #        { "model": "tpm-tis",
> +#          "type": "passthrough",
>  #          "options":
> -#            { "type": "passthrough",
> -#              "data":
> -#                { "cancel-path": "/sys/class/misc/tpm0/device/cancel",
> -#                  "path": "/dev/tpm0"
> -#                }
> -#            },
> +#          {
> +#            "cancel-path": "/sys/class/misc/tpm0/device/cancel",
> +#            "path": "/dev/tpm0"
> +#          },
>  #          "id": "tpm0"

Doing it in a manner that is NOT backwards-compatible (as evidenced by
your change to the output text) is NOT good.  It will break any existing
client that was expecting to parse information in the old layout.

I'm afraid you're going to have to fix this to not break QMP wire
compatibility.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

  reply	other threads:[~2017-05-02 13:35 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-02 11:52 [Qemu-devel] [PATCH v3 0/8] Provide support for the software TPM emulator Amarnath Valluri
2017-05-02 11:52 ` [Qemu-devel] [PATCH v3 1/8] tpm-backend: Remove unneeded member variable from backend class Amarnath Valluri
2017-05-02 11:59   ` Marc-André Lureau
2017-05-02 11:52 ` [Qemu-devel] [PATCH v3 2/8] tpm-backend: Move thread handling inside TPMBackend Amarnath Valluri
2017-05-02 12:10   ` Marc-André Lureau
2017-05-02 11:52 ` [Qemu-devel] [PATCH v3 3/8] tpm-backend: Initialize and free data members in it's own methods Amarnath Valluri
2017-05-02 12:17   ` Marc-André Lureau
2017-05-02 11:52 ` [Qemu-devel] [PATCH v3 4/8] tpm-backend: Made few interface methods optional Amarnath Valluri
2017-05-02 12:29   ` Marc-André Lureau
2017-05-04  8:39     ` Amarnath Valluri
2017-05-04 11:06     ` [Qemu-devel] [PATCH v4 " Amarnath Valluri
2017-05-02 11:52 ` [Qemu-devel] [PATCH v3 5/8] tmp backend: Add new api to read backend TpmInfo Amarnath Valluri
2017-05-02 13:35   ` Eric Blake [this message]
2017-05-04  9:05     ` Amarnath Valluri
2017-05-04 11:17     ` [Qemu-devel] [PATCH v4 " Amarnath Valluri
2017-05-02 11:52 ` [Qemu-devel] [PATCH v3 6/8] tpm-backend: Move realloc_buffer() implementation to base class Amarnath Valluri
2017-05-02 15:54   ` Marc-André Lureau
2017-05-04  9:25     ` Amarnath Valluri
2017-05-04  9:32       ` Marc-André Lureau
2017-05-04 11:31         ` [Qemu-devel] [PATCH v4 6/8] tpm-backend: Move realloc_buffer() implementation to tpm-tis model Amarnath Valluri
2017-05-06 12:27           ` Marc-André Lureau
2017-05-02 11:52 ` [Qemu-devel] [PATCH v3 7/8] tpm-passthrough: move reusable code to utils Amarnath Valluri
2017-05-02 15:54   ` Marc-André Lureau
2017-05-02 11:52 ` [Qemu-devel] [PATCH v3 8/8] tpm: Added support for TPM emulator Amarnath Valluri
2017-05-02 16:05   ` Marc-André Lureau
2017-05-02 16:32     ` Stefan Berger
2017-05-02 16:58     ` Stefan Berger
2017-05-02 17:09       ` Marc-André Lureau
2017-05-02 17:19         ` Stefan Berger
2017-05-02 18:25           ` Patrick Ohly
2017-05-02 18:50             ` Marc-André Lureau
2017-05-02 19:35               ` Stefan Berger
2017-05-03  8:41                 ` Daniel P. Berrange
2017-05-03 11:17                   ` Dr. David Alan Gilbert
2017-05-03 11:24                     ` Marc-André Lureau
2017-05-03 11:29                       ` Daniel P. Berrange
2017-05-03 11:37                         ` Marc-André Lureau
2017-05-03 14:42                         ` Stefan Berger
2017-05-04  9:44                           ` Patrick Ohly
2017-05-04 11:08                             ` Stefan Berger
2017-05-02 12:25 ` [Qemu-devel] [PATCH v3 0/8] Provide support for the software " no-reply
2017-05-04 11:35   ` [Qemu-devel] [PATCH v4 8/8] tpm: Added support for " Amarnath Valluri
2017-05-04 12:28 ` [Qemu-devel] [PATCH v3 0/8] Provide support for the software " Stefan Berger
2017-05-05  6:52   ` Amarnath Valluri

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=0e67268f-46a0-c0c9-4a3b-0957bc387871@redhat.com \
    --to=eblake@redhat.com \
    --cc=amarnath.valluri@intel.com \
    --cc=armbru@redhat.com \
    --cc=marcandre.lureau@gmail.com \
    --cc=patrick.ohly@intel.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanb@linux.vnet.ibm.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).