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:
edison su 2010-08-13 11:39:55 -07:00
parent 3acc84282f
commit 59912c09c9

View File

@ -91,22 +91,7 @@ public class VhdProcessor implements Processor {
}
}
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");
}
//imageSignatureCheck(creatorApp);
long templateSize = NumbersUtil.bytesToLong(currentSize);
info.virtualSize = templateSize;
@ -139,4 +124,22 @@ public class VhdProcessor implements Processor {
public boolean stop() {
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");
}
}
}