Hi Fam, the following commands produce an error message that's unexpected IMO:
truncate --size=0 z.raw qemu-img convert -f raw -O vmdk z.raw z.vmdk qemu-img: Could not open 'z.vmdk': Unsupported image type 'monolithicSparse' The exit status is 1, and the attached z.vmdk file is created. My understanding: - Commit 7fa60fa3778f ("VMDK: open/read/write for monolithicFlat image", 2011-07-19) introduced the vmdk_open_desc_file() function. This function would only support (at the time) the "monolithicFlat" extent (or image?) type. Previously to the patch, "monolithicSparse" had been supported (that was the type QEMU would create), but (AIUI) vmdk_open_desc_file() was never supposed to be called for "monolithicSparse", so there was no need to handle "monolithicSparse" in vmdk_open_desc_file(). - Commit f16f509d17de ("VMDK: bugfix, open Haiku vmdk image", 2011-09-06) introduced a vmdk_open_desc_file() call, for when a VMDK4 extent with "zero capacity" (header.capacity == 0) would be opened. Apparently the Haiku image did not use the "monolithicSparse" subformat. - When converting a zero-sized file to VMDK, a single extent with zero capacity is produced (see the attachment), triggering this latter call to vmdk_open_desc_file(). - QEMU creates the VMDK file by default in "monolithicSparse" subformat by default, but vmdk_open_desc_file() cannot handle that; hence the error. What's missing? Should vmdk_open_desc_file() recognize "monolithicSparse", or should vmdk_open_desc_file() not be called in this situation at all? Or is the zero-capacity file created by QEMU malformed? Thanks, Laszlo
z.vmdk.gz
Description: application/gzip