From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:37227) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R1Icx-0001Sz-83 for qemu-devel@nongnu.org; Wed, 07 Sep 2011 09:57:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R1Ics-0001VO-8A for qemu-devel@nongnu.org; Wed, 07 Sep 2011 09:57:19 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55528) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R1Ics-0001Us-0C for qemu-devel@nongnu.org; Wed, 07 Sep 2011 09:57:14 -0400 Date: Wed, 7 Sep 2011 16:57:37 +0300 From: "Michael S. Tsirkin" Message-ID: <20110907135736.GG9337@redhat.com> 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> <4E6776C4.7000607@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4E6776C4.7000607@linux.vnet.ibm.com> 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: Stefan Berger 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 Wed, Sep 07, 2011 at 09:51:00AM -0400, Stefan Berger wrote: > 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 We can create a common function and use that for net and tpm. -- MST