qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: Stefan Hajnoczi <stefanha@gmail.com>
Cc: "Leonardo E. Reiter" <lreiter@vbridges.com>,
	QEMU Developers Mailing List <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH 3/5] block: Virtual Bridges VERDE GOW disk image format, legacy GOW version 1 support implementation
Date: Fri, 09 Mar 2012 12:59:52 +0100	[thread overview]
Message-ID: <4F59F0B8.2010102@redhat.com> (raw)
In-Reply-To: <CAJSP0QUc9TtJXN+pDE9zvSDbv+xR4u_vRPtzKa-WRyaM8j536g@mail.gmail.com>

Am 09.03.2012 12:42, schrieb Stefan Hajnoczi:
> On Thu, Mar 8, 2012 at 10:15 PM, Leonardo E. Reiter
> <lreiter@vbridges.com> wrote:
>> +#ifndef _WIN32
>> +#include <sys/mman.h>
> 
> I recommend writing this in a platform-independent way using bdrv_*()
> APIs to access the image file.  This has been a requirement for all
> block drivers.  Legacy drivers have been updated too.  The chance of
> merging a new image format that uses platform-specific I/O APIs is low
> IMO.

Let's be clear here: It's not just low, it's zero.

Maybe the qcow2-cache should be generalised so that replacing an mmap in
other image formats becomes easier?

>> +BlockDriver bdrv_gow1 = {
>> +    .format_name    = "gow1",
>> +    .instance_size  = sizeof(gow1_state_t),
>> +    .bdrv_probe     = gow1_probe,
>> +    .bdrv_file_open = gow1_open,
>> +    .bdrv_close     = gow1_close,
>> +    .bdrv_read      = gow1_read,
>> +    .bdrv_write     = gow1_write,
> 
> Please implement .bdrv_co_readv()/.bdrv_co_writev() instead.  They
> work along the same lines - except they allow parallel requests.  If
> you don't want to handle parallel requests you can use a CoMutex to
> serialize these functions.

.bdrv_read/write allow parallel requests as well. The difference is that
bdrv_co_readv/writev is vectored and therefore preferable.

Kevin

  reply	other threads:[~2012-03-09 11:56 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-08 22:15 [Qemu-devel] [PATCH 3/5] block: Virtual Bridges VERDE GOW disk image format, legacy GOW version 1 support implementation Leonardo E. Reiter
2012-03-09 11:42 ` Stefan Hajnoczi
2012-03-09 11:59   ` Kevin Wolf [this message]
2012-03-09 12:04 ` Kevin Wolf
2012-03-09 14:35   ` Leonardo E. Reiter

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=4F59F0B8.2010102@redhat.com \
    --to=kwolf@redhat.com \
    --cc=lreiter@vbridges.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@gmail.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).