Red Hat Bugzilla – Bug 480287
python-virtinst: virt-clone changeset dade986aa3bd breaks --preserve option
Last modified: 2009-03-04 11:20:14 EST
Description of problem:
virt-clone in python-virtinst 0.400.0 introduces a regression in virt-clone by breaking --preserve command line option via introduction of the following check:
This check is preformed regardless of whether --preserve was requested by the user or not. Obviously, it is intentional that the path exists when --preserve option is specified.
Version-Release number of selected component (if applicable):
Rawhide almost certainly too
Steps to Reproduce:
Typical use case when this option is very useful is when QCOW2's disk image format base_image feature is used to create clones/snapshots of some template virtual machine.
1. qemu-img create -b template.img -f qcow2 new.img
2. virt-clone -n newvm -o templatevm -f new.img --preserve
It's only possible to overwrite existing file, or choose different path.
Preserve contents of new.img.
I guess this may break cloning of partition-based disk images too.
Created attachment 329185 [details]
This should fix --preserve case, it only does os.path.exists(d.path) check when --preserve was not specified.
Created attachment 329187 [details]
Add --preserve-data to POD/man
It seems other two options printed in --help output may need to be added to documentation as well: --force-copy and --nonsparse
Thanks for patches! Applied both:
These will be in the next virtinst release (end of the week). Moving to POST in the interim.
Great, thank you!
Fixed in virtinst-0.400.1 in rawhide, closing.