All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 1/2] QMP: Remove duplicate TPM type from query-tpm
@ 2013-03-20 16:34 Corey Bryant
  2013-03-20 16:34 ` [Qemu-devel] [PATCH 2/2] QMP: TPM QMP and man page documentation updates Corey Bryant
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Corey Bryant @ 2013-03-20 16:34 UTC (permalink / raw)
  To: qemu-devel; +Cc: Corey Bryant, stefanb, armbru, lcapitulino


Signed-off-by: Corey Bryant <coreyb@linux.vnet.ibm.com>
---
 hmp.c            |    8 ++++----
 qapi-schema.json |   12 ++++--------
 tpm/tpm.c        |    9 ++++-----
 3 files changed, 12 insertions(+), 17 deletions(-)

diff --git a/hmp.c b/hmp.c
index b0a861c..d319897 100644
--- a/hmp.c
+++ b/hmp.c
@@ -631,11 +631,11 @@ void hmp_info_tpm(Monitor *mon, const QDict *qdict)
                        c, TpmModel_lookup[ti->model]);
 
         monitor_printf(mon, "  \\ %s: type=%s",
-                       ti->id, TpmType_lookup[ti->type]);
+                       ti->id, TpmTypeOptionsKind_lookup[ti->options->kind]);
 
-        switch (ti->tpm_options->kind) {
-        case TPM_TYPE_OPTIONS_KIND_TPM_PASSTHROUGH_OPTIONS:
-            tpo = ti->tpm_options->tpm_passthrough_options;
+        switch (ti->options->kind) {
+        case TPM_TYPE_OPTIONS_KIND_PASSTHROUGH:
+            tpo = ti->options->passthrough;
             monitor_printf(mon, "%s%s%s%s",
                            tpo->has_path ? ",path=" : "",
                            tpo->has_path ? tpo->path : "",
diff --git a/qapi-schema.json b/qapi-schema.json
index fdaa9da..5505bbf 100644
--- a/qapi-schema.json
+++ b/qapi-schema.json
@@ -3403,13 +3403,12 @@
 #
 # A union referencing different TPM backend types' configuration options
 #
-# @tpm-passthough-options: TPMPassthroughOptions describing the TPM
-#                          passthrough configuration options
+# @passthough: The configuration options for the TPM passthrough type
 #
 # Since: 1.5
 ##
 { 'union': 'TpmTypeOptions',
-   'data': { 'tpm-passthrough-options' : 'TPMPassthroughOptions' } }
+   'data': { 'passthrough' : 'TPMPassthroughOptions' } }
 
 ##
 # @TpmInfo:
@@ -3420,17 +3419,14 @@
 #
 # @model: The TPM frontend model
 #
-# @type: The TPM (backend) type being used
-#
-# @tpm-options: The TPM (backend) type configuration options
+# @options: The TPM (backend) type configuration options
 #
 # Since: 1.5
 ##
 { 'type': 'TPMInfo',
   'data': {'id': 'str',
            'model': 'TpmModel',
-           'type': 'TpmType',
-           'tpm-options': 'TpmTypeOptions' } }
+           'options': 'TpmTypeOptions' } }
 
 ##
 # @query-tpm:
diff --git a/tpm/tpm.c b/tpm/tpm.c
index ffd2495..ae00eae 100644
--- a/tpm/tpm.c
+++ b/tpm/tpm.c
@@ -257,14 +257,13 @@ static TPMInfo *qmp_query_tpm_inst(TPMBackend *drv)
 
     res->id = g_strdup(drv->id);
     res->model = drv->fe_model;
-    res->type = drv->ops->type;
-    res->tpm_options = g_new0(TpmTypeOptions, 1);
+    res->options = g_new0(TpmTypeOptions, 1);
 
-    switch (res->type) {
+    switch (drv->ops->type) {
     case TPM_TYPE_PASSTHROUGH:
-        res->tpm_options->kind = TPM_TYPE_OPTIONS_KIND_TPM_PASSTHROUGH_OPTIONS;
+        res->options->kind = TPM_TYPE_OPTIONS_KIND_PASSTHROUGH;
         tpo = g_new0(TPMPassthroughOptions, 1);
-        res->tpm_options->tpm_passthrough_options = tpo;
+        res->options->passthrough = tpo;
         if (drv->path) {
             tpo->path = g_strdup(drv->path);
             tpo->has_path = true;
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [Qemu-devel] [PATCH 2/2] QMP: TPM QMP and man page documentation updates
  2013-03-20 16:34 [Qemu-devel] [PATCH 1/2] QMP: Remove duplicate TPM type from query-tpm Corey Bryant
@ 2013-03-20 16:34 ` Corey Bryant
  2013-03-20 21:39   ` Eric Blake
  2013-03-21  7:21   ` Markus Armbruster
  2013-03-20 21:37 ` [Qemu-devel] [PATCH 1/2] QMP: Remove duplicate TPM type from query-tpm Eric Blake
                   ` (2 subsequent siblings)
  3 siblings, 2 replies; 7+ messages in thread
