From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:46117) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R49bl-0001BH-HG for qemu-devel@nongnu.org; Thu, 15 Sep 2011 06:55:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R49bk-00022b-Cf for qemu-devel@nongnu.org; Thu, 15 Sep 2011 06:55:53 -0400 Received: from e37.co.us.ibm.com ([32.97.110.158]:57617) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R49bk-00022N-73 for qemu-devel@nongnu.org; Thu, 15 Sep 2011 06:55:52 -0400 Received: from d03relay05.boulder.ibm.com (d03relay05.boulder.ibm.com [9.17.195.107]) by e37.co.us.ibm.com (8.14.4/8.13.1) with ESMTP id p8FAqSmc025339 for ; Thu, 15 Sep 2011 04:52:28 -0600 Received: from d03av03.boulder.ibm.com (d03av03.boulder.ibm.com [9.17.195.169]) by d03relay05.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p8FAtiLI157228 for ; Thu, 15 Sep 2011 04:55:44 -0600 Received: from d03av03.boulder.ibm.com (loopback [127.0.0.1]) by d03av03.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p8FAtTnN001694 for ; Thu, 15 Sep 2011 04:55:29 -0600 Message-ID: <4E71D9AF.9040401@linux.vnet.ibm.com> Date: Thu, 15 Sep 2011 06:55:43 -0400 From: Stefan Berger MIME-Version: 1.0 References: <4E70DEE8.8090908@linux.vnet.ibm.com> <20110914174020.GB21891@redhat.com> <4E70E93E.9000509@linux.vnet.ibm.com> <20110914175621.GD21891@redhat.com> <4E7118D0.3000001@linux.vnet.ibm.com> <20110915065734.GA30269@redhat.com> <4E71D1D7.1030109@linux.vnet.ibm.com> <20110915105131.GA5504@redhat.com> In-Reply-To: <20110915105131.GA5504@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] Design of the blobstore List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" Cc: Anthony Liguori , QEMU Developers , Markus Armbruster On 09/15/2011 06:51 AM, Michael S. Tsirkin wrote: > On Thu, Sep 15, 2011 at 06:22:15AM -0400, Stefan Berger wrote: >> On 09/15/2011 02:57 AM, Michael S. Tsirkin wrote: >>> On Wed, Sep 14, 2011 at 05:12:48PM -0400, Stefan Berger wrote: >>>> On 09/14/2011 01:56 PM, Michael S. Tsirkin wrote: >>>>> On Wed, Sep 14, 2011 at 01:49:50PM -0400, Stefan Berger wrote: >>>>>> On 09/14/2011 01:40 PM, Michael S. Tsirkin wrote: >>>>>>> On Wed, Sep 14, 2011 at 01:05:44PM -0400, Stefan Berger wrote: >>>>>>>> qemu ... \ >>>>>>>> -blobstore name=my-blobstore,drive=tpm-bs,showsize \ >>>>>>>> -drive if=none,id=tpm-bs \ >>>>>>>> -tpmdev libtpms,blobstore=my-blobstore,id=tpm0 \ >>>>>>>> -device tpm-tis,tpmdev=tpm0 >>>>>>>> >>>>>>>> which would result in QEMU printing to stdout: >>>>>>>> >>>>>>>> Blobstore tpm-store on drive with ID tpm-bs requires 83kb. >>>>>>> So you envision tools parsing this freetext then? >>>>>>> Seems like a step back, we are trying to move to QMP ... >>>>>> I extended it first for the way I typically interact with QEMU. I do >>>>>> not use the monitor much. >>>>> It will work even better if there's a tool to do the job instead of cut >>>>> and pasting stuff, won't it? And for that, we need monitor commands. >>>>> >>>> I am not so sure about the design of the QMP commands and how to >>>> break things up into individual calls. So does this sequence here >>>> and the 'query-blobstore' output look ok? >>>> >>>> { "execute": "qmp_capabilities" } >>>> {"return": {}} >>>> { "execute": "query-blobstore" } >>>> {"return": [{"size": 84480, "id": "tpm-bs"}]} >>> I'll let some QMP experts to comment. >>> >>> We don't strictly need the id here, right? >>> It is passed to the command. >>> >>> BTW is it [] or {}? It's the total size, right? Should it be >>> {"return": {"size": 84480}} >>> ? >> The id serves to distinguish one blobstore from the other. We'll >> have any number of blobstores. Since we get rid of the -blobstore >> option they will only be identifiable via the ID of the drive they >> are using. If that's not good, please let me know. The example I had >> shown yesterday were using the name of the blobstore, rather than >> the drive ID, to connect the device to the blobstore. >> before: >> >> qemu ... \ >> -blobstore name=my-blobstore,drive=tpm-bs,showsize \ >> -drive if=none,id=tpm-bs \ >> -tpmdev libtpms,blobstore=my-blobstore,id=tpm0 \ >> -device tpm-tis,tpmdev=tpm0 >> >> now: >> >> qemu ...\ >> -tpmdev libtpms,blobstore=tpm-bs,id=tpm0 \ >> -drive if=none,id=tpm-bs,file=$TPMSTATE \ >> >> >> >> Stefan > Ah, I get it. I was confused thinking this > queries a single store. > Instead this returns info about *all* blobstores. > query-blobstores would be a better name then. > Otherwise I think it's fine. > > > Also, should we rename blobstore to 'nvram' or > something else that tells the user what this does? > > Fine by me. We ought to talk about the on-disk format then ... Stefan >>>> Corresponding command line parameters are: >>>> >>>> -tpmdev libtpms,blobstore=tpm-bs,id=tpm0 \ >>>> -drive if=none,id=tpm-bs,file=$TPMSTATE \ >>>> >>>> Regards, >>>> Stefan >>>> >>>> >>>>>>> So with above, the raw case which we don't expect to be used often >>>>>>> is easy to use, but qcow which we expect to be the main case >>>>>>> is close to imposible, involving manual cut and paste >>>>>>> of image size. >>>>>>> >>>>>>> Formatting images seems a rare enough occasion, >>>>>>> that I think only using monitor command for that >>>>>>> would be a better idea than a ton of new command >>>>>>> line options. On top of that, let's write a >>>>>>> script that run qemu, queries image size, >>>>>>> creates a qcow2 file, run qemu again to format, >>>>>>> all this using QMP. >>>>>> Creates the qcow2 using 'qemu-img' I suppose. >>>>>> >>>>>> Stefan >>>>> Sure. >>>>> >>>>>>> WRT 'format and run in one go' I strongly disagree with it. >>>>>>> It's just too easy to shoot oneself in the foot.