[pve-devel] [PATCH] die if vdisk_free fail on delete_drive

Dietmar Maurer dietmar at proxmox.com
Tue May 29 08:08:26 CEST 2012


committed - thanks

> -----Original Message-----
> From: pve-devel-bounces at pve.proxmox.com [mailto:pve-devel-
> bounces at pve.proxmox.com] On Behalf Of Alexandre Derumier
> Sent: Dienstag, 29. Mai 2012 07:56
> To: pve-devel at pve.proxmox.com
> Subject: [pve-devel] [PATCH] die if vdisk_free fail on delete_drive
> 
>  replace the warn by a die.
> 
>  Currently, if we vdisk_free a disk and something goes wrong (network
> storage problem by example), the drive is removed from config and we
> cannot retry to remove it later.
> 
> Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
> ---
>  PVE/API2/Qemu.pm |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm index
> 3895b18..fb4b280 100644
> --- a/PVE/API2/Qemu.pm
> +++ b/PVE/API2/Qemu.pm
> @@ -599,7 +599,7 @@ my $delete_drive = sub {
>  	if (&$vm_is_volid_owner($storecfg, $vmid, $volid)) {
>  	    if ($force || $key =~ m/^unused/) {
>  		eval { PVE::Storage::vdisk_free($storecfg, $volid); };
> -		warn $@ if $@;
> +		die $@ if $@;
>  	    } else {
>  		PVE::QemuServer::add_unused_volume($conf, $volid,
> $vmid);
>  	    }
> --
> 1.7.2.5
> 
> _______________________________________________
> pve-devel mailing list
> pve-devel at pve.proxmox.com
> http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel





More information about the pve-devel mailing list