]> git.ipfire.org Git - thirdparty/libvirt.git/commit
util: add a helper method for controlling the COW flag on btrfs
authorDaniel P. Berrangé <berrange@redhat.com>
Fri, 17 Jul 2020 18:16:27 +0000 (19:16 +0100)
committerDaniel P. Berrangé <berrange@redhat.com>
Thu, 23 Jul 2020 15:18:08 +0000 (16:18 +0100)
commit7230bc95aa78379c9ee20cf59394c5fc4305b75b
treeeaca42629c21c249ca1be4a1bfd7de1badbcbbbc
parentd3aa28925f8c914187996542b20ffc69cb627cb9
util: add a helper method for controlling the COW flag on btrfs

btrfs defaults to performing copy-on-write for files. This is often
undesirable for VM images, so we need to be able to control whether this
behaviour is used.

The virFileSetCOW() will allow for this. We use a tristate, since out of
the box, we want the default behaviour attempt to disable cow, but only
on btrfs, silently do nothing on non-btrfs. If someone explicitly asks
to disable/enable cow, then we want to raise a hard error on non-btrfs.

Reviewed-by: Neal Gompa <ngompa13@gmail.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
src/libvirt_private.syms
src/util/virfile.c
src/util/virfile.h