qemu/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 audio: Move arch_init audio code to hw/audio/soundhw.c 2017-05-19 10:48:53 +02:00
balloon.h
block-backend.h block-backend: Allow more "can inactivate" cases 2017-08-23 10:21:55 -05:00
blockdev.h blockdev: Make orphaned -drive fatal 2017-02-21 13:17:45 +01:00
bt.h
cpus.h migration: Mark CPU states dirty before incoming migration/loadvm 2017-06-06 08:53:24 +10:00
cryptodev.h cryptodev: wrap the ready flag 2017-01-10 07:02:52 +02:00
device_tree.h
dma.h dma-helpers: explicitly pass alignment into DMA helpers 2016-10-27 16:29:13 -04:00
dump-arch.h
dump.h dump: Acquire BQL around vm_start() in dump thread 2017-05-05 12:10:00 +02:00
hax.h migration: Mark CPU states dirty before incoming migration/loadvm 2017-06-06 08:53:24 +10:00
hostmem.h hostmem: introduce host_memory_backend_mr_inited() 2017-04-20 15:22:41 -03:00
hw_accel.h migration: Mark CPU states dirty before incoming migration/loadvm 2017-06-06 08:53:24 +10:00
iothread.h iothread: add poll-grow and poll-shrink parameters 2017-01-03 16:38:50 +00:00
kvm_int.h
kvm.h kvm: workaround build break on gcc-7.1.1 / fedora26 2017-08-08 10:40:20 +02:00
memory_mapping.h
numa.h numa: consolidate cpu_preplug fixups/checks for pc/arm/spapr 2017-06-05 14:59:08 -03:00
os-posix.h util: drop old utimensat() compat code 2017-05-25 10:30:14 +02:00
os-win32.h log: Add locking to large logging blocks 2016-11-01 10:29:03 -06:00
qtest.h
replay.h shutdown: Preserve shutdown cause through replay 2017-05-23 13:28:17 +02:00
reset.h hw: move reset handlers from vl.c to hw/core 2017-01-16 17:52:35 +01:00
rng-random.h
rng.h
seccomp.h
sysemu.h migration: move only_migratable to MigrationState 2017-06-28 11:18:38 +02:00
tpm_backend_int.h
tpm_backend.h tpm: Clean up model registration & lookup 2017-09-04 13:09:13 +02:00
tpm.h
watchdog.h
xen-mapcache.h xen/mapcache: introduce xen_replace_cache_entry() 2017-07-18 14:16:09 -07:00