[Top][All Lists]
[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: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [PATCH 3/5] block: Virtual Bridges VERDE GOW disk image format, legacy GOW version 1 support implementation |
Date: |
Fri, 9 Mar 2012 11:42:50 +0000 |
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.
> +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