[pve-devel] [PATCH common] fix 1046: add non-snapshotted disks as unused

Wolfgang Bumiller w.bumiller at proxmox.com
Tue Jul 5 10:08:38 CEST 2016


applied all 3 patches

On Mon, Jul 04, 2016 at 01:04:12PM +0200, Fabian Grünbichler wrote:
> ---
> Note: abstract part, apply together with container and qemu-server patch
> 
>  src/PVE/AbstractConfig.pm | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
> 
> diff --git a/src/PVE/AbstractConfig.pm b/src/PVE/AbstractConfig.pm
> index 0799c8b..ac12fd1 100644
> --- a/src/PVE/AbstractConfig.pm
> +++ b/src/PVE/AbstractConfig.pm
> @@ -286,6 +286,13 @@ sub __snapshot_rollback_vm_start {
>      die "abstract method - implement me\n";
>  }
>  
> +# Get list of volume IDs which are referenced in $conf, but not in $snap.
> +sub __snapshot_rollback_get_unused {
> +    my ($class, $conf, $snap) = @_;
> +
> +    die "abstract method - implement me\n";
> +}
> +
>  # Iterate over all configured volumes, calling $func for each key/value pair.
>  sub __snapshot_foreach_volume {
>      my ($class, $conf, $func) = @_;
> @@ -603,6 +610,12 @@ sub snapshot_rollback {
>  	my $forcemachine;
>  
>  	if (!$prepare) {
> +	    my $unused = $class->__snapshot_rollback_get_unused($conf, $snap);
> +
> +	    foreach my $volid (@$unused) {
> +		$class->add_unused_volume($conf, $volid);
> +	    }
> +
>  	    my $has_machine_config = defined($conf->{machine});
>  
>  	    # copy snapshot config to current config
> -- 
> 2.1.4
> 
> 
> _______________________________________________
> 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