History | View | Annotate | Download (25.3 kB)
block: Remove unused s->hd in various drivers
All drivers use bs->file instead of s->hd for quite a while now, so it's timeto remove s->hd.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
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.
vmdk: Use bdrv_(p)write_sync for metadata writes
Use bdrv_(p)write_sync to ensure metadata integrity in case of a crash.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
vmdk: Fix COW
When trying to do COW, VMDK wrote the data back to the backing file. Thisproblem was revealed by the patch that made backing files read-only. This patchdoes not only fix the problem, but also simplifies the VMDK code a bit.
This fixes the backing file qemu-iotests cases for VMDK....
vmdk: Clean up backing file handling
VMDK is doing interesting things when it needs to open a backing file. Thispatch changes that part to look more like in other drivers. The nice sideeffect is that the file name isn't needed any more in the open function....
vmdk: Convert to bdrv_open
It's a format driver, so implement bdrv_open instead of bdrv_file_open.
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...
Replace calls of old bdrv_open
What is known today as bdrv_open2 becomes the new bdrv_open. All remainingcallers of the old function are converted to the new one. In some places theyeven know the right format, so they should have used bdrv_open2 from the...
vmdk: return errno instead of -1
Signed-off-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
vmdk: make vmdk_snapshot_create return -errno
vmdk: fix double free
fail_gd error case would also free rgd_buf that was already freed
vmdk: share cleanup code
cleanup code is identical for error/success cases. Only differenceare goto labels.
block/vmdk.o: fix warnings with _FORTIFY_SOURCE
CC block/vmdk.occ1: warnings being treated as errorsblock/vmdk.c: In function 'vmdk_snapshot_create':block/vmdk.c:236: error: ignoring return value of 'ftruncate', declared with attribute warn_unused_result...
Clean-up a little bit the RW related bits of BDRV_O_FLAGS. BDRV_O_RDONLY gone (and so is BDRV_O_ACCESS). Default value for bdrv_flags (0/zero) is READ-ONLY. Need to explicitly request READ-WRITE.
Instead of using the field 'readonly' of the BlockDriverState struct for passing the request,...
vmdk: Fix backing file handling
Instead of storing the backing file in its own BlockDriverState, VMDK uses theBlockDriverState of the raw image file it opened. This is wrong and breaksfunctions that access the backing file or protocols. This fix replaces all...
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>