From patchwork Tue Mar 26 12:38:43 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luiz Capitulino X-Patchwork-Id: 231189 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id E62542C0079 for ; Tue, 26 Mar 2013 23:39:39 +1100 (EST) Received: from localhost ([::1]:57220 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UKTAA-0001qW-30 for incoming@patchwork.ozlabs.org; Tue, 26 Mar 2013 08:39:38 -0400 Received: from eggs.gnu.org ([208.118.235.92]:38322) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UKT9R-0001Vk-VJ for qemu-devel@nongnu.org; Tue, 26 Mar 2013 08:38:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UKT9Q-0002Cv-1Y for qemu-devel@nongnu.org; Tue, 26 Mar 2013 08:38:53 -0400 Received: from mx1.redhat.com ([209.132.183.28]:17038) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UKT9P-0002Ck-Q1 for qemu-devel@nongnu.org; Tue, 26 Mar 2013 08:38:51 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r2QCcpNF032585 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 26 Mar 2013 08:38:51 -0400 Received: from localhost (ovpn-113-125.phx2.redhat.com [10.3.113.125]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r2QCcoj0015549; Tue, 26 Mar 2013 08:38:50 -0400 From: Luiz Capitulino To: qemu-devel@nongnu.org Date: Tue, 26 Mar 2013 08:38:43 -0400 Message-Id: <1364301526-11431-2-git-send-email-lcapitulino@redhat.com> In-Reply-To: <1364301526-11431-1-git-send-email-lcapitulino@redhat.com> References: <1364301526-11431-1-git-send-email-lcapitulino@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: aliguori@us.ibm.com Subject: [Qemu-devel] [PULL 1/4] QMP: Remove duplicate TPM type from query-tpm X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Corey Bryant Signed-off-by: Corey Bryant Reviewed-by: Eric Blake Reviewed-by: Markus Armbruster Signed-off-by: Luiz Capitulino --- 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 088f4e1..0d16d14 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 +# @passthrough: 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;