[pve-devel] [PATCH storage 03/11] plugin: document volume_resize() method

Fiona Ebner f.ebner at proxmox.com
Tue Dec 16 14:02:14 CET 2025


Based on Max's submission [0] and Fabian's reply there. Also document
that the size is a multiple of 1024 and that padding to a larger size
is allowed.

[0]: https://lore.proxmox.com/pve-devel/20250326142059.261938-8-m.carrara@proxmox.com/

Signed-off-by: Fiona Ebner <f.ebner at proxmox.com>
---
 src/PVE/Storage/Plugin.pm | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/src/PVE/Storage/Plugin.pm b/src/PVE/Storage/Plugin.pm
index 260c259..b0d3bbf 100644
--- a/src/PVE/Storage/Plugin.pm
+++ b/src/PVE/Storage/Plugin.pm
@@ -1340,6 +1340,24 @@ sub volume_size_info {
 
 }
 
+=head3 volume_resize
+
+    $plugin->volume_resize(\%scfg, $storeid, $volname, $size, $running);
+
+Resize a volume to the new C<$size> in bytes. The size is guaranteed to be a multiple of C<1024>.
+The implementation may pad to a larger size if required. In case of virtual machines, C<$running>
+indicates that the VM is currently running and the call will be followed by a C<block_resize> QMP
+command in QEMU. If resizing is supported natively via QEMU (for example, when using librbd), then
+the plugin should simply return if the VM is running. For containers, C<$running> will always be
+C<0>.
+
+C<die>s in case of errors, or if the underlying storage implementation or the volume's format
+doesn't support resizing.
+
+This function should not return any value.
+
+=cut
+
 sub volume_resize {
     my ($class, $scfg, $storeid, $volname, $size, $running) = @_;
 
-- 
2.47.3





More information about the pve-devel mailing list