Re: [libvirt PATCH 0/4] storage: support controlling COW attribute for pool
On 7/20/20 7:33 PM, Daniel P. Berrangé wrote: We already support a "nocow" flag for storage volumes, but this requires extra work by the mgmt app or user when creating images on btrfs. We want to "do the right thing" out of the box for btrfs. We achieve this by changint the storage pool code so that when creating a storage pool we always try to disable COW on btrfs filesystems. We then add an feature in the pool XML to let apps override the default logic. The COW setting on the pool is inherited by any volumes. The main thing not solved here is that the default directory at /var/lib/libvirt/images is created by the RPM itself, not by a normal "pool-build" command. Fortunately it appears that virt-install will explicitly invoke a storage pool build even if the directory already exists. Daniel P. Berrangé (4): util: add a helper method for controlling the COW flag on btrfs storage: convert to use virFileSetCOW storage: attempt to disable COW by default conf: add control over COW for storage pool directories docs/formatstorage.html.in | 25 +++ docs/schemas/storagepool.rng | 30 src/conf/storage_conf.c | 49 + src/conf/storage_conf.h | 8 +++ src/libvirt_private.syms | 1 + src/storage/storage_util.c | 46 +--- src/util/virfile.c | 76 src/util/virfile.h | 3 + tests/storagepoolxml2xmlin/pool-dir-cow.xml | 10 +++ tests/storagepoolxml2xmlout/pool-dir-cow.xml | 15 tests/storagepoolxml2xmltest.c | 1 + 11 files changed, 237 insertions(+), 27 deletions(-) create mode 100644 tests/storagepoolxml2xmlin/pool-dir-cow.xml create mode 100644 tests/storagepoolxml2xmlout/pool-dir-cow.xml Reviewed-by: Michal Privoznik Michal
Re: [libvirt PATCH 0/4] storage: support controlling COW attribute for pool
On Mon, Jul 20, 2020 at 18:33:18 +0100, Daniel Berrange wrote: > We already support a "nocow" flag for storage volumes, but this requires > extra work by the mgmt app or user when creating images on btrfs. We > want to "do the right thing" out of the box for btrfs. > > We achieve this by changint the storage pool code so that when creating > a storage pool we always try to disable COW on btrfs filesystems. We > then add an feature in the pool XML to let apps > override the default logic. > > The COW setting on the pool is inherited by any volumes. > > The main thing not solved here is that the default directory at > /var/lib/libvirt/images is created by the RPM itself, not by a > normal "pool-build" command. > > Fortunately it appears that virt-install will explicitly invoke a > storage pool build even if the directory already exists. > > Daniel P. Berrangé (4): > util: add a helper method for controlling the COW flag on btrfs > storage: convert to use virFileSetCOW > storage: attempt to disable COW by default > conf: add control over COW for storage pool directories Once you add the comment to patch 1 and fix the two nits in patch 4: Series: Reviewed-by: Peter Krempa
Re: [libvirt PATCH 0/4] storage: support controlling COW attribute for pool
On Mon, Jul 20, 2020 at 1:33 PM Daniel P. Berrangé wrote: > > We already support a "nocow" flag for storage volumes, but this requires > extra work by the mgmt app or user when creating images on btrfs. We > want to "do the right thing" out of the box for btrfs. > > We achieve this by changint the storage pool code so that when creating > a storage pool we always try to disable COW on btrfs filesystems. We > then add an feature in the pool XML to let apps > override the default logic. > > The COW setting on the pool is inherited by any volumes. > > The main thing not solved here is that the default directory at > /var/lib/libvirt/images is created by the RPM itself, not by a > normal "pool-build" command. > > Fortunately it appears that virt-install will explicitly invoke a > storage pool build even if the directory already exists. > > Daniel P. Berrangé (4): > util: add a helper method for controlling the COW flag on btrfs > storage: convert to use virFileSetCOW > storage: attempt to disable COW by default > conf: add control over COW for storage pool directories > > docs/formatstorage.html.in | 25 +++ > docs/schemas/storagepool.rng | 30 > src/conf/storage_conf.c | 49 + > src/conf/storage_conf.h | 8 +++ > src/libvirt_private.syms | 1 + > src/storage/storage_util.c | 46 +--- > src/util/virfile.c | 76 > src/util/virfile.h | 3 + > tests/storagepoolxml2xmlin/pool-dir-cow.xml | 10 +++ > tests/storagepoolxml2xmlout/pool-dir-cow.xml | 15 > tests/storagepoolxml2xmltest.c | 1 + > 11 files changed, 237 insertions(+), 27 deletions(-) > create mode 100644 tests/storagepoolxml2xmlin/pool-dir-cow.xml > create mode 100644 tests/storagepoolxml2xmlout/pool-dir-cow.xml > Patch series looks fine. Tested it and it seemed to automatically do what I expected on a fresh Fedora Rawhide system. Reviewed-by: Neal Gompa -- 真実はいつも一つ!/ Always, there's only one truth!
[libvirt PATCH 0/4] storage: support controlling COW attribute for pool
We already support a "nocow" flag for storage volumes, but this requires extra work by the mgmt app or user when creating images on btrfs. We want to "do the right thing" out of the box for btrfs. We achieve this by changint the storage pool code so that when creating a storage pool we always try to disable COW on btrfs filesystems. We then add an feature in the pool XML to let apps override the default logic. The COW setting on the pool is inherited by any volumes. The main thing not solved here is that the default directory at /var/lib/libvirt/images is created by the RPM itself, not by a normal "pool-build" command. Fortunately it appears that virt-install will explicitly invoke a storage pool build even if the directory already exists. Daniel P. Berrangé (4): util: add a helper method for controlling the COW flag on btrfs storage: convert to use virFileSetCOW storage: attempt to disable COW by default conf: add control over COW for storage pool directories docs/formatstorage.html.in | 25 +++ docs/schemas/storagepool.rng | 30 src/conf/storage_conf.c | 49 + src/conf/storage_conf.h | 8 +++ src/libvirt_private.syms | 1 + src/storage/storage_util.c | 46 +--- src/util/virfile.c | 76 src/util/virfile.h | 3 + tests/storagepoolxml2xmlin/pool-dir-cow.xml | 10 +++ tests/storagepoolxml2xmlout/pool-dir-cow.xml | 15 tests/storagepoolxml2xmltest.c | 1 + 11 files changed, 237 insertions(+), 27 deletions(-) create mode 100644 tests/storagepoolxml2xmlin/pool-dir-cow.xml create mode 100644 tests/storagepoolxml2xmlout/pool-dir-cow.xml -- 2.26.2