qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 3/3] Combine bdrv_co_readv and bdrv_co_writev in


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH 3/3] Combine bdrv_co_readv and bdrv_co_writev into bdrv_co_rw_vector
Date: Wed, 29 Feb 2012 17:01:30 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.1) Gecko/20120216 Thunderbird/10.0.1

Il 29/02/2012 00:54, Michael Tokarev ha scritto:
>      BlockDriver *drv = bs->drv;
>      BdrvTrackedRequest req;
> +    bool is_write = flags & (BDRV_REQ_WRITE|BDRV_REQ_ZERO_WRITE);
>      int ret;

You can do BDRV_REQ_WRITE|BDRV_REQ_ZERO_WRITE, but not
BDRV_REQ_READ|BDRV_REQ_COPY_ON_READ.  That's ugly.

> +/* defines for is_write for bdrv_*_rw_vector */
> +#define BDRV_READ    false
> +#define BDRV_WRITE   true
> +

Please no, if you have to do this just change to bits.  This would have
the advantage of passing all the flags, including COPY_ON_READ.  In some
sense discard could be treated as a write too.

I don't oppose this change completely, in fact I think adding the flags
to co_readv/co_writev would be a good change.  But I'm skeptical, the
actual amount of unification is not that large.

Paolo



reply via email to

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