From: Corey Bryant @ 2013-03-20 16:34 UTC (permalink / raw)
  To: qemu-devel; +Cc: Corey Bryant, stefanb, armbru, lcapitulino


Signed-off-by: Corey Bryant <coreyb@linux.vnet.ibm.com>
---
 qemu-options.hx |    3 +-
 qmp-commands.hx |   58 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 60 insertions(+), 1 deletions(-)

diff --git a/qemu-options.hx b/qemu-options.hx
index 06dd565..b4e3a2d 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -2241,7 +2241,8 @@ Backend type must be:
 @option{passthrough}.
 
 The specific backend type will determine the applicable options.
-The @code{-tpmdev} option requires a @code{-device} option.
+The @code{-tpmdev} option creates the TPM backend and requires a
+@code{-device} option that specifies the TPM frontend interface model.
 
 Options to each backend are described below.
 
diff --git a/qmp-commands.hx b/qmp-commands.hx
index b370060..3aa6bd1 100644
--- a/qmp-commands.hx
+++ b/qmp-commands.hx
@@ -2721,18 +2721,76 @@ EQMP
         .mhandler.cmd_new = qmp_marshal_input_query_tpm,
     },
 
+SQMP
+query-tpm
+---------
+
+Return information about the TPM device.
+
+Arguments: None
+
+Example:
+
+-> { "execute": "query-tpm" }
+<- { "return":
+     [
+       { "model": "tpm-tis",
+         "options":
+           { "type": "passthrough",
+             "data":
+               { "cancel-path": "/sys/class/misc/tpm0/device/cancel",
+                 "path": "/dev/tpm0"
+               }
+           },
+         "id": "tpm0"
+       }
+     ]
+   }
+
+EQMP
+
     {
         .name       = "query-tpm-models",
         .args_type  = "",
         .mhandler.cmd_new = qmp_marshal_input_query_tpm_models,
     },
 
+SQMP
+query-tpm-models
+----------------
+
+Return a list of supported TPM models.
+
+Arguments: None
+
+Example:
+
+-> { "execute": "query-tpm-models" }
+<- { "return": [ "tpm-tis" ] }
+
+EQMP
+
     {
         .name       = "query-tpm-types",
         .args_type  = "",
         .mhandler.cmd_new = qmp_marshal_input_query_tpm_types,
     },
 
