On Thu, Mar 8, 2012 at 10:15 PM, Leonardo E. Reiter
<[email protected]> 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.

> +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.

Stefan

Reply via email to