All of lore.kernel.org
 help / color / mirror / Atom feed
From: Corey Bryant <coreyb@linux.vnet.ibm.com>
To: Kevin Wolf <kwolf@redhat.com>
Cc: aliguori@us.ibm.com, stefanb@linux.vnet.ibm.com,
	mdroth@linux.vnet.ibm.com, qemu-devel@nongnu.org,
	jschopp@linux.vnet.ibm.com, Stefan Hajnoczi <stefanha@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 1/2] nvram: Add TPM NVRAM implementation
Date: Wed, 05 Jun 2013 09:57:12 -0400	[thread overview]
Message-ID: <51AF43B8.90501@linux.vnet.ibm.com> (raw)
In-Reply-To: <20130605134230.GF2611@dhcp-200-207.str.redhat.com>



On 06/05/2013 09:42 AM, Kevin Wolf wrote:
> 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
>
>
>

Ah, thanks for explaining.  Now I can work in bytes rather than sectors.  :)

-- 
Regards,
Corey Bryant

  reply	other threads:[~2013-06-05 13:57 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-04 18:18 [Qemu-devel] [PATCH 0/2] TPM NVRAM persistent storage Corey Bryant
2013-06-04 18:18 ` [Qemu-devel] [PATCH 1/2] nvram: Add TPM NVRAM implementation Corey Bryant
2013-06-05  9:05   ` Stefan Hajnoczi
2013-06-05 13:28     ` Corey Bryant
2013-06-05 13:42       ` Kevin Wolf
2013-06-05 13:57         ` Corey Bryant [this message]
2013-06-04 18:18 ` [Qemu-devel] [PATCH 2/2] nvram: Add tpm-tis drive support Corey Bryant
2013-06-04 19:23 ` [Qemu-devel] [PATCH 0/2] TPM NVRAM persistent storage Eric Blake
2013-06-04 19:35   ` Corey Bryant
2013-06-04 19:45     ` Eric Blake

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=51AF43B8.90501@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.