+SQMP
+query-tpm-types
+---------------
+
+Return a list of supported TPM types.
+
+Arguments: None
+
+Example:
+
+-> { "execute": "query-tpm-types" }
+<- { "return": [ "passthrough" ] }
+
+EQMP
+
     {
         .name       = "chardev-add",
         .args_type  = "id:s,backend:q",
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [PATCH 1/2] QMP: Remove duplicate TPM type from query-tpm
  2013-03-20 16:34 [Qemu-devel] [PATCH 1/2] QMP: Remove duplicate TPM type from query-tpm Corey Bryant
  2013-03-20 16:34 ` [Qemu-devel] [PATCH 2/2] QMP: TPM QMP and man page documentation updates Corey Bryant
@ 2013-03-20 21:37 ` Eric Blake
  2013-03-21  7:19 ` Markus Armbruster
  2013-03-21 12:25 ` Luiz Capitulino
  3 siblings, 0 replies; 7+ messages in thread
From: Eric Blake @ 2013-03-20 21:37 UTC (permalink / raw)
  To: Corey Bryant; +Cc: armbru, lcapitulino, qemu-devel, stefanb

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

On 03/20/2013 10:34 AM, Corey Bryant wrote:
> Signed-off-by: Corey Bryant <coreyb@linux.vnet.ibm.com>
> ---
>  hmp.c            |    8 ++++----
>  qapi-schema.json |   12 ++++--------
>  tpm/tpm.c        |    9 ++++-----
>  3 files changed, 12 insertions(+), 17 deletions(-)

Reviewed-by: Eric Blake <eblake@redhat.com>

Safe to do now, because 1.5 isn't released; and advisable to take before
we calcify an interface we don't like.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [PATCH 2/2] QMP: TPM QMP and man page documentation updates
  2013-03-20 16:34 ` [Qemu-devel] [PATCH 2/2] QMP: TPM QMP and man page documentation updates Corey Bryant
@ 2013-03-20 21:39   ` Eric Blake
  2013-03-21  7:21   ` Markus Armbruster
  1 sibling, 0 replies; 7+ messages in thread
From: Eric Blake @ 2013-03-20 21:39 UTC (permalink / raw)
  To: Corey Bryant; +Cc: armbru, lcapitulino, qemu-devel, stefanb

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

On 03/20/2013 10:34 AM, Corey Bryant wrote:
> Signed-off-by: Corey Bryant <coreyb@linux.vnet.ibm.com>
> ---
>  qemu-options.hx |    3 +-
>  qmp-commands.hx |   58 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 60 insertions(+), 1 deletions(-)

Reviewed-by: Eric Blake <eblake@redhat.com>

[No cover letter meant I had to answer each mail, instead of doing a
series review message on 0/2.]

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [PATCH 1/2] QMP: Remove duplicate TPM type from query-tpm
  2013-03-20 16:34 [Qemu-devel] [PATCH 1/2] QMP: Remove duplicate TPM type from query-tpm Corey Bryant
  2013-03-20 16:34 ` [Qemu-devel] [PATCH 2/2] QMP: TPM QMP and man page documentation updates Corey Bryant
  2013-03-20 21:37 ` [Qemu-devel] [PATCH 1/2] QMP: Remove duplicate TPM type from query-tpm Eric Blake
@ 2013-03-21  7:19 ` Markus Armbruster
  2013-03-21 12:25 ` Luiz Capitulino
  3 siblings, 0 replies; 7+ messages in thread
From: Markus Armbruster @ 2013-03-21  7:19 UTC (permalink / raw)
  To: Corey Bryant; +Cc: lcapitulino, qemu-devel, stefanb

Corey Bryant <coreyb@linux.vnet.ibm.com> writes:

> Signed-off-by: Corey Bryant <coreyb@linux.vnet.ibm.com>
> ---
>  hmp.c            |    8 ++++----
>  qapi-schema.json |   12 ++++--------
>  tpm/tpm.c        |    9 ++++-----
>  3 files changed, 12 insertions(+), 17 deletions(-)
>
> diff --git a/hmp.c b/hmp.c
> index b0a861c..d319897 100644
> --- a/hmp.c
> +++ b/hmp.c
> @@ -631,11 +631,11 @@ void hmp_info_tpm(Monitor *mon, const QDict *qdict)
>                         c, TpmModel_lookup[ti->model]);
>  
>          monitor_printf(mon, "  \\ %s: type=%s",
> -                       ti->id, TpmType_lookup[ti->type]);
> +                       ti->id, TpmTypeOptionsKind_lookup[ti->options->kind]);
>  
> -        switch (ti->tpm_options->kind) {
> -        case TPM_TYPE_OPTIONS_KIND_TPM_PASSTHROUGH_OPTIONS:
> -            tpo = ti->tpm_options->tpm_passthrough_options;
> +        switch (ti->options->kind) {
> +        case TPM_TYPE_OPTIONS_KIND_PASSTHROUGH:
> +            tpo = ti->options->passthrough;
>              monitor_printf(mon, "%s%s%s%s",
>                             tpo->has_path ? ",path=" : "",
>                             tpo->has_path ? tpo->path : "",
> diff --git a/qapi-schema.json b/qapi-schema.json
> index fdaa9da..5505bbf 100644
> --- a/qapi-schema.json
> +++ b/qapi-schema.json
> @@ -3403,13 +3403,12 @@
>  #
>  # A union referencing different TPM backend types' configuration options
>  #
> -# @tpm-passthough-options: TPMPassthroughOptions describing the TPM
> -#                          passthrough configuration options
> +# @passthough: The configuration options for the TPM passthrough type

s/passthough/passthrough/

>  #
>  # Since: 1.5
>  ##
>  { 'union': 'TpmTypeOptions',
> -   'data': { 'tpm-passthrough-options' : 'TPMPassthroughOptions' } }
> +   'data': { 'passthrough' : 'TPMPassthroughOptions' } }
>  
>  ##
>  # @TpmInfo:
> @@ -3420,17 +3419,14 @@
>  #
>  # @model: The TPM frontend model
>  #
> -# @type: The TPM (backend) type being used
> -#
> -# @tpm-options: The TPM (backend) type configuration options
> +# @options: The TPM (backend) type configuration options
>  #
>  # Since: 1.5
>  ##
>  { 'type': 'TPMInfo',
>    'data': {'id': 'str',
>             'model': 'TpmModel',
> -           'type': 'TpmType',
> -           'tpm-options': 'TpmTypeOptions' } }
> +           'options': 'TpmTypeOptions' } }
>  

Shortening to just 'options' is a good idea.

>  ##
>  # @query-tpm:
> diff --git a/tpm/tpm.c b/tpm/tpm.c
> index ffd2495..ae00eae 100644
> --- a/tpm/tpm.c
> +++ b/tpm/tpm.c
> @@ -257,14 +257,13 @@ static TPMInfo *qmp_query_tpm_inst(TPMBackend *drv)
>  
>      res->id = g_strdup(drv->id);
>      res->model = drv->fe_model;
> -    res->type = drv->ops->type;
> -    res->tpm_options = g_new0(TpmTypeOptions, 1);
> +    res->options = g_new0(TpmTypeOptions, 1);
>  
> -    switch (res->type) {
> +    switch (drv->ops->type) {
>      case TPM_TYPE_PASSTHROUGH:
> -        res->tpm_options->kind = TPM_TYPE_OPTIONS_KIND_TPM_PASSTHROUGH_OPTIONS;
> +        res->options->kind = TPM_TYPE_OPTIONS_KIND_PASSTHROUGH;
>          tpo = g_new0(TPMPassthroughOptions, 1);
> -        res->tpm_options->tpm_passthrough_options = tpo;
> +        res->options->passthrough = tpo;
>          if (drv->path) {
>              tpo->path = g_strdup(drv->path);
>              tpo->has_path = true;

Luiz, if you fix the passthrough typo on commit, you can add my
Reviewed-by.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [PATCH 2/2] QMP: TPM QMP and man page documentation updates
  2013-03-20 16:34 ` [Qemu-devel] [PATCH 2/2] QMP: TPM QMP and man page documentation updates Corey Bryant
  2013-03-20 21:39   ` Eric Blake
@ 2013-03-21  7:21   ` Markus Armbruster
  1 sibling, 0 replies; 7+ messages in thread
From: Markus Armbruster @ 2013-03-21  7:21 UTC (permalink / raw)
  To: Corey Bryant; +Cc: lcapitulino, qemu-devel, stefanb

Corey Bryant <coreyb@linux.vnet.ibm.com> writes:

> Signed-off-by: Corey Bryant <coreyb@linux.vnet.ibm.com>

Reviewed-by: Markus Armbruster <armbru@redhat.com>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [PATCH 1/2] QMP: Remove duplicate TPM type from query-tpm
  2013-03-20 16:34 [Qemu-devel] [PATCH 1/2] QMP: Remove duplicate TPM type from query-tpm Corey Bryant
                   ` (2 preceding siblings ...)
  2013-03-21  7:19 ` Markus Armbruster
@ 2013-03-21 12:25 ` Luiz Capitulino
  3 siblings, 0 replies; 7+ messages in thread
From: Luiz Capitulino @ 2013-03-21 12:25 UTC (permalink / raw)
  To: Corey Bryant; +Cc: stefanb, qemu-devel, armbru

On Wed, 20 Mar 2013 12:34:48 -0400
Corey Bryant <coreyb@linux.vnet.ibm.com> wrote:

> 
> Signed-off-by: Corey Bryant <coreyb@linux.vnet.ibm.com>

Applied both patches to the qmp branch 'passthough' typo fix as
spotted by Markus.

Thanks.

> ---
>  hmp.c            |    8 ++++----
>  qapi-schema.json |   12 ++++--------
>  tpm/tpm.c        |    9 ++++-----
>  3 files changed, 12 insertions(+), 17 deletions(-)
> 
> diff --git a/hmp.c b/hmp.c
> index b0a861c..d319897 100644
> --- a/hmp.c
> +++ b/hmp.c
> @@ -631,11 +631,11 @@ void hmp_info_tpm(Monitor *mon, const QDict *qdict)
>                         c, TpmModel_lookup[ti->model]);
>  
>          monitor_printf(mon, "  \\ %s: type=%s",
> -                       ti->id, TpmType_lookup[ti->type]);
> +                       ti->id, TpmTypeOptionsKind_lookup[ti->options->kind]);
>  
> -        switch (ti->tpm_options->kind) {
> -        case TPM_TYPE_OPTIONS_KIND_TPM_PASSTHROUGH_OPTIONS:
> -            tpo = ti->tpm_options->tpm_passthrough_options;
> +        switch (ti->options->kind) {
> +        case TPM_TYPE_OPTIONS_KIND_PASSTHROUGH:
> +            tpo = ti->options->passthrough;
>              monitor_printf(mon, "%s%s%s%s",
>                             tpo->has_path ? ",path=" : "",
>                             tpo->has_path ? tpo->path : "",
> diff --git a/qapi-schema.json b/qapi-schema.json
> index fdaa9da..5505bbf 100644
> --- a/qapi-schema.json
> +++ b/qapi-schema.json
> @@ -3403,13 +3403,12 @@
>  #
>  # A union referencing different TPM backend types' configuration options
>  #
> -# @tpm-passthough-options: TPMPassthroughOptions describing the TPM
> -#                          passthrough configuration options
> +# @passthough: The configuration options for the TPM passthrough type
>  #
>  # Since: 1.5
>  ##
>  { 'union': 'TpmTypeOptions',
> -   'data': { 'tpm-passthrough-options' : 'TPMPassthroughOptions' } }
> +   'data': { 'passthrough' : 'TPMPassthroughOptions' } }
>  
>  ##
>  # @TpmInfo:
> @@ -3420,17 +3419,14 @@
>  #
>  # @model: The TPM frontend model
>  #
> -# @type: The TPM (backend) type being used
> -#
> -# @tpm-options: The TPM (backend) type configuration options
> +# @options: The TPM (backend) type configuration options
>  #
>  # Since: 1.5
>  ##
>  { 'type': 'TPMInfo',
>    'data': {'id': 'str',
>             'model': 'TpmModel',
> -           'type': 'TpmType',
> -           'tpm-options': 'TpmTypeOptions' } }
> +           'options': 'TpmTypeOptions' } }
>  
>  ##
>  # @query-tpm:
> diff --git a/tpm/tpm.c b/tpm/tpm.c
> index ffd2495..ae00eae 100644
> --- a/tpm/tpm.c
> +++ b/tpm/tpm.c
> @@ -257,14 +257,13 @@ static TPMInfo *qmp_query_tpm_inst(TPMBackend *drv)
>  
>      res->id = g_strdup(drv->id);
>      res->model = drv->fe_model;
> -    res->type = drv->ops->type;
> -    res->tpm_options = g_new0(TpmTypeOptions, 1);
> +    res->options = g_new0(TpmTypeOptions, 1);
>  
> -    switch (res->type) {
> +    switch (drv->ops->type) {
>      case TPM_TYPE_PASSTHROUGH:
> -        res->tpm_options->kind = TPM_TYPE_OPTIONS_KIND_TPM_PASSTHROUGH_OPTIONS;
> +        res->options->kind = TPM_TYPE_OPTIONS_KIND_PASSTHROUGH;
>          tpo = g_new0(TPMPassthroughOptions, 1);
> -        res->tpm_options->tpm_passthrough_options = tpo;
> +        res->options->passthrough = tpo;
>          if (drv->path) {
>              tpo->path = g_strdup(drv->path);
>              tpo->has_path = true;

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2013-03-21 12:25 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-20 16:34 [Qemu-devel] [PATCH 1/2] QMP: Remove duplicate TPM type from query-tpm Corey Bryant
2013-03-20 16:34 ` [Qemu-devel] [PATCH 2/2] QMP: TPM QMP and man page documentation updates Corey Bryant
2013-03-20 21:39   ` Eric Blake
2013-03-21  7:21   ` Markus Armbruster
2013-03-20 21:37 ` [Qemu-devel] [PATCH 1/2] QMP: Remove duplicate TPM type from query-tpm Eric Blake
2013-03-21  7:19 ` Markus Armbruster
2013-03-21 12:25 ` Luiz Capitulino

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.