• C
    storagevol: add nocow to vol xml · a9fd30e6
    Chunyan Liu 提交于
    Add 'nocow' to storage volume xml so that user can have an option
    to set NOCOW flag to the newly created volume. It's useful on btrfs
    file system to enhance performance.
    
    Btrfs has low performance when hosting VM images, even more when the guest
    in those VM are also using btrfs as file system. One way to mitigate this
    bad performance is to turn off COW attributes on VM files. Generally, there
    are two ways to turn off COW on btrfs: a) by mounting fs with nodatacow,
    then all newly created files will be NOCOW. b) per file. Add the NOCOW file
    attribute. It could only be done to empty or new files.
    
    This patch tries the second way, according to 'nocow' option, it could set
    NOCOW flag per file:
    for raw file images, handle 'nocow' in libvirt code; for non-raw file images,
    pass 'nocow=on' option to qemu-img, and let qemu-img to handle that (requires
    qemu-img version >= 2.1).
    Signed-off-by: NChunyan Liu <cyliu@suse.com>
    a9fd30e6
virstoragefile.h 12.6 KB