Bug 1565004

Summary: RFE: support reflink clones on XFS
Product: [Community] Virtualization Tools Reporter: slurm.tab
Component: libvirtAssignee: Libvirt Maintainers <libvirt-maint>
Status: CLOSED NEXTRELEASE QA Contact:
Severity: medium Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: atumball, libvirt-maint, mprivozn, rbalakri
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-07-06 14:58:24 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description slurm.tab 2018-04-09 06:39:59 UTC
XFS now supports reflink feature similar to btrfs, i.e. cp --reflink=auto can create instantly create CoW file clone on a reflink-enabled XFS filesystem.

It would be nice to see support for it in libvirt when cloning storage. Previously support for btrfs reflinks was added in https://bugzilla.redhat.com/show_bug.cgi?id=631909 but the implementation seems not universal and only works for btrfs

Comment 1 Michal Privoznik 2018-07-06 14:58:24 UTC
Pushed upstream:

commit 8ed874b39b3c330bbcdff434e08995dbb4467285
Author:     Julio Faracco <jcfaracco>
AuthorDate: Fri Jul 6 10:43:01 2018 -0300
Commit:     Michal Privoznik <mprivozn>
CommitDate: Fri Jul 6 16:56:56 2018 +0200

    storage: Rename btrfsCloneFile to support other filesystems.
    
    This commit renames and adds other macros to support aother filesystems
    when a reflink is performed. After that, XFS filesystems (and others)
    with reflink support will be able to clone.
    
    Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1565004
    
    Signed-off-by: Julio Faracco <jcfaracco>
    Signed-off-by: Michal Privoznik <mprivozn>

commit 2e11298f938672c5430193277c98b9474a68b1fb
Author:     Julio Faracco <jcfaracco>
AuthorDate: Fri Jul 6 10:43:00 2018 -0300
Commit:     Michal Privoznik <mprivozn>
CommitDate: Fri Jul 6 16:56:55 2018 +0200

    configure: Adding XFS library/headers check.
    
    This commit checks for xfs.h library to use XFS_IOC_CLONE which is
    defined into that library file. So, after that it is possible to use
    thie macro to create reflinks.
    
    Signed-off-by: Julio Faracco <jcfaracco>

v4.5.0-50-g8ed874b39b