qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 04/16] tpm: Clean up model registration & lookup


From: Markus Armbruster
Subject: Re: [Qemu-devel] [PATCH 04/16] tpm: Clean up model registration & lookup
Date: Thu, 24 Aug 2017 20:35:49 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux)

Marc-André Lureau <address@hidden> writes:

> Hi
>
> On Thu, Aug 24, 2017 at 10:45 AM, Markus Armbruster <address@hidden> wrote:
>> 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 tmp_models[].
>>
>>   If you register more than tpm_models[] has space,
>>   tpn_register_model() fails.  Its caller silently ignores the
>>   failure.
>
> tpm_

Will fix.

>>
>>   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 <address@hidden>
>> Signed-off-by: Markus Armbruster <address@hidden>
>
> Reviewed-by: Marc-André Lureau <address@hidden>

Thanks!

[...]



reply via email to

[Prev in Thread] Current Thread [Next in Thread]