empty vmdk disk created by qemu-img cann't import to vmware ESXi or Workstation Description of problem: qemu-img create empty vmdk file, and can't import to vmware workstation or ESXi. the ovftool fail. the log: > ``` > 2024-08-23T11:19:32.335+08:00 verbose OVFTool[4088548] [Originator@6876 sub=Default] Opening disk target empty-disk2.vmdk > 2024-08-23T11:19:32.335+08:00 error OVFTool[4088548] [Originator@6876 sub=Default] Error on read, error: -1 > 2024-08-23T11:19:32.336+08:00 verbose OVFTool[4088187] [Originator@6876 sub=Default] Exception thrown: N5boost16exception_detail10clone_implINS_17unknown_exceptionEEE(std::exception) > 2024-08-23T11:19:32.337+08:00 verbose OVFTool[4088187] [Originator@6876 sub=Default] Backtrace: > --> [backtrace begin] product: VMware Workstation, version: e.x.p, build: build-15722219, tag: OVFTool, cpu: x86_64, os: linux, buildType: release > --> backtrace[00] libvmacore.so[0x003DD716] > --> backtrace[01] libvmacore.so[0x001CF8DF]: Vmacore::System::Stacktrace::CaptureWork(unsigned int) > --> backtrace[02] libvmacore.so[0x001B6EA9]: Vmacore::System::SystemFactory::CreateQuickBacktrace(Vmacore::Ref&) > --> backtrace[03] libvmacore.so[0x0016CF2E]: Vmacore::Throwable::Throwable(std::string&&) > --> backtrace[04] ovftool.bin[0x001C1F38] > --> backtrace[05] ovftool.bin[0x002008D5] > --> backtrace[06] ovftool.bin[0x00129EF0] > --> backtrace[07] libc.so.6[0x00044E50] > --> backtrace[08] libc.so.6[0x00044EFC] > --> backtrace[09] ovftool.bin[0x00132D21] > --> [backtrace end] > ``` the log file: [test.log](/uploads/174db2ace468bd9f0ec3ab14de524217/test.log) Steps to reproduce: 1. create empty vmdk file ./qemu-img create -f vmdk -o adapter_type=lsilogic,subformat=streamOptimized empty.vmdk 1G 2. add empty file info to ovf file 3. import it to vmware workstation Additional information: If i write some data to empty vmdk file, it can import successfully. The reson: qemu only write metadata for empty vmdk file, but the ovftool need read more data and it cann't read more. we can write one sector zero data after the metadata, ovftool work well. I submitted the patch: https://patchew.org/QEMU/20240822105237.777-1-luzhipeng@cestc.cn/