[pve-devel] [PATCH 2/2] Fix: list_images returns now a array of hashes so adopt the code.

Wolfgang Link w.link at proxmox.com
Thu Jun 8 10:08:19 CEST 2017


---
 PVE/CLI/pvesr.pm | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/PVE/CLI/pvesr.pm b/PVE/CLI/pvesr.pm
index 13ef2730..5e57ac48 100644
--- a/PVE/CLI/pvesr.pm
+++ b/PVE/CLI/pvesr.pm
@@ -133,9 +133,10 @@ __PACKAGE__->register_method ({
 	foreach my $storeid (@$storage_list) {
 	    my $scfg = PVE::Storage::storage_config($storecfg, $storeid);
 	    my $plugin = PVE::Storage::Plugin->lookup($scfg->{type});
-	    my $volids = $plugin->list_images($storeid, $scfg, $vmid, undef, $cache);
-	    foreach my $volid (@$volids) {
-		my ($storeid, $volname) = parse_volume_id($volid);
+	    my $images = $plugin->list_images($storeid, $scfg, $vmid, undef, $cache);
+	    foreach my $disk (@$images) {
+		my $volid = $disk->{volid};
+		my ($storeid, $volname) = PVE::Storage::parse_volume_id($volid);
 		my $list = $plugin->volume_snapshot_list($scfg, $storeid, $volname); # fixme: pass $cache
 		my $found_replication_snapshots = 0;
 		foreach my $snap (@$list) {
-- 
2.11.0





More information about the pve-devel mailing list