Re: [virt-manager PATCH 1/3] virt-clone: introduce --reflink for btrfs COW copy

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




> -----Original Message-----
> From: Cole Robinson [mailto:crobinso@xxxxxxxxxx]
> Sent: Thursday, January 29, 2015 3:02 AM
> To: Chen, Hanxiao/陈 晗霄; virt-tools-list@xxxxxxxxxx
> Subject: Re:  [virt-manager PATCH 1/3] virt-clone: introduce
> --reflink for btrfs COW copy
> 
> On 01/27/2015 11:12 PM, Chen Hanxiao wrote:
> > libvirt commit 466b29c8c3593b2dac92acad5dd8ec923c428259
> > introduce btrfsCloneFile() for COW copy.
> > This patch add support for --reflink option for virt-clone.
> > When specified --reflink, if src and dst images all on a btrfs
> > fs, we could take advantage of COW copy.
> > If not, error out.
> >
> 
> Rather than pass reflink to disk.setup() and have to alter the call in a ton
> of places, I'd recommend:
> 
> - Add a property StorageVolume.reflink. If it's set, use the REFLINK flag when
> creating the volume.
> - Add a property Cloner.reflink
> - Cloner should also get this:
> 
> diff --git a/virtinst/cloner.py b/virtinst/cloner.py
> index 5e76413..9ccb97a 100644
> --- a/virtinst/cloner.py
> +++ b/virtinst/cloner.py
> @@ -343,6 +343,7 @@ class Cloner(object):
>                  clone_vol_install.input_vol = orig_disk.get_vol_object()
>                  vol_install = clone_vol_install
> 
> +            vol_install.reflink = self.reflink
>              clone_disk.set_vol_install(vol_install)
>          elif orig_disk.path:
>              clone_disk.set_local_disk_to_clone(orig_disk, self.clone_sparse)
> 
> 
> That's simpler, and closer to existing code conventions.
> 

Thanks for the comments, that's a much better solution.
I'll send a v2 patch soon.

Regards,
- Chen

_______________________________________________
virt-tools-list mailing list
virt-tools-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/virt-tools-list





[Index of Archives]     [Linux Virtualization]     [KVM Development]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]     [Video 4 Linux]

  Powered by Linux