[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 1/2] nvram: Add TPM NVRAM implementation
From: |
Kevin Wolf |
Subject: |
Re: [Qemu-devel] [PATCH 1/2] nvram: Add TPM NVRAM implementation |
Date: |
Wed, 5 Jun 2013 15:42:30 +0200 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
Am 05.06.2013 um 15:28 hat Corey Bryant geschrieben:
> >>+
> >>+ if (rwr->rc == 0) {
> >>+ rwr->rc = rwr->num_sectors;
> >>+ *rwr->blob_r = g_malloc(rwr->size);
> >>+ memcpy(*rwr->blob_r, buf, rwr->size);
> >
> >Use bdrv_pread()/bdrv_pwrite() for byte-granularity I/O instead of
> >duplicating the buffering yourself.
> >
>
> Aren't bdrv_pread()/bdrv_pwrite() synchronous? Wouldn't using them
> block the main QEMU thread? That is why I switched to using the
> coroutine versions.
You need to call them from coroutine context to avoid that they invoke
their on coroutine on which they wait in this this while (!done)
{ qemu_aio_wait(); } loop that blocks everything. Called from coroutine
context, they do the Right Thing, though.
Kevin
[Qemu-devel] [PATCH 2/2] nvram: Add tpm-tis drive support, Corey Bryant, 2013/06/04
Re: [Qemu-devel] [PATCH 0/2] TPM NVRAM persistent storage, Eric Blake, 2013/06/04