glennmatthews / cot

Common OVF Tool
MIT License
89 stars 22 forks source link

Avoid redundant callouts when working with Disks #62

Closed glennmatthews closed 7 years ago

glennmatthews commented 7 years ago

Some disk information is being repeatedly re-derived when it should be derived once and then cached:

bin/cot edit-hardware COT/tests/input.ovf -o temp.ova -m 200
    INFO: Loading 'COT/tests/input.ovf' as OVF
    INFO: OVF version is 1.x
    INFO: OVF product class None --> platform (unrecognized platform, generic)
 WARNING: Memory units not specified, guessing '200' means '200 MiB'
Overwrite existing file temp.ova? [y] y
    INFO: Updating RAM in OVF under profile None to 200
    INFO: Updated memory VirtualQuantity to 200 under None
    INFO: Updated memory AllocationUnits to byte * 2^20 under None
    INFO: Calling 'isoinfo -i COT/tests/input.vmdk -d' and capturing its output...
    INFO: Calling 'qemu-img info COT/tests/input.vmdk' and capturing its output...
    INFO: ...done
    INFO: Calling 'qemu-img info COT/tests/input.vmdk' and capturing its output...
    INFO: ...done
    INFO: Calling 'qemu-img info COT/tests/input.vmdk' and capturing its output...
    INFO: ...done
    INFO: Calling 'qemu-img info COT/tests/input.vmdk' and capturing its output...
    INFO: ...done
    INFO: Calling 'isoinfo -i COT/tests/input.iso -d' and capturing its output...
    INFO: ...done
    INFO: Calling 'qemu-img info COT/tests/input.iso' and capturing its output...
    INFO: ...done
    INFO: Calling 'qemu-img info COT/tests/input.iso' and capturing its output...
    INFO: ...done
    INFO: Calling 'qemu-img info COT/tests/input.iso' and capturing its output...
    INFO: ...done
    INFO: Calling 'qemu-img info COT/tests/input.iso' and capturing its output...
    INFO: ...done
    INFO: Calling 'isoinfo -i COT/tests/sample_cfg.txt -d' and capturing its output...
    INFO: Calling 'qemu-img info COT/tests/sample_cfg.txt' and capturing its output...
    INFO: ...done
    INFO: Calling 'qemu-img info COT/tests/sample_cfg.txt' and capturing its output...
    INFO: ...done
    INFO: Calling 'qemu-img info COT/tests/sample_cfg.txt' and capturing its output...
    INFO: ...done
    INFO: Calling 'qemu-img info COT/tests/sample_cfg.txt' and capturing its output...
    INFO: ...done
    INFO: Writing out to file temp.ova
    INFO: Adding COT/tests/input.vmdk to TAR file as input.vmdk
    INFO: Adding COT/tests/input.iso to TAR file as input.iso
    INFO: Adding COT/tests/sample_cfg.txt to TAR file as sample_cfg.txt
glennmatthews commented 7 years ago

Greatly improved in 2.0.0