
On Fri, Jul 18, 2008 at 12:27:49PM +0200, Stefan de Konink wrote:
Hi,
There is currently no implementation in the api to clone snapshots or images. I wonder if we could add an XML node to specify a backed device. Or add a new function that allows to clone.
I think this wants to be done with a new API, taking a source volume, and destination pool as the arguemnts. Something along the lines of virStorageVolClone(virStorageVolPtr src, virStoragePoolPtr dst, unsigned int flags); Although the common & efficient case will be cloning volumes in the same pool, allowing a pool to be passed in directly, allows us to clone across pools. eg, clone a LVM volume to a NFS file.
Like the create is not supported by all pools, cloning should also be based on best effort, falling back to cp for non sparse images. (Probably a good configuration option)
Basically pool which supports 'create' ought to be usable as a destination pool - at worst we can do a generic 'cp' style clone if the underlying pool doesn't have a more efficient method. Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|