[pve-devel] [PATCH container] Only add actual volumes to volid_list

Wolfgang Bumiller w.bumiller at proxmox.com
Thu Feb 4 11:21:35 CET 2016


On Thu, Feb 04, 2016 at 11:08:05AM +0100, Fabian Grünbichler wrote:
> skip /dev and bind mounts, otherwise stop backups will
> fail in parse_volume_id.
> ---
>  src/PVE/VZDump/LXC.pm | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/src/PVE/VZDump/LXC.pm b/src/PVE/VZDump/LXC.pm
> index dddf17e..fda37c9 100644
> --- a/src/PVE/VZDump/LXC.pm
> +++ b/src/PVE/VZDump/LXC.pm
> @@ -132,6 +132,7 @@ sub prepare {
>      my ($id_map, $rootuid, $rootgid) = PVE::LXC::parse_id_maps($conf);
>      $task->{userns_cmd} = PVE::LXC::userns_command($id_map);
>  
> +    my $volid_list = [];
>      PVE::LXC::foreach_mountpoint($conf, sub {
>  	my ($name, $data) = @_;
>  	my $volid = $data->{volume};
> @@ -146,8 +147,9 @@ sub prepare {
>  	}
>  
>  	push @$disks, $data;
> +	push @$volid_list, $volid
> +	    if $type eq 'volume';
>      });
> -    my $volid_list = [map { $_->{volume} } @$disks];
>  
>      if ($mode eq 'snapshot') {
>  	if (!PVE::LXC::has_feature('vzdump', $conf, $storage_cfg)) {
> @@ -219,6 +221,7 @@ sub snapshot {
>  	if !($conf->{snapshots} && $conf->{snapshots}->{vzdump});
>  
>      my $disks = $task->{disks};
> +    #todo: reevaluate bind/dev mount handling when implementing snapshots for mps
>      my $volid_list = [map { $_->{volume} } @$disks];

We could store the volid list from prepare() in $task->{volids} and
reuse it here.
(Doesn't this otherwise currently try to activate_volume() on /dev and
bindmounts?)

>  
>      my $rootdir = $default_mount_point;
> -- 
> 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