Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2027598 With the modularization of virt-v2v, determining the host disk allocation of copied (= output) VM disk images became more difficult, and so we dropped the following attributes from the generated OVF files: - ovf:Envelope/References/File/@ovf:size - ovf:Envelope/Section[@xsi:type='ovf:DiskSection_Type']/Disk/@ovf:actual_size Right now we have an "XXX" reminder in the code. Unfortunately, ovirt-engine really insists on the presence of the "ovf:actual_size" attribute -- there used to be a nullity check regarding the attribute, but it was regressed in ovirt-engine commit commit 1082d9dec289 ("core: undo recent generalization of ovf processing", 2017-08-09). Therefore, as of commit a2e74bdb3fe1 ("core: test network stats with big integer values", 2021-12-07), ovirt-engine rejects our OVF files, and we must generate "ovf:actual_size" even if we don't have the necessary info for it -- that is, with empty contents. This patch series implements -- based on Rich's NBD demo code he had sent me off-list -- the necessary "du"-like logic on the output disks using NBD APIs. Thanks, Laszlo Laszlo Ersek (3): lib/nbdkit: add the "Nbdkit.with_connect_unix" helper function lib/nbdkit: add the "Nbdkit.get_disk_allocated" helper function lib/create_ovf: populate "actual size" attributes again lib/Makefile.am | 2 +- lib/create_ovf.ml | 33 +++++++-------- lib/create_ovf.mli | 2 +- lib/nbdkit.ml | 42 ++++++++++++++++++++ lib/nbdkit.mli | 18 +++++++++ output/output_rhv.ml | 2 +- output/output_rhv_upload.ml | 2 +- output/output_vdsm.ml | 1 + tests/test-v2v-o-rhv.ovf.expected | 4 +- tests/test-v2v-o-vdsm-options.ovf.expected | 4 +- 10 files changed, 84 insertions(+), 26 deletions(-) base-commit: bb0e698360470cb4ff5992e8e01a3165f56fe41e -- 2.19.1.3.g30247aa5d201