mirror of
				https://github.com/apache/cloudstack.git
				synced 2025-10-26 08:42:29 +01:00 
			
		
		
		
	Remove the VHD template signature check when downdloading template.
There are lots tools can create VHD disk: xenserver, xenconverter, hyper-v, platespin, etc. And some tools didn't create a correct signature.
This commit is contained in:
		
							parent
							
								
									3acc84282f
								
							
						
					
					
						commit
						59912c09c9
					
				| @ -91,22 +91,7 @@ public class VhdProcessor implements Processor { | |||||||
|             } |             } | ||||||
|         } |         } | ||||||
|          |          | ||||||
|         boolean findKnownCreator = false; |         //imageSignatureCheck(creatorApp); | ||||||
|         for (int i = 0; i < citrix_creator_app.length; i++) { |  | ||||||
|         	if (Arrays.equals(creatorApp, citrix_creator_app[i])) { |  | ||||||
|         		findKnownCreator = true; |  | ||||||
|         		break; |  | ||||||
|         	} |  | ||||||
|         } |  | ||||||
|         if (!findKnownCreator) { |  | ||||||
|         	/*Only support VHD image created by citrix xenserver, and xenconverter*/ |  | ||||||
|         	String readableCreator = ""; |  | ||||||
|         	for (int j = 0; j < creatorApp.length; j++) { |  | ||||||
|         		readableCreator += (char)creatorApp[j]; |  | ||||||
|         	} |  | ||||||
|         	throw new InternalErrorException("Image creator is:" + readableCreator +", is not supported"); |  | ||||||
|         } |  | ||||||
| 		 |  | ||||||
|          |          | ||||||
|         long templateSize = NumbersUtil.bytesToLong(currentSize); |         long templateSize = NumbersUtil.bytesToLong(currentSize); | ||||||
|         info.virtualSize = templateSize; |         info.virtualSize = templateSize; | ||||||
| @ -139,4 +124,22 @@ public class VhdProcessor implements Processor { | |||||||
|     public boolean stop() { |     public boolean stop() { | ||||||
|         return true; |         return true; | ||||||
|     } |     } | ||||||
|  |      | ||||||
|  |     private void imageSignatureCheck(byte[] creatorApp) throws InternalErrorException { | ||||||
|  |     	boolean findKnownCreator = false; | ||||||
|  |     	for (int i = 0; i < citrix_creator_app.length; i++) { | ||||||
|  |     		if (Arrays.equals(creatorApp, citrix_creator_app[i])) { | ||||||
|  |     			findKnownCreator = true; | ||||||
|  |     			break; | ||||||
|  |     		} | ||||||
|  |     	} | ||||||
|  |     	if (!findKnownCreator) { | ||||||
|  |     		/*Only support VHD image created by citrix xenserver, and xenconverter*/ | ||||||
|  |     		String readableCreator = ""; | ||||||
|  |     		for (int j = 0; j < creatorApp.length; j++) { | ||||||
|  |     			readableCreator += (char)creatorApp[j]; | ||||||
|  |     		} | ||||||
|  |     		throw new InternalErrorException("Image creator is:" + readableCreator +", is not supported"); | ||||||
|  |     	} | ||||||
|  |     } | ||||||
| } | } | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user