Ok, I'll rework the patch
----- Mail original ----- De: "Dietmar Maurer" <[email protected]> À: "Alexandre Derumier" <[email protected]>, [email protected] Envoyé: Lundi 14 Avril 2014 08:51:32 Objet: RE: [pve-devel] [PATCH] move_disk : don't delete disk if used in a previous snasphot > + my $used_paths = PVE::QemuServer::get_used_paths($vmid, > $storecfg, $conf, 1, 1); > + my $path = PVE::Storage::path($storecfg, $old_volid); > + eval{ die "unable to delete '$old_volid' - volume is still in use > (snapshot?)\n" > + if $used_paths->{$path}; }; > + if ($@){ What is the purpose of that eval {} statement? Can't we simply use: if ($used_paths->{$path}) { warn ""unable to delete '$old_volid' - .... > + warn $@; > + PVE::QemuServer::add_unused_volume($conf, > $old_volid); > + PVE::QemuServer::update_config_nolock($vmid, $conf, > 1); > + > + } else { > + eval { PVE::Storage::vdisk_free($storecfg, $old_volid); }; > + warn $@ if $@; > + } > } > }; > > -- > 1.7.10.4 > > _______________________________________________ > pve-devel mailing list > [email protected] > http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel _______________________________________________ pve-devel mailing list [email protected] http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
