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