[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 37/42] tpm: lookup the the TPM interface instead
From: |
Marc-André Lureau |
Subject: |
Re: [Qemu-devel] [PATCH 37/42] tpm: lookup the the TPM interface instead of TIS device |
Date: |
Tue, 10 Oct 2017 18:31:57 -0400 (EDT) |
Hi
----- Original Message -----
> On 10/10/2017 04:21 PM, Eduardo Habkost wrote:
> > On Tue, Oct 10, 2017 at 12:56:18AM +0200, Marc-André Lureau wrote:
> > [...]
> >> -static inline TPMVersion tpm_get_version(void)
> >> +static inline TPMIf *tpm_find(void)
> >> {
> >> -#ifdef CONFIG_TPM
> >> - Object *obj = object_resolve_path_type("", TYPE_TPM_TIS, NULL);
> >> + Object *obj = object_resolve_path_type("", TYPE_TPM_IF, NULL);
> > Considering that tpm_crb_realizefn() will rely on tpm_find()
> > returning NULL if there are multiple TPM devices, I suggest
> > adding a "returns NULL unless there is exactly one TPM device"
> > comment, just like fw_cfg_find() and find_vmgenid_dev()
>
> I wonder whether the function couldn't have a better name.
> tpm_find_single() ?
>
As Eduardo said, there is precedence in QEMU codebase (fw_cfg_find() and
find_vmgenid_dev())
I don't think foo_find() is a bad name - it returns NULL if there are multiple
foo, which makes sense imho. I'll add the missing comment though.
- Re: [Qemu-devel] [PATCH 33/42] tpm-passthrough: remove error cleanup from handle_device_opts, (continued)
- [Qemu-devel] [PATCH 35/42] tpm-tis: simplify header inclusion, Marc-André Lureau, 2017/10/09
- [Qemu-devel] [PATCH 34/42] tpm-passthrough: workaround a possible race, Marc-André Lureau, 2017/10/09
- [Qemu-devel] [PATCH 36/42] tpm: rename qemu_find_tpm() -> qemu_find_tpm_be(), Marc-André Lureau, 2017/10/09
- [Qemu-devel] [PATCH 37/42] tpm: lookup the the TPM interface instead of TIS device, Marc-André Lureau, 2017/10/09
- Re: [Qemu-devel] [PATCH 37/42] tpm: lookup the the TPM interface instead of TIS device, Stefan Berger, 2017/10/10
- [Qemu-devel] [PATCH 38/42] tpm: add TPM interface to lookup TPM version, Marc-André Lureau, 2017/10/09
- [Qemu-devel] [PATCH 39/42] tpm: add tpm_cmd_get_size() to tpm_util, Marc-André Lureau, 2017/10/09
- [Qemu-devel] [PATCH 40/42] acpi: change TPM TIS data conditions, Marc-André Lureau, 2017/10/09
- [Qemu-devel] [PATCH 41/42] tpm-emulator: add a FIXME comment about blocking cancel, Marc-André Lureau, 2017/10/09
- [Qemu-devel] [PATCH 42/42] WIP: add TPM CRB device, Marc-André Lureau, 2017/10/09