From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:47637) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UILzH-0001Ui-EU for qemu-devel@nongnu.org; Wed, 20 Mar 2013 12:35:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UILz7-00055C-TI for qemu-devel@nongnu.org; Wed, 20 Mar 2013 12:35:39 -0400 Received: from e32.co.us.ibm.com ([32.97.110.150]:50624) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UILz6-000556-RF for qemu-devel@nongnu.org; Wed, 20 Mar 2013 12:35:29 -0400 Received: from /spool/local by e32.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 20 Mar 2013 10:35:27 -0600 Received: from d03relay03.boulder.ibm.com (d03relay03.boulder.ibm.com [9.17.195.228]) by d03dlp03.boulder.ibm.com (Postfix) with ESMTP id 52F6B19D805E for ; Wed, 20 Mar 2013 10:34:56 -0600 (MDT) Received: from d03av01.boulder.ibm.com (d03av01.boulder.ibm.com [9.17.195.167]) by d03relay03.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r2KGYsUo024456 for ; Wed, 20 Mar 2013 10:34:56 -0600 Received: from d03av01.boulder.ibm.com (loopback [127.0.0.1]) by d03av01.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r2KGYrov031415 for ; Wed, 20 Mar 2013 10:34:53 -0600 From: Corey Bryant Date: Wed, 20 Mar 2013 12:34:48 -0400 Message-Id: <1363797289-5865-1-git-send-email-coreyb@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH 1/2] QMP: Remove duplicate TPM type from query-tpm List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Corey Bryant , stefanb@linux.vnet.ibm.com, armbru@redhat.com, lcapitulino@redhat.com Signed-off-by: Corey Bryant --- 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