From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:33483) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R1IXV-0008St-68 for qemu-devel@nongnu.org; Wed, 07 Sep 2011 09:51:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R1IXU-0000aL-2I for qemu-devel@nongnu.org; Wed, 07 Sep 2011 09:51:41 -0400 Received: from e1.ny.us.ibm.com ([32.97.182.141]:52280) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R1IXT-0000a1-UE for qemu-devel@nongnu.org; Wed, 07 Sep 2011 09:51:40 -0400 Received: from /spool/local by us.ibm.com with XMail ESMTP for from ; Wed, 7 Sep 2011 09:51:22 -0400 Received: from d01av01.pok.ibm.com (d01av01.pok.ibm.com [9.56.224.215]) by d01relay03.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p87DpJKp038234 for ; Wed, 7 Sep 2011 09:51:19 -0400 Received: from d01av01.pok.ibm.com (loopback [127.0.0.1]) by d01av01.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p87Dp4XY018987 for ; Wed, 7 Sep 2011 09:51:10 -0400 Message-ID: <4E6776C4.7000607@linux.vnet.ibm.com> Date: Wed, 07 Sep 2011 09:51:00 -0400 From: Stefan Berger MIME-Version: 1.0 References: <20110831143551.127339744@linux.vnet.ibm.com> <20110831143625.419705972@linux.vnet.ibm.com> <20110901181024.GJ10989@redhat.com> <4E6046E8.60403@linux.vnet.ibm.com> <20110904163814.GC12745@redhat.com> <4E66DACE.3010706@linux.vnet.ibm.com> <20110907112334.GC9337@redhat.com> In-Reply-To: <20110907112334.GC9337@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH V8 14/14] Allow to provide inital TPM state List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" Cc: chrisw@redhat.com, Anthony Liguori , anbang.ruan@cs.ox.ac.uk, qemu-devel@nongnu.org, rrelyea@redhat.com, alevy@redhat.com, andreas.niederl@iaik.tugraz.at, serge@hallyn.com On 09/07/2011 07:23 AM, Michael S. Tsirkin wrote: > On Tue, Sep 06, 2011 at 10:45:34PM -0400, Stefan Berger wrote: >> On 09/04/2011 12:38 PM, Michael S. Tsirkin wrote: >>> On Thu, Sep 01, 2011 at 11:00:56PM -0400, Stefan Berger wrote: >>> >>> initstate_fd= >>> initstate_base64=on/off (or base64/bin if you really expect >>> more formats in the future) >>> >>> and use qemu routines to get the fd so they can be >>> passed through the monitor later ... >>> >> I suppose you mean monitor_get_fd(). That functions seems to only be >> used by net.c so far and if understand the chain of functions >> correctly that are called with the monitor as parameter it helps in >> hotplugging net devices ? For the TPM I would like to *not* have >> support for hotplugging since that device is supposed to be soldered >> to the motherboard and needs to be initialized through a command >> sequence by the (v)BIOS, so it has to be present early on during >> machine startup. >> >> Stefan > Fine, but let's reuse common functions and save code duplication, > especially parsing functions. > When parsing the command line there's no Monitor being passed around. So in case of 'net' net_handle_fd_param() (net.c) ends up not invoking monitor_get_fd() but the else branch where strtol() is used to convert the fd. Now I won't call net_handle_fd_param() but could introduce tpm_handle_fd_param() also calling strtol(). Though that would not make me call a common function but duplicating the code there... I don't know of another function handling the parsing of fd's. Is there one ? If not, I'll also just fall back to using strtol(). Stefan