[libvirt PATCH 0/4] storage: support controlling COW attribute for pool

Daniel P. Berrangé posted 4 patches 3 years, 9 months ago
Test syntax-check failed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/20200720173322.839717-1-berrange@redhat.com
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
[libvirt PATCH 0/4] storage: support controlling COW attribute for pool
Posted by Daniel P. Berrangé 3 years, 9 months ago
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 <cow state="yes|no"/> 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


Re: [libvirt PATCH 0/4] storage: support controlling COW attribute for pool
Posted by Neal Gompa 3 years, 9 months ago
On Mon, Jul 20, 2020 at 1:33 PM Daniel P. Berrangé <berrange@redhat.com> 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 <cow state="yes|no"/> 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 <ngompa13@gmail.com>


-- 
真実はいつも一つ!/ Always, there's only one truth!


Re: [libvirt PATCH 0/4] storage: support controlling COW attribute for pool
Posted by Michal Privoznik 3 years, 9 months ago
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 <cow state="yes|no"/> 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 <mprivozn@redhat.com>

Michal

Re: [libvirt PATCH 0/4] storage: support controlling COW attribute for pool
Posted by Peter Krempa 3 years, 9 months ago
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 <cow state="yes|no"/> 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 <pkrempa@redhat.com>