mirror of
				https://git.proxmox.com/git/qemu-server
				synced 2025-11-04 04:13:26 +00:00 
			
		
		
		
	restore: refactor archive parsing
to avoid duplicate work, always set 'volid' to the backup volume's volid, if it was successfully parsed as such. Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
This commit is contained in:
		
							parent
							
								
									c961ab6d80
								
							
						
					
					
						commit
						c36214d2a6
					
				@ -750,20 +750,20 @@ my $parse_restore_archive = sub {
 | 
			
		||||
 | 
			
		||||
    my ($archive_storeid, $archive_volname) = PVE::Storage::parse_volume_id($archive, 1);
 | 
			
		||||
 | 
			
		||||
    my $res = {};
 | 
			
		||||
 | 
			
		||||
    if (defined($archive_storeid)) {
 | 
			
		||||
	my $scfg =  PVE::Storage::storage_config($storecfg, $archive_storeid);
 | 
			
		||||
	$res->{volid} = $archive;
 | 
			
		||||
	if ($scfg->{type} eq 'pbs') {
 | 
			
		||||
	    return {
 | 
			
		||||
		type => 'pbs',
 | 
			
		||||
		volid => $archive,
 | 
			
		||||
	    };
 | 
			
		||||
	    $res->{type} = 'pbs';
 | 
			
		||||
	    return $res;
 | 
			
		||||
	}
 | 
			
		||||
    }
 | 
			
		||||
    my $path = PVE::Storage::abs_filesystem_path($storecfg, $archive);
 | 
			
		||||
    return {
 | 
			
		||||
	type => 'file',
 | 
			
		||||
	path => $path,
 | 
			
		||||
    };
 | 
			
		||||
    $res->{type} = 'file';
 | 
			
		||||
    $res->{path} = $path;
 | 
			
		||||
    return $res;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user