From: Corey Bryant <coreyb@linux.vnet.ibm.com>
To: qemu-devel@nongnu.org
Cc: kwolf@redhat.com, aliguori@us.ibm.com,
stefanb@linux.vnet.ibm.com,
Corey Bryant <coreyb@linux.vnet.ibm.com>,
mdroth@linux.vnet.ibm.com, jschopp@linux.vnet.ibm.com,
stefanha@redhat.com
Subject: [Qemu-devel] [PATCH v3 2/3] nvram: Add tpm-tis drive support
Date: Thu, 6 Jun 2013 09:32:44 -0400 [thread overview]
Message-ID: <1370525564-16912-3-git-send-email-coreyb@linux.vnet.ibm.com> (raw)
In-Reply-To: <1370525564-16912-1-git-send-email-coreyb@linux.vnet.ibm.com>
Add a drive property to the tpm-tis device and initialize the TPM
NVRAM if a drive is specified.
Signed-off-by: Corey Bryant <coreyb@linux.vnet.ibm.com>
---
v2
-No changes
v3
-No changes
---
hw/tpm/tpm_int.h | 2 ++
hw/tpm/tpm_tis.c | 8 ++++++++
2 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/hw/tpm/tpm_int.h b/hw/tpm/tpm_int.h
index 2f582ca..05471ef 100644
--- a/hw/tpm/tpm_int.h
+++ b/hw/tpm/tpm_int.h
@@ -29,6 +29,8 @@ struct TPMState {
char *backend;
TPMBackend *be_driver;
+
+ BlockDriverState *bdrv;
};
#define TPM(obj) OBJECT_CHECK(TPMState, (obj), TYPE_TPM_TIS)
diff --git a/hw/tpm/tpm_tis.c b/hw/tpm/tpm_tis.c
index d4d8152..8648b3b 100644
--- a/hw/tpm/tpm_tis.c
+++ b/hw/tpm/tpm_tis.c
@@ -27,6 +27,7 @@
#include "hw/i386/pc.h"
#include "hw/pci/pci_ids.h"
#include "tpm_tis.h"
+#include "tpm_nvram.h"
#include "qemu-common.h"
/*#define DEBUG_TIS */
@@ -849,6 +850,7 @@ static Property tpm_tis_properties[] = {
DEFINE_PROP_UINT32("irq", TPMState,
s.tis.irq_num, TPM_TIS_IRQ),
DEFINE_PROP_STRING("tpmdev", TPMState, backend),
+ DEFINE_PROP_DRIVE("drive", TPMState, bdrv),
DEFINE_PROP_END_OF_LIST(),
};
@@ -864,6 +866,12 @@ static void tpm_tis_realizefn(DeviceState *dev, Error **errp)
return;
}
+ if (s->bdrv && tpm_nvram_init(s->bdrv)) {
+ error_setg(errp, "tpm_tis: backend drive with id %s could not "
+ "initialize TPM NVRAM drive", s->backend);
+ return;
+ }
+
s->be_driver->fe_model = TPM_MODEL_TPM_TIS;
if (tpm_backend_init(s->be_driver, s, tpm_tis_receive_cb)) {
--
1.7.1
next prev parent reply other threads:[~2013-06-06 13:33 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-06 13:32 [Qemu-devel] [PATCH v3 0/3] TPM NVRAM persistent storage Corey Bryant
2013-06-06 13:32 ` [Qemu-devel] [PATCH v3 1/3] nvram: Add TPM NVRAM implementation Corey Bryant
2013-06-06 13:32 ` Corey Bryant [this message]
2013-06-07 7:41 ` [Qemu-devel] [PATCH v3 0/3] TPM NVRAM persistent storage Stefan Hajnoczi
2013-06-07 12:53 ` Corey Bryant
2013-06-14 14:01 ` Anthony Liguori
2013-06-14 15:05 ` Corey Bryant
2013-06-14 15:38 ` Anthony Liguori
2013-06-14 15:50 ` Stefan Berger
2013-06-14 15:51 ` Corey Bryant
2013-06-14 15:56 ` Anthony Liguori
2013-06-14 16:21 ` Corey Bryant
2013-06-14 18:22 ` Anthony Liguori
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1370525564-16912-3-git-send-email-coreyb@linux.vnet.ibm.com \
--to=coreyb@linux.vnet.ibm.com \
--cc=aliguori@us.ibm.com \
--cc=jschopp@linux.vnet.ibm.com \
--cc=kwolf@redhat.com \
--cc=mdroth@linux.vnet.ibm.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanb@linux.vnet.ibm.com \
--cc=stefanha@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).