History | View | Annotate | Download (9.4 kB)
block: take lock around bdrv_read implementations
This does the first part of the conversion to coroutines, bywrapping bdrv_read implementations to take the mutex.
Drivers that implement bdrv_read rather than bdrv_co_readv canthen benefit from asynchronous operation (at least if the underlying...
block: take lock around bdrv_write implementations
This does the first part of the conversion to coroutines, bywrapping bdrv_write implementations to take the mutex.
Drivers that implement bdrv_write rather than bdrv_co_writev canthen benefit from asynchronous operation (at least if the underlying...
block: change flush to co_flush
Since coroutine operation is now mandatory, convert all bdrv_flushimplementations to coroutines. For qcow2, this means taking the lock.Other implementations are simpler and just forward bdrv_flush to theunderlying protocol, so they can avoid the lock....
block: add a CoMutex to synchronous read drivers
The big conversion of bdrv_read/write to coroutines caused the twohomonymous callbacks in BlockDriver to become reentrant. It goeslike this:
1) bdrv_read is now called in a coroutine, and calls bdrv_read or...
block: Allow bdrv_flush to return errors
This changes bdrv_flush to return 0 on success and -errno in case of failure.It's a requirement for implementing proper error handle in users of bdrv_flush.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
cow: Use bdrv_(p)write_sync for metadata writes
Use bdrv_(p)write_sync to ensure metadata integrity in case of a crash.While at it, correct the wrong usage of errno.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
cow: use pread/pwrite
Use pread/pwrite instead of lseek + read/write in preparation of using theqemu block API.
Signed-off-by: Christoph Hellwig <hch@lst.de>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
cow: stop using mmap
We don't have an equivalent to mmap in the qemu block API, so read andwrite the bitmap directly. At least in the dumb implementation addedin this patch this is a lot less efficient, but it means cow can alsowork on windows, and over nbd or curl. And it fixes qemu-iotests testcase...
cow: use qemu block API
Use bdrv_pwrite to access the backing device instead of pread, andconvert the driver to implementing the bdrv_open method which givesit an already opened BlockDriverState for the underlying device.
Signed-off-by: Christoph Hellwig <hch@lst.de>...
block: Open the underlying image file in generic code
Format drivers shouldn't need to bother with things like file names, but ratherjust get an open BlockDriverState for the underlying protocol. This patchintroduces this behaviour for bdrv_open implementation. For protocols which...
cow: return errno instead of -1
Remove not needed ret = 0 assignment.
Signed-off-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
block/cow.c: fix warnings with _FORTIFY_SOURCE
CC block/cow.occ1: warnings being treated as errorsblock/cow.c: In function 'cow_create':block/cow.c:251: error: ignoring return value of 'write', declared with attribute warn_unused_resultblock/cow.c:253: error: ignoring return value of 'ftruncate', declared with attribute warn_unused_result...
block: use fdatasync instead of fsync if possible
If we are flushing the caches for our image files we only care about thedata (including the metadata required for accessing it) but not thingslike timestamp updates. So try to use fdatasync instead of fsync to...
qemu-img: Print available options with -o ?
This patch adds a small help text to each of the options in the block driverswhich can be displayed by using qemu-img create -f fmt -o ?
Convert all block drivers to new bdrv_create
Now we can make use of the newly introduced option structures. Instead ofhaving bdrv_create carry more and more parameters (which are format specific inmost cases), just pass a option structure as defined by the driver itself....
Move block drivers into their own directory
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>