History | View | Annotate | Download (44.5 kB)
VMDK: fix leak of extent_file
Release extent_file on error in vmdk_parse_extents. Added closing filesin freeing extents.
Signed-off-by: Fam Zheng <famcool@gmail.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
VMDK: bugfix, opening vSphere 4 exported image
The vSphere 4 exported image is streamOptimized extent, which is notquite correctly handled. Ignore rdgOffset when RGD flag bit not set.
Signed-off-by: Fam Zheng <famcool@gmail.com>Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>...
VMDK: bugfix, open Haiku vmdk image
Haiku provides a specially formed vmdk image, which let qemu abort. It acombination of sparse header and flat data (i.e. with not l1/l2 table atall). The fix is turn to descriptor when sparse header is zero in field'capacity'....
VMDK: creating streamOptimized subformat
Creating streamOptimized subformat. Added subformat option'streamOptimized', to create a image with compression enabled and eachcluster with a GrainMarker.
VMDK: read/write compressed extent
Add support for reading/writing compressed extent.
Signed-off-by: Fam Zheng <famcool@gmail.com>Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
VMDK: Opening compressed extent.
Added flags field for compressed/streamOptimized extents, open and saveimage configuration.
VMDK: separate vmdk_read_extent/vmdk_write_extent
Factor out read/write extent code, since there will be more things totake care of once reading/writing compressed clusters is introduced.
VMDK: add twoGbMaxExtentSparse support
Add twoGbMaxExtentSparse support. Introduce vmdk_free_last_extent.
VMDK: enable twoGbMaxExtentFlat
Enable the createType 'twoGbMaxExtentFlat'. The supporting code isalready in.
Use new macro QEMU_PACKED for packed structures
Most changes were made using these commands:
git grep -la '__attribute__((packed))'|xargs perl -pi -e 's/__attribute__\(\(packed\)\)/QEMU_PACKED/'git grep -la '__attribute__ ((packed))'|xargs perl -pi -e 's/__attribute__ \(\(packed\)\)/QEMU_PACKED/'...
Use glib memory allocation and free functions
qemu_malloc/qemu_free no longer exist after this commit.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
block: add bdrv_get_allocated_file_size() operation
qemu-img.c wants to count allocated file size of image. Previously itcounts a single bs->file by 'stat' or Window API. As VMDK introducesmultiple file support, the operation becomes format specific with...
VMDK: move 'static' cid_update flag to bs field
Cid_update is the flag for updating CID on first write after opening theimage. This should be per image open rather than per program life cycle,so change it from static var of vmdk_write to a field in BDRVVmdkState....
VMDK: change get_cluster_offset return type
The return type of get_cluster_offset was an offset that use 0 to denote'not allocated', this will be no longer true for flat extents, as we seeflat extent file as a single huge cluster whose offset is 0 and length...
VMDK: open/read/write for monolithicFlat image
Parse vmdk decriptor file and open mono flat image.Read/write the flat extent.
VMDK: create different subformats
Add create option 'format', with enums: monolithicSparse monolithicFlat twoGbMaxExtentSparse twoGbMaxExtentFlatEach creates a subformat image file. The default is monolithicSparse.
Signed-off-by: Fam Zheng <famcool@gmail.com>...
VMDK: fix coding style
Conform coding style in vmdk.c to pass scripts/checkpatch.pl checks.
VMDK: bugfix, align offset to cluster in get_whole_cluster
In get_whole_cluster, the offset is not aligned to cluster when readingfrom backing_hd. When the first write to child is not at the clusterboundary, wrong address data from parent is copied to child....
VMDK: probe for monolithicFlat images
Probe as the same behavior as VMware does.Recognize image as monolithicFlat descriptor file when the file is textand the first effective line (not '#' leaded comment or space line) iseither 'version=1' or 'version=2'. No space or upper case charactors...
VMDK: separate vmdk_open by format version
VMDK: add field BDRVVmdkState.desc_offset
There are several occurrence of magic number 0x200 as the descriptoroffset within mono sparse image file. This is not the case for imageswith separate descriptor file. So a field is added to BDRVVmdkState tohold the correct value....
VMDK: flush multiple extents
Flush all the file that referenced by the image.
VMDK: introduce VmdkExtent
Introduced VmdkExtent array into BDRVVmdkState, enable holding multipleimage extents for multiple file image support.
vmdk: fix endianness bugs
The vmdk code is sloppy when handling the header descriptor duringcreation of an image. Fix all header accesses in the create path toeither store native endianness or convert it when appropriate.
Reported-by: Yury Tsarev <ytsarev@novell.com>...
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