qemu-img should generate VMDK with an EOS marker when `has_marker` flag enabled
Goal
According to VMDK standard, VMDK extents
with type streamOptimized should place an EOS marker at the tail of file. Or some
softwares like VMWare ESXI will reject these kinds of VMDK when import them as OVF.
Technical details
Theses lines are copy from standard
The header and the footer are both described by the same SparseExtentHeader structure shown in Hosted Sparse Extent Header on page 8. The footer takes precedence on the header when it exists. The footer should be the last block of the disk and immediately followed by the end-of-stream marker so that they together occupy the last two sectors of the disk.
Additional information
I generate a empty volume with capacity 1G and try to deploy it as a part of OVF. This would fail.
But when I append an EOS marker to that VMDK, which is actually a zeroed sector, the deployed procedure succeeded.
This case merely happened if VMDK has data, since qemu-img always write at least one grain(64 KB). So the padding part will be recognized as EOS marker.
I have written a temporary patch for this and it works fine for me. I'm glad to send it for review.