> -----Original Message----- > From: Giuseppe Scrivano [mailto:gscrivan@xxxxxxxxxx] > Sent: Wednesday, January 28, 2015 5:21 PM > To: Chen, Hanxiao/陈 晗霄 > Cc: virt-tools-list@xxxxxxxxxx > Subject: Re: [virt-manager PATCH 1/3] virt-clone: introduce > --reflink for btrfs COW copy > > Chen Hanxiao <chenhanxiao@xxxxxxxxxxxxxx> writes: > > > 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. > > > > Signed-off-by: Chen Hanxiao <chenhanxiao@xxxxxxxxxxxxxx> > > --- > > virt-clone | 4 +++- > > virtinst/cloner.py | 5 +++-- > > virtinst/devicedisk.py | 4 ++-- > > virtinst/diskbackend.py | 14 ++++++++------ > > virtinst/storage.py | 5 ++++- > > 5 files changed, 20 insertions(+), 12 deletions(-) > > > > diff --git a/virtinst/storage.py b/virtinst/storage.py > > index bdbd064..fe7f9cb 100644 > > --- a/virtinst/storage.py > > +++ b/virtinst/storage.py > > @@ -723,7 +723,7 @@ class StorageVolume(_StorageObject): > > "setting allocation equal to capacity")) > > self.allocation = self.capacity > > > > - def install(self, meter=None): > > + def install(self, meter=None, reflink=None): > > """ > > Build and install storage volume from xml > > """ > > @@ -748,6 +748,9 @@ class StorageVolume(_StorageObject): > > self.conn.SUPPORT_POOL_METADATA_PREALLOC, self.pool)): > > createflags |= libvirt.VIR_STORAGE_VOL_CREATE_PREALLOC_METADATA > > > > + if reflink: > > + cloneflags |= libvirt.VIR_STORAGE_VOL_CREATE_REFLINK > > + > > you should check that the VIR_STORAGE_VOL_CREATE_REFLINK flag is defined > before using it. You can do this in support.py. > Right, thanks for your remind. Regards, -Chen _______________________________________________ virt-tools-list mailing list virt-tools-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/virt-tools-list