diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2017-10-10 00:55:49 +0200 |
---|---|---|
committer | Stefan Berger <stefanb@linux.vnet.ibm.com> | 2017-10-19 11:42:23 -0400 |
commit | d31076ba75d4239928282143efd30d08730c8845 (patch) | |
tree | f92f2182a095cd749861b0858689346abacb26c9 /hw/tpm/tpm_passthrough.c | |
parent | cfab6da8a7d3e9d825ea284a0ebbf6579e204f74 (diff) |
tpm: remove TPMDriverOps
Use TPMBackendClass to hold class methods/fields.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Diffstat (limited to 'hw/tpm/tpm_passthrough.c')
-rw-r--r-- | hw/tpm/tpm_passthrough.c | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/hw/tpm/tpm_passthrough.c b/hw/tpm/tpm_passthrough.c index f04eab3e63..d9da99bc8e 100644 --- a/hw/tpm/tpm_passthrough.c +++ b/hw/tpm/tpm_passthrough.c @@ -365,19 +365,6 @@ static const QemuOptDesc tpm_passthrough_cmdline_opts[] = { { /* end of list */ }, }; -static const TPMDriverOps tpm_passthrough_driver = { - .type = TPM_TYPE_PASSTHROUGH, - .opts = tpm_passthrough_cmdline_opts, - .desc = "Passthrough TPM backend driver", - .create = tpm_passthrough_create, - .reset = tpm_passthrough_reset, - .cancel_cmd = tpm_passthrough_cancel_cmd, - .get_tpm_established_flag = tpm_passthrough_get_tpm_established_flag, - .reset_tpm_established_flag = tpm_passthrough_reset_tpm_established_flag, - .get_tpm_version = tpm_passthrough_get_tpm_version, - .get_tpm_options = tpm_passthrough_get_tpm_options, -}; - static void tpm_passthrough_inst_init(Object *obj) { TPMPassthruState *tpm_pt = TPM_PASSTHROUGH(obj); @@ -402,7 +389,17 @@ static void tpm_passthrough_class_init(ObjectClass *klass, void *data) { TPMBackendClass *tbc = TPM_BACKEND_CLASS(klass); - tbc->ops = &tpm_passthrough_driver; + tbc->type = TPM_TYPE_PASSTHROUGH; + tbc->opts = tpm_passthrough_cmdline_opts; + tbc->desc = "Passthrough TPM backend driver"; + tbc->create = tpm_passthrough_create; + tbc->reset = tpm_passthrough_reset; + tbc->cancel_cmd = tpm_passthrough_cancel_cmd; + tbc->get_tpm_established_flag = tpm_passthrough_get_tpm_established_flag; + tbc->reset_tpm_established_flag = + tpm_passthrough_reset_tpm_established_flag; + tbc->get_tpm_version = tpm_passthrough_get_tpm_version; + tbc->get_tpm_options = tpm_passthrough_get_tpm_options; tbc->handle_request = tpm_passthrough_handle_request; } |