Hi, Various code cleanups accumulated while doing reviews and implementing a CRB device (postponed for later), aiming at a tpm-next development branch for after qemu 2.11.
v2: after Stefan review - rebased (half of v1 is merged upstream) - add & use a DEFINE_PROP_TPMBE() - remove tpm_register_model() - fix wrong locty_number usage & regression - tpm-tis: check that at most one TPM device exists - I changed "tpm-passthrough: remove error cleanup from handle_device_opts" to "tpm-passthrough: simplify create()", it is mostly the same patch that Stefan didn't like much but with a different rationale to have code closer to tpm-emulator create(). - added some signed-offs Marc-André Lureau (28): tpm-tis: remove unused locty_number tpm: move TpmIf in include/sysemu/tpm.h tpm-backend: store TPMIf interface, improve backend_init() tpm-tis: no longer expose TPMState tpm-be: call request_completed() out of thread tpm-be: report error instead of front-end tpm-be: ask model to the TPM interface tpm: remove unused opened code tpm-passthrough: don't save guessed cancel_path in options tpm-be: update optional function pointers tpm-passthrough: pass TPMPassthruState to handle_device_opts tpm-backend: move set 'id' to common code tpm-passthrough: make it safer to destroy after creation tpm-passthrough: simplify create() tpm-passthrough: workaround a possible race tpm-tis: simplify header inclusion tpm: rename qemu_find_tpm() -> qemu_find_tpm_be() tpm: lookup the the TPM interface instead of TIS device tpm: add TPM interface to lookup TPM version tpm: add tpm_cmd_get_size() to tpm_util acpi: change TPM TIS data conditions tpm-emulator: add a FIXME comment about blocking cancel tpm-tis: remove redundant 'tpm_tis:' in error messages tpm-tis: check that at most one TPM device exists tpm-emulator: protect concurrent ctrl_chr access qdev: add DEFINE_PROP_TPMBE tpm-tis: use DEFINE_PROP_TPMBE tpm: remove tpm_register_model() hw/tpm/tpm_int.h | 22 +---------- hw/tpm/tpm_util.h | 8 +++- include/hw/qdev-properties.h | 3 ++ include/sysemu/tpm.h | 48 +++++++++++++++++------ include/sysemu/tpm_backend.h | 32 ++++++---------- backends/tpm.c | 83 +++++++++++++--------------------------- hw/core/qdev-properties-system.c | 64 +++++++++++++++++++++++++++++++ hw/i386/acpi-build.c | 14 ++++--- hw/tpm/tpm_emulator.c | 59 +++++++++++++++------------- hw/tpm/tpm_passthrough.c | 66 +++++++++++--------------------- hw/tpm/tpm_tis.c | 83 +++++++++++++++------------------------- tpm.c | 34 ++++++---------- 12 files changed, 255 insertions(+), 261 deletions(-) -- 2.15.0.rc0.40.gaefcc5f6f