qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Berger <stefanb@linux.vnet.ibm.com>
To: "Peter Maydell" <peter.maydell@linaro.org>,
	"Marc-André Lureau" <marcandre.lureau@gmail.com>
Cc: Amarnath Valluri <amarnath.valluri@intel.com>,
	QEMU <qemu-devel@nongnu.org>
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	[thread overview]
Message-ID: <d4676b57-0298-a0b4-a116-3d5cd9a38807@linux.vnet.ibm.com> (raw)
In-Reply-To: <CAFEAcA_V-ZS+O_BsEU6OJuT_hE-RXw0dTaJbZgY-BW8soRv3vA@mail.gmail.com>

On 10/13/2017 12:12 PM, Peter Maydell wrote:
> On 13 October 2017 at 12:14, Marc-André Lureau
> <marcandre.lureau@gmail.com> wrote:
>> Hi
>>
>> On Wed, Oct 11, 2017 at 9:47 PM, Stefan Berger
>> <stefanb@linux.vnet.ibm.com> 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 <stefanb@linux.vnet.ibm.com>
>> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
>>
>>
>> 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	other threads:[~2017-10-13 16:36 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-11 19:47 [Qemu-devel] [PATCH v3] tpm: Use EMSGSIZE instead of EBADMSG to compile on OpenBSD Stefan Berger
2017-10-13 11:09 ` Stefan Berger
2017-10-13 11:14 ` Marc-André Lureau
2017-10-13 16:12   ` Peter Maydell
2017-10-13 16:36     ` Stefan Berger [this message]
2017-10-15 16:49       ` Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d4676b57-0298-a0b4-a116-3d5cd9a38807@linux.vnet.ibm.com \
    --to=stefanb@linux.vnet.ibm.com \
    --cc=amarnath.valluri@intel.com \
    --cc=marcandre.lureau@gmail.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).