Bug 480287 - python-virtinst: virt-clone changeset dade986aa3bd breaks --preserve option
python-virtinst: virt-clone changeset dade986aa3bd breaks --preserve option
Product: Fedora
Classification: Fedora
Component: python-virtinst (Show other bugs)
All Linux
high Severity medium
: ---
: ---
Assigned To: Daniel Berrange
Fedora Extras Quality Assurance
: Regression
Depends On:
  Show dependency treegraph
Reported: 2009-01-16 03:59 EST by Tomas Hoger
Modified: 2009-03-04 11:20 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2009-03-04 11:17:47 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Possible fix (1.33 KB, patch)
2009-01-16 04:01 EST, Tomas Hoger
no flags Details | Diff
Add --preserve-data to POD/man (1.84 KB, patch)
2009-01-16 04:14 EST, Tomas Hoger
no flags Details | Diff

  None (edit)
Description Tomas Hoger 2009-01-16 03:59:48 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

Actual results:
It's only possible to overwrite existing file, or choose different path.

Expected results:
Preserve contents of new.img.

Additional info:
I guess this may break cloning of partition-based disk images too.
Comment 1 Tomas Hoger 2009-01-16 04:01:56 EST
Created attachment 329185 [details]
Possible fix

This should fix --preserve case, it only does os.path.exists(d.path) check when --preserve was not specified.
Comment 2 Tomas Hoger 2009-01-16 04:14:51 EST
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
Comment 3 Cole Robinson 2009-01-20 17:08:18 EST
Thanks for patches! Applied both:


These will be in the next virtinst release (end of the week). Moving to POST in the interim.
Comment 4 Tomas Hoger 2009-01-21 02:29:39 EST
Great, thank you!
Comment 5 Cole Robinson 2009-03-04 11:17:47 EST
Fixed in virtinst-0.400.1 in rawhide, closing.

Note You need to log in before you can comment on or make changes to this bug.