[pve-devel] [PATCH storage 3/6] api: list thin pools: add volume group to properties

Fabian Ebner f.ebner at proxmox.com
Mon Oct 25 15:47:46 CEST 2021


So that DELETE can be called using only information from GET.

Signed-off-by: Fabian Ebner <f.ebner at proxmox.com>
---
 PVE/API2/Disks/LVMThin.pm    | 4 ++++
 PVE/Storage/LvmThinPlugin.pm | 1 +
 2 files changed, 5 insertions(+)

diff --git a/PVE/API2/Disks/LVMThin.pm b/PVE/API2/Disks/LVMThin.pm
index 6c0a458..52f3062 100644
--- a/PVE/API2/Disks/LVMThin.pm
+++ b/PVE/API2/Disks/LVMThin.pm
@@ -40,6 +40,10 @@ __PACKAGE__->register_method ({
 		    type => 'string',
 		    description => 'The name of the thinpool.',
 		},
+		vg => {
+		    type => 'string',
+		    description => 'The associated volume group.',
+		},
 		lv_size => {
 		    type => 'integer',
 		    description => 'The size of the thinpool in bytes.',
diff --git a/PVE/Storage/LvmThinPlugin.pm b/PVE/Storage/LvmThinPlugin.pm
index 4ba6f90..e5ffe44 100644
--- a/PVE/Storage/LvmThinPlugin.pm
+++ b/PVE/Storage/LvmThinPlugin.pm
@@ -184,6 +184,7 @@ sub list_thinpools {
 	    next if $lvs->{$vg}->{$lvname}->{lv_type} ne 't';
 	    my $lv = $lvs->{$vg}->{$lvname};
 	    $lv->{lv} = $lvname;
+	    $lv->{vg} = $vg;
 	    push @$thinpools, $lv;
 	}
     }
-- 
2.30.2






More information about the pve-devel mailing list