From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:39554) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TR6Kf-00066Q-Ln for qemu-devel@nongnu.org; Wed, 24 Oct 2012 15:09:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TR6Ke-0003Qm-Jj for qemu-devel@nongnu.org; Wed, 24 Oct 2012 15:09:37 -0400 Received: from e9.ny.us.ibm.com ([32.97.182.139]:53465) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TR6Ke-0003Qd-9C for qemu-devel@nongnu.org; Wed, 24 Oct 2012 15:09:36 -0400 Received: from /spool/local by e9.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 24 Oct 2012 15:09:35 -0400 Received: from d01relay03.pok.ibm.com (d01relay03.pok.ibm.com [9.56.227.235]) by d01dlp03.pok.ibm.com (Postfix) with ESMTP id 5750AC904DC for ; Wed, 24 Oct 2012 15:07:04 -0400 (EDT) Received: from d01av02.pok.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by d01relay03.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q9OJ6wEb248024 for ; Wed, 24 Oct 2012 15:06:58 -0400 Received: from d01av02.pok.ibm.com (loopback [127.0.0.1]) by d01av02.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q9OJ6wti023758 for ; Wed, 24 Oct 2012 17:06:58 -0200 Message-ID: <50883C51.5020905@linux.vnet.ibm.com> Date: Wed, 24 Oct 2012 15:06:57 -0400 From: Stefan Berger MIME-Version: 1.0 References: <1338838668-7544-1-git-send-email-stefanb@linux.vnet.ibm.com> <1338838668-7544-8-git-send-email-stefanb@linux.vnet.ibm.com> <506C87F4.2020703@linux.vnet.ibm.com> In-Reply-To: <506C87F4.2020703@linux.vnet.ibm.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH V19 7/7] Add fd parameter for TPM passthrough driver List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Corey Bryant Cc: mst@redhat.com, qemu-devel@nongnu.org, anthony@codemonkey.ws, andreas.niederl@iaik.tugraz.at On 10/03/2012 02:46 PM, Corey Bryant wrote: > > > On 06/04/2012 03:37 PM, Stefan Berger wrote: >> @@ -201,6 +201,10 @@ static TPMInfo *qmp_query_tpm_inst(TPMBackend *drv) >> res->path = g_strdup(drv->path); >> res->has_path = true; >> } >> + if (drv->tpm_fd != NULL && *drv->tpm_fd >= 0) { >> + res->fd = *drv->tpm_fd; >> + res->has_fd = true; >> + } > > Is an else path needed to set res->has_fd = false if there's no tpm_fd? > res is allocated using g_new0, so all fields are set to 0. With that has_fd is also set to false. Regards, Stefan