[pve-devel] applied: [PATCH qemu-server 2/4] delete suspended lock when we have no vmstate

Thomas Lamprecht t.lamprecht at proxmox.com
Sat Nov 30 18:47:45 CET 2019


On 11/29/19 11:06 AM, Dominik Csapak wrote:
> if a user removed the vmstate from the config for whatever reason,
> a vmstart did not remove the 'suspended' lock
> so always delete it and delete the vmstate only if it really was there
> 
> Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
> ---
>  PVE/QemuServer.pm | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
> index 5cf04e6..865a89b 100644
> --- a/PVE/QemuServer.pm
> +++ b/PVE/QemuServer.pm
> @@ -5506,11 +5506,13 @@ sub vm_start {
>  		    property => "guest-stats-polling-interval",
>  		    value => 2) if (!defined($conf->{balloon}) || $conf->{balloon});
>  
> -	if ($is_suspended && (my $vmstate = $conf->{vmstate})) {
> +	if ($is_suspended) {
>  	    print "Resumed VM, removing state\n";
> +	    if (my $vmstate = $conf->{vmstate}) {
> +		PVE::Storage::deactivate_volumes($storecfg, [$vmstate]);
> +		PVE::Storage::vdisk_free($storecfg, $vmstate);
> +	    }
>  	    delete $conf->@{qw(lock vmstate runningmachine)};
> -	    PVE::Storage::deactivate_volumes($storecfg, [$vmstate]);
> -	    PVE::Storage::vdisk_free($storecfg, $vmstate);
>  	    PVE::QemuConfig->write_config($vmid, $conf);
>  	}
>  
> 

applied




More information about the pve-devel mailing list