Alexander Schmid лет назад: 8
Родитель
Сommit
cffa2e7577
1 измененных файлов с 37 добавлено и 40 удалено
  1. 37 40
      QemuServer.patch

+ 37 - 40
QemuServer.patch

@@ -1,50 +1,47 @@
-5925a5926,5966
-> 	#BEGIN addition
-> 	my $src_storage_plugin = PVE::Storage::Plugin->lookup($src_scfg->{type});
-> 	my $dst_storage_plugin = PVE::Storage::Plugin->lookup($dst_scfg->{type});
-> 
-> 	# in many cases the storage may have a better idea how to convert:
-> 	# if src and dst format is the same
-> 	# and src_storeid is dst_storeid
-> 	# and the storage has the feature
-> 	# and the feature is implemented as volume_copy / volume_snapshot_copy
-> 	# let the storage do the work as it quite sure is faster
-> 	if ( $src_format eq $dst_format ) {
-> 		if( $src_storeid eq $dst_storeid ) {
-> 			# this is the same storage
-> 			# and storage is capable of materializing snaps
-> 			if( $snapname ) {
-> 				my $canCopySnap = PVE::Storage::volume_has_feature($storecfg, 'copy', $src_volid, $snapname, undef) && $src_storage_plugin->can('volume_snapshot_copy');
-> 				if( $canCopySnap ) {
-> 					print "delegate to storage plugin volume_snapshot_copy (snap $snapname)\n";
-> 					$src_storage_plugin->volume_snapshot_copy($src_scfg, $src_volname, $snapname, $dst_volname);
+5936a5937,5976
+> 		#BEGIN addition
+> 		my $src_storage_plugin = PVE::Storage::Plugin->lookup($src_scfg->{type});
+> 		my $dst_storage_plugin = PVE::Storage::Plugin->lookup($dst_scfg->{type});
+> 
+> 		# in many cases the storage may have a better idea how to convert:
+> 		# if src and dst format is the same
+> 		# and src_storeid is dst_storeid
+> 		# and the storage has the feature
+> 		# and the feature is implemented as volume_copy / volume_snapshot_copy
+> 		# let the storage do the work as it quite sure is faster
+> 		if ( $src_format eq $dst_format ) {
+> 			if( $src_storeid eq $dst_storeid ) {
+> 				# this is the same storage
+> 				# and storage is capable of materializing snaps
+> 				if( $snapname ) {
+> 					my $canCopySnap = PVE::Storage::volume_has_feature($storecfg, 'copy', $src_volid, $snapname, undef) && $src_storage_plugin->can('volume_snapshot_copy');
+> 					if( $canCopySnap ) {
+> 						print "delegate to storage plugin volume_snapshot_copy (snap $snapname)\n";
+> 						$src_storage_plugin->volume_snapshot_copy($src_scfg, $src_volname, $snapname, $dst_volname);
+> 
+> 						$src_storage_plugin->deactivate_volume($src_storeid, $src_scfg, $src_volname, $snapname);
+> 
+> 						return 1;
+> 					}
+> 				}
+> 
+> 				my $canCopyVolume = PVE::Storage::volume_has_feature($storecfg, 'copy', $src_volid, undef, undef) && $src_storage_plugin->can('volume_copy');
+> 				if ( $canCopyVolume ) {
+> 					print "delegate to storage plugin: volume_copy (base)\n";
+> 					$src_storage_plugin->volume_copy($src_scfg, $src_volname, $dst_volname);
 > 
 > 					$src_storage_plugin->deactivate_volume($src_storeid, $src_scfg, $src_volname, $snapname);
 > 
 > 					return 1;
 > 				}
 > 			}
-> 
-> 			my $canCopyVolume = PVE::Storage::volume_has_feature($storecfg, 'copy', $src_volid, undef, undef) && $src_storage_plugin->can('volume_copy');
-> 			if ( $canCopyVolume ) {
-> 				print "delegate to storage plugin: volume_copy (base)\n";
-> 				$src_storage_plugin->volume_copy($src_scfg, $src_volname, $dst_volname);
-> 
-> 				$src_storage_plugin->deactivate_volume($src_storeid, $src_scfg, $src_volname, $snapname);
-> 
-> 				return 1;
-> 			}
+> 			# @todo: two zfs-storages might be able to receive stream from each other
 > 		}
-> 		# @todo: two zfs-storages might be able to receive stream from each other
-> 	}
-> 	#END addition
-> 
-> 
-5949a5991,5995
+> 		#END addition
 > 
-> 	# added: deactivate the src-volume, even on failure
-> 	# this can be safely called as qemu_img_convert is never called on a running volume (that is not a snap)
-> 	$src_storage_plugin->deactivate_volume($src_storeid, $src_scfg, $src_volname, $snapname);
+5960a6001,6005
 > 
-5950a5997
+> 		# added: deactivate the src-volume, even on failure
+> 		# this can be safely called as qemu_img_convert is never called on a running volume (that is not a snap)
+> 		$src_storage_plugin->deactivate_volume($src_storeid, $src_scfg, $src_volname, $snapname);
 >