QMP: Remove duplicate TPM type from query-tpm
Signed-off-by: Corey Bryant <coreyb@linux.vnet.ibm.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
This commit is contained in:
parent
dcadaa9b40
commit
88ca7bcff1
8
hmp.c
8
hmp.c
@ -631,11 +631,11 @@ void hmp_info_tpm(Monitor *mon, const QDict *qdict)
|
|||||||
c, TpmModel_lookup[ti->model]);
|
c, TpmModel_lookup[ti->model]);
|
||||||
|
|
||||||
monitor_printf(mon, " \\ %s: type=%s",
|
monitor_printf(mon, " \\ %s: type=%s",
|
||||||
ti->id, TpmType_lookup[ti->type]);
|
ti->id, TpmTypeOptionsKind_lookup[ti->options->kind]);
|
||||||
|
|
||||||
switch (ti->tpm_options->kind) {
|
switch (ti->options->kind) {
|
||||||
case TPM_TYPE_OPTIONS_KIND_TPM_PASSTHROUGH_OPTIONS:
|
case TPM_TYPE_OPTIONS_KIND_PASSTHROUGH:
|
||||||
tpo = ti->tpm_options->tpm_passthrough_options;
|
tpo = ti->options->passthrough;
|
||||||
monitor_printf(mon, "%s%s%s%s",
|
monitor_printf(mon, "%s%s%s%s",
|
||||||
tpo->has_path ? ",path=" : "",
|
tpo->has_path ? ",path=" : "",
|
||||||
tpo->has_path ? tpo->path : "",
|
tpo->has_path ? tpo->path : "",
|
||||||
|
@ -3403,13 +3403,12 @@
|
|||||||
#
|
#
|
||||||
# A union referencing different TPM backend types' configuration options
|
# A union referencing different TPM backend types' configuration options
|
||||||
#
|
#
|
||||||
# @tpm-passthough-options: TPMPassthroughOptions describing the TPM
|
# @passthrough: The configuration options for the TPM passthrough type
|
||||||
# passthrough configuration options
|
|
||||||
#
|
#
|
||||||
# Since: 1.5
|
# Since: 1.5
|
||||||
##
|
##
|
||||||
{ 'union': 'TpmTypeOptions',
|
{ 'union': 'TpmTypeOptions',
|
||||||
'data': { 'tpm-passthrough-options' : 'TPMPassthroughOptions' } }
|
'data': { 'passthrough' : 'TPMPassthroughOptions' } }
|
||||||
|
|
||||||
##
|
##
|
||||||
# @TpmInfo:
|
# @TpmInfo:
|
||||||
@ -3420,17 +3419,14 @@
|
|||||||
#
|
#
|
||||||
# @model: The TPM frontend model
|
# @model: The TPM frontend model
|
||||||
#
|
#
|
||||||
# @type: The TPM (backend) type being used
|
# @options: The TPM (backend) type configuration options
|
||||||
#
|
|
||||||
# @tpm-options: The TPM (backend) type configuration options
|
|
||||||
#
|
#
|
||||||
# Since: 1.5
|
# Since: 1.5
|
||||||
##
|
##
|
||||||
{ 'type': 'TPMInfo',
|
{ 'type': 'TPMInfo',
|
||||||
'data': {'id': 'str',
|
'data': {'id': 'str',
|
||||||
'model': 'TpmModel',
|
'model': 'TpmModel',
|
||||||
'type': 'TpmType',
|
'options': 'TpmTypeOptions' } }
|
||||||
'tpm-options': 'TpmTypeOptions' } }
|
|
||||||
|
|
||||||
##
|
##
|
||||||
# @query-tpm:
|
# @query-tpm:
|
||||||
|
@ -257,14 +257,13 @@ static TPMInfo *qmp_query_tpm_inst(TPMBackend *drv)
|
|||||||
|
|
||||||
res->id = g_strdup(drv->id);
|
res->id = g_strdup(drv->id);
|
||||||
res->model = drv->fe_model;
|
res->model = drv->fe_model;
|
||||||
res->type = drv->ops->type;
|
res->options = g_new0(TpmTypeOptions, 1);
|
||||||
res->tpm_options = g_new0(TpmTypeOptions, 1);
|
|
||||||
|
|
||||||
switch (res->type) {
|
switch (drv->ops->type) {
|
||||||
case TPM_TYPE_PASSTHROUGH:
|
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);
|
tpo = g_new0(TPMPassthroughOptions, 1);
|
||||||
res->tpm_options->tpm_passthrough_options = tpo;
|
res->options->passthrough = tpo;
|
||||||
if (drv->path) {
|
if (drv->path) {
|
||||||
tpo->path = g_strdup(drv->path);
|
tpo->path = g_strdup(drv->path);
|
||||||
tpo->has_path = true;
|
tpo->has_path = true;
|
||||||
|
Loading…
Reference in New Issue
Block a user