Re: [Qemu-devel] [PATCH 1/3] Combine bdrv_read and bdrv_write to bdrv_rw

2012-02-29 Thread Paolo Bonzini
Il 29/02/2012 00:54, Michael Tokarev ha scritto: -static coroutine_fn int cow_co_write(BlockDriverState *bs, int64_t sector_num, - const uint8_t *buf, int nb_sectors) +static coroutine_fn int cow_co_rw(BlockDriverState *bs, int64_t sector_num, +

Re: [Qemu-devel] [PATCH 1/3] Combine bdrv_read and bdrv_write to bdrv_rw

2012-02-29 Thread Michael Tokarev
On 29.02.2012 19:53, Paolo Bonzini wrote: Il 29/02/2012 00:54, Michael Tokarev ha scritto: -static coroutine_fn int cow_co_write(BlockDriverState *bs, int64_t sector_num, - const uint8_t *buf, int nb_sectors) +static coroutine_fn int

Re: [Qemu-devel] [PATCH 1/3] Combine bdrv_read and bdrv_write to bdrv_rw

2012-02-29 Thread Paolo Bonzini
Il 29/02/2012 17:00, Michael Tokarev ha scritto: And how it will be a cleanup? The whole cow code (and a few others) is not reenterant. Merely moving this lock/unlock stuff inth actual methods eliminates two current wrappers in cow_co_write() and cow_co_read(), which are exactly the same

Re: [Qemu-devel] [PATCH 1/3] Combine bdrv_read and bdrv_write to bdrv_rw

2012-02-29 Thread Michael Tokarev
On 29.02.2012 20:07, Paolo Bonzini wrote: Il 29/02/2012 17:00, Michael Tokarev ha scritto: And how it will be a cleanup? The whole cow code (and a few others) is not reenterant. Merely moving this lock/unlock stuff inth actual methods eliminates two current wrappers in cow_co_write() and

[Qemu-devel] [PATCH 1/3] Combine bdrv_read and bdrv_write to bdrv_rw

2012-02-28 Thread Michael Tokarev
More or less trivial conversion. This also fixes a few bugs in several block drivers which provide only read but not write or the reverse. The code allowed to use such drivers in readwrite mode. Affected drivers: bochs, cloop, dmg, parallels, vvfat_write_target. Some block drivers gained