qemu-irix/include/sysemu
Markus Armbruster 00bbf50a50 tpm: Clean up model registration & lookup
We have a strict separation between enum TpmModel and tpm_models[]:

* TpmModel may have any number of members.  It just happens to have one.

* tpm_register_model() uses the first empty slot in tpm_models[].

  If you register more than tpm_models[] has space,
  tpn_register_model() fails.  Its caller silently ignores the
  failure.

  Register the same TpmModel more than once has no effect other than
  wasting tpm_models[] slots: tpm_model_is_registered() is happy with
  the first one it finds.

Since we only ever register one model, and tpm_models[] has space for
just that one, this contraption even works.

Turn tpm_models[] into a straight map from enum TpmType to bool.  Much
simpler.

Cc: Stefan Berger <stefanb@us.ibm.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <1503564371-26090-5-git-send-email-armbru@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
[Commit message typo fixed]
2017-09-04 13:09:13 +02:00
..
accel.h vl: convert -tb-size to qemu_strtoul 2017-07-04 14:39:28 +02:00
arch_init.h
balloon.h
block-backend.h block-backend: Allow more "can inactivate" cases 2017-08-23 10:21:55 -05:00
blockdev.h
bt.h
cpus.h
cryptodev.h
device_tree.h
dma.h
dump-arch.h
dump.h
hax.h
hostmem.h
hw_accel.h
iothread.h
kvm.h kvm: workaround build break on gcc-7.1.1 / fedora26 2017-08-08 10:40:20 +02:00
kvm_int.h
memory_mapping.h
numa.h
os-posix.h
os-win32.h
qtest.h
replay.h
reset.h
rng-random.h
rng.h
seccomp.h
sysemu.h migration: move only_migratable to MigrationState 2017-06-28 11:18:38 +02:00
tpm.h
tpm_backend.h tpm: Clean up model registration & lookup 2017-09-04 13:09:13 +02:00
tpm_backend_int.h
watchdog.h
xen-mapcache.h xen/mapcache: introduce xen_replace_cache_entry() 2017-07-18 14:16:09 -07:00