qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v3] tpm: Use EMSGSIZE instead of EBADMSG to comp


From: Stefan Berger
Subject: Re: [Qemu-devel] [PATCH v3] tpm: Use EMSGSIZE instead of EBADMSG to compile on OpenBSD
Date: Fri, 13 Oct 2017 12:36:33 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0

On 10/13/2017 12:12 PM, Peter Maydell wrote:
On 13 October 2017 at 12:14, Marc-André Lureau
<address@hidden> wrote:
Hi

On Wed, Oct 11, 2017 at 9:47 PM, Stefan Berger
<address@hidden> wrote:
EBADMSG was only added to OpenBSD very recently. To make QEMU compilable
on older OpenBSD versions use EMSGSIZE instead when a mismatch between
number of received bytes and message size indicated in the header was
found.

Return -EMSGSIZE and convert all other errnos in the same functions to
return the negative errno.

Signed-off-by: Stefan Berger <address@hidden>
Reviewed-by: Marc-André Lureau <address@hidden>


Looks good to me,
but given that the return value isn't used, perhaps you could have
changed the function to return a bool success instead?
AIUI this is just test code, so we probably don't gain too much
from extensively bikeshedding it. (Having said that, I can't
resist asking why it's not in tests/ :-))

This is NOT test code. It's determining whether the external TPM is a TPM 1.2 or TPM 2 emulation. This avoids having to start QEMU with a '--tpm2' parmeter equivalent as well as the external emulator. Passing this to the external emulator is enough.

   Stefan



thanks
-- PMM





reply via email to

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