From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:44841) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UfZsH-0002xI-Oi for qemu-devel@nongnu.org; Thu, 23 May 2013 14:04:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UfZsC-0005eq-BI for qemu-devel@nongnu.org; Thu, 23 May 2013 14:04:25 -0400 Received: from e23smtp05.au.ibm.com ([202.81.31.147]:56944) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UfZsB-0005eZ-Mn for qemu-devel@nongnu.org; Thu, 23 May 2013 14:04:20 -0400 Received: from /spool/local by e23smtp05.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 24 May 2013 03:58:36 +1000 Received: from d23relay04.au.ibm.com (d23relay04.au.ibm.com [9.190.234.120]) by d23dlp01.au.ibm.com (Postfix) with ESMTP id EC9A62CE8023 for ; Fri, 24 May 2013 04:04:06 +1000 (EST) Received: from d23av03.au.ibm.com (d23av03.au.ibm.com [9.190.234.97]) by d23relay04.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r4NHnu0q11534482 for ; Fri, 24 May 2013 03:49:56 +1000 Received: from d23av03.au.ibm.com (loopback [127.0.0.1]) by d23av03.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r4NI46QE005271 for ; Fri, 24 May 2013 04:04:06 +1000 From: Anthony Liguori In-Reply-To: <1369331087-22345-1-git-send-email-coreyb@linux.vnet.ibm.com> References: <1369331087-22345-1-git-send-email-coreyb@linux.vnet.ibm.com> Date: Thu, 23 May 2013 13:03:59 -0500 Message-ID: <87txlt4lps.fsf@codemonkey.ws> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: Re: [Qemu-devel] [PATCH 0/7] VNVRAM persistent storage List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Corey Bryant , qemu-devel@nongnu.org Cc: kwolf@redhat.com, stefanb@linux.vnet.ibm.com, mdroth@linux.vnet.ibm.com, lcapitulino@redhat.com, jschopp@linux.vnet.ibm.com, stefanha@redhat.com Corey Bryant writes: > This patch series provides VNVRAM persistent storage support that > QEMU can use internally. The initial target user will be a software > vTPM 1.2 backend that needs to store keys in VNVRAM and be able to > reboot/migrate and retain the keys. > > This support uses QEMU's block driver to provide persistent storage > by reading/writing VNVRAM data from/to a drive image. The VNVRAM > drive image is provided with the -drive command line option just like > any other drive image and the vnvram_create() API will find it. > > The APIs allow for VNVRAM entries to be registered, one at a time, > each with a maximum blob size. Entry blobs can then be read/written > from/to an entry on the drive. Here's an example of usage: I still don't get why this needs to exist. This doesn't map to any hardware concept I know of. Why can't the vTPM manage on it's own how it stores blobs in it's flash memory? I think we're adding an unneeded layer of abstraction here. Regards, Anthony Liguori > > VNVRAM *vnvram; > int errcode > const VNVRAMEntryName entry_name; > const char *blob_w = "blob data"; > char *blob_r; > uint32_t blob_r_size; > > vnvram = vnvram_create("drive-ide0-0-0", false, &errcode); > strcpy((char *)entry_name, "first-entry"); > vnvram_register_entry(vnvram, &entry_name, 1024); > vnvram_write_entry(vnvram, &entry_name, (char *)blob_w, strlen(blob_w)+1); > vnvram_read_entry(vnvram, &entry_name, &blob_r, &blob_r_size); > vnvram_delete(vnvram); > > Thanks, > Corey > > Corey Bryant (7): > vnvram: VNVRAM bdrv support > vnvram: VNVRAM in-memory support > vnvram: VNVRAM bottom-half r/w scheduling support > vnvram: VNVRAM internal APIs > vnvram: VNVRAM additional debug support > main: Initialize VNVRAM > monitor: QMP/HMP support for retrieving VNVRAM details > > Makefile.objs | 2 + > hmp.c | 32 ++ > hmp.h | 1 + > monitor.c | 7 + > qapi-schema.json | 47 ++ > qmp-commands.hx | 41 ++ > vl.c | 6 + > vnvram.c | 1254 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ > vnvram.h | 36 ++ > 9 files changed, 1426 insertions(+), 0 deletions(-) > create mode 100644 vnvram.c > create mode 100644 vnvram.h