History | View | Annotate | Download (65.6 kB)
vmdk: do not try opening a file as both image and descriptor
This prepares for propagating errors from vmdk_open_sparse andvmdk_open_desc_file up to the caller of vmdk_open.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Reviewed-by: Fam Zheng <famz@redhat.com>...
vmdk: correctly propagate errors
Now that we can return the "right" errors, use the Error** parameterto pass them back instead of just printing them.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Reviewed-by: Fam Zheng <famz@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
vmdk: Check for overhead when opening
Report an error if file size is even smaller than metadata.
Signed-off-by: Fam Zheng <famz@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
vmdk: Fix big flat extent IO
Local variable "n" as int64_t avoids overflow with large sector numbercalculation. See test case change for failure case.
vmdk: Check VMFS extent line field number
VMFS extent line in description file should be with 4 fields:
RW <size> VMFS "file-name.vmdk"
Check the number explicitly and report error if offset is appended asFLAT, which should be invalid format.
Reported-by: Paolo Bonzini <pbonzini@redhat.com>...
vmdk: Fix creating big description file
The buffer for description file was 4096 which only covers a fewhundred of extents. This changes the buffer to dynamic allocated withg_strdup_printf in order to support bigger cases.
Signed-off-by: Fam Zheng <famz@redhat.com>...
qemu-iotests: Add sample image and test for VMDK version 3
vmdk: Implment bdrv_get_specific_info
Implement .bdrv_get_specific_info to return the extent information.
vmdk: convert error code to use errp
Convert "fprintf(stderr,..." and standardize error messages:
Remove a few local_error's and use errp.
Remove "VMDK:" or "Vmdk:" prefixes in error message and fix to uppercase.
vmdk: refuse enabling zeroed grain with flat images
This is a header flag and we needs sparse for the header.
qemu-iotests: move blank lines of output in case 059
Move the blank line to above the test step banner, so it looks clearerin blocks.
qemu-iotests: fix test case 059
Since commit "block: Error parameter for open functions", error outputis more verbose. Update test case output file to follow the change.
qemu-iotests: add monolithicFlat creation test to 059
qemu-iotests: add empty test case for vmdk
Will add vmdk specific tests later here.
vmdk: check granularity field in opening
Granularity is used to calculate the cluster size and allocate r/wbuffer. Check the value from image before using it, so we don't abort()for unbounded memory allocation.
vmdk: check l2 table size when opening
header.num_gtes_per_gte determines size for L2 table. Check for too bigvalue before using it. Limit to 512M entries (2GB per one L2 table).
vmdk: check l1 size before opening image
L1 table size is calculated from capacity, granularity and l2 tablesize. If capacity is too big or later two are too small, the L1 tablewill be too big to allocate in memory. Limit it to a reasonable range.