From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45488) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e32x4-0004Pw-JR for qemu-devel@nongnu.org; Fri, 13 Oct 2017 12:36:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e32x0-0005LY-MP for qemu-devel@nongnu.org; Fri, 13 Oct 2017 12:36:46 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:36744 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e32x0-0005LM-GX for qemu-devel@nongnu.org; Fri, 13 Oct 2017 12:36:42 -0400 Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id v9DGYEhk044131 for ; Fri, 13 Oct 2017 12:36:38 -0400 Received: from e38.co.us.ibm.com (e38.co.us.ibm.com [32.97.110.159]) by mx0b-001b2d01.pphosted.com with ESMTP id 2djwejjthu-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Fri, 13 Oct 2017 12:36:38 -0400 Received: from localhost by e38.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 13 Oct 2017 10:36:37 -0600 References: <1507751249-3035-1-git-send-email-stefanb@linux.vnet.ibm.com> From: Stefan Berger Date: Fri, 13 Oct 2017 12:36:33 -0400 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Message-Id: Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v3] tpm: Use EMSGSIZE instead of EBADMSG to compile on OpenBSD List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell , =?UTF-8?Q?Marc-Andr=c3=a9_Lureau?= Cc: Amarnath Valluri , QEMU On 10/13/2017 12:12 PM, Peter Maydell wrote: > On 13 October 2017 at 12:14, Marc-Andr=C3=A9 Lureau > wrote: >> Hi >> >> On Wed, Oct 11, 2017 at 9:47 PM, Stefan Berger >> wrote: >>> EBADMSG was only added to OpenBSD very recently. To make QEMU compila= ble >>> on older OpenBSD versions use EMSGSIZE instead when a mismatch betwee= n >>> number of received bytes and message size indicated in the header was >>> found. >>> >>> Return -EMSGSIZE and convert all other errnos in the same functions t= o >>> return the negative errno. >>> >>> Signed-off-by: Stefan Berger >> Reviewed-by: Marc-Andr=C3=A9 Lureau >> >> >> 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=20 TPM 1.2 or TPM 2 emulation. This avoids having to start QEMU with a=20 '--tpm2' parmeter equivalent as well as the external emulator. Passing=20 this to the external emulator is enough. Stefan > > thanks > -- PMM >