qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 3/5] block: Virtual Bridges VERDE GOW disk image


From: Kevin Wolf
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
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.1) Gecko/20120209 Thunderbird/10.0.1

Am 09.03.2012 12:42, schrieb Stefan Hajnoczi:
> On Thu, Mar 8, 2012 at 10:15 PM, Leonardo E. Reiter
> <address@hidden> 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 via email to

[Prev in Thread] Current Thread [Next in Thread]