From 669018bc9cb1ce01c49659b8fe8864a2f25adfb5 Mon Sep 17 00:00:00 2001 From: Jason Dillaman Date: Tue, 19 Mar 2019 09:42:17 -0400 Subject: [PATCH] storage: optional 'refresh' elemement on pool The new 'refresh' element can override the default refresh operations for a storage pool. The only currently supported override is to set the volume allocation size to the volume capacity. This can be specified by adding the following snippet: ... ... This is useful for certain backends where computing the actual allocation of a volume might be an expensive operation. Signed-off-by: Jason Dillaman Signed-off-by: Michal Privoznik --- docs/formatstorage.html.in | 26 +++++++++ docs/schemas/storagecommon.rng | 7 +++ docs/schemas/storagepool.rng | 23 ++++++++ src/conf/storage_conf.c | 56 +++++++++++++++++++ src/conf/storage_conf.h | 24 ++++++++ src/libvirt_private.syms | 2 + .../pool-rbd-refresh-volume-allocation.xml | 15 +++++ .../pool-rbd-refresh-volume-allocation.xml | 18 ++++++ tests/storagepoolxml2xmltest.c | 1 + 9 files changed, 172 insertions(+) create mode 100644 tests/storagepoolxml2xmlin/pool-rbd-refresh-volume-allocation.xml create mode 100644 tests/storagepoolxml2xmlout/pool-rbd-refresh-volume-allocation.xml diff --git a/docs/formatstorage.html.in b/docs/formatstorage.html.in index 968651330f..2a7604d136 100644 --- a/docs/formatstorage.html.in +++ b/docs/formatstorage.html.in @@ -508,6 +508,32 @@ device, measured in bytes. Since 0.4.1

+

Refresh overrides

+ +

+ The optional refresh element can control how the pool and + associated volumes are refreshed (pool type rbd). The + allocation attribute of the volume child element + controls the method used for computing the allocation of a volume. The + valid attribute values are default to compute the actual + usage or capacity to use the logical capacity for cases where + computing the allocation is too expensive. The following XML snippet + shows the syntax: +

+<pool type="rbd">
+  <name>myrbdpool</name>
+...
+  <source/>
+...
+  <refresh>
+    <volume allocation='capacity'/>
+  </refresh>
+...
+</pool>
+
+ Since 5.2.0 +

+

Storage Pool Namespaces

diff --git a/docs/schemas/storagecommon.rng b/docs/schemas/storagecommon.rng index 63b51470a0..d837f92bc7 100644 --- a/docs/schemas/storagecommon.rng +++ b/docs/schemas/storagecommon.rng @@ -236,4 +236,11 @@ + + + default + capacity + + + diff --git a/docs/schemas/storagepool.rng b/docs/schemas/storagepool.rng index 3907f70afe..3ca8e790ea 100644 --- a/docs/schemas/storagepool.rng +++ b/docs/schemas/storagepool.rng @@ -155,6 +155,7 @@ + @@ -691,6 +692,28 @@ + + + + + + + + + + + + + + + + + + + + + +