Merge branch '3.0.x' of ssh://git.cloud.com/var/lib/git/cloudstack-oss into 3.0.x

This commit is contained in:
Sanjay Tripathi 2012-05-07 11:17:05 +05:30
commit eef899897b
23 changed files with 152 additions and 98 deletions

1
.gitignore vendored
View File

@ -1,4 +1,5 @@
build/replace.properties
.classpath
build/build.number
bin/
*.000

View File

@ -33,7 +33,7 @@ public interface Volume extends ControlledEntity, BasedOn, StateObject<Volume.St
Expunging("The volume is being expunging"),
Destroy("The volume is destroyed, and can't be recovered."),
Uploading ("The volume upload is in progress"),
Uploaded ("The volume is uploaded"),
Uploaded ("The volume is uploaded and present on secondary storage"),
UploadError ("The volume couldnt be uploaded");
String _description;

View File

@ -1,4 +1,4 @@
host=http://localhost:8080/bridge
host=http://localhost:8080/awsapi
storage.root=/Users/john1/S3-Mount
storage.multipartDir=__multipart__uploads__
bucket.dns=false

View File

@ -10,6 +10,7 @@ label.number.of.system.vms=Number of System VMs
label.number.of.virtual.routers=Number of Virtual Routers
label.action.register.iso=Register ISO
label.isolation.method=Isolation method
label.action.register.template=Register template
#new labels (end) ************************************************************************************************

View File

@ -23,7 +23,8 @@ public class FrameBufferSizeChangeRequest extends AbstractRect {
public FrameBufferSizeChangeRequest(BufferedImageCanvas canvas, int width, int height) {
super(0, 0, width, height);
this.canvas=canvas;
this.canvas = canvas;
canvas.setCanvasSize(width, height);
}
@Override

View File

@ -71,6 +71,8 @@ public class FramebufferUpdatePacket {
case RfbConstants.ENCODING_DESKTOP_SIZE: {
rect = new FrameBufferSizeChangeRequest(canvas, width, height);
if(this.clientListener != null)
this.clientListener.onFramebufferSizeChange(width, height);
break;
}

BIN
deps/cloud-wsdl4j.jar vendored Normal file

Binary file not shown.

View File

@ -208,13 +208,15 @@ add_routing() {
return 0;
}
add_snat() {
local pubIp=$1
local ipNoMask=$(echo $1 | awk -F'/' '{print $1}')
if [ "$sflag" == "0" ]
then
logger -t cloud "$(basename $0):Remove SourceNAT $pubIp on interface $ethDev if it is present"
sudo iptables -t nat -D POSTROUTING -j SNAT -o $ethDev --to-source $ipNoMask ;
return 0;
fi
local pubIp=$1
local ipNoMask=$(echo $1 | awk -F'/' '{print $1}')
logger -t cloud "$(basename $0):Added SourceNAT $pubIp on interface $ethDev"
sudo iptables -t nat -D POSTROUTING -j SNAT -o $ethDev --to-source $ipNoMask ;
sudo iptables -t nat -A POSTROUTING -j SNAT -o $ethDev --to-source $ipNoMask ;

View File

@ -726,7 +726,7 @@ def addFWFramework(brname):
execute("iptables -I FORWARD -o " + brname + " -j DROP")
execute("iptables -I FORWARD -i " + brname + " -m physdev --physdev-is-bridged -j " + brfw)
execute("iptables -I FORWARD -o " + brname + " -m physdev --physdev-is-bridged -j " + brfw)
phydev = execute("brctl show |grep " + brname + " | awk '{print $4}'").strip()
phydev = execute("brctl show |grep -w " + brname + " | awk '{print $4}'").strip()
execute("iptables -A " + brfw + " -m state --state RELATED,ESTABLISHED -j ACCEPT")
execute("iptables -A " + brfw + " -m physdev --physdev-is-bridged --physdev-is-in -j " + brfwin)
execute("iptables -A " + brfw + " -m physdev --physdev-is-bridged --physdev-is-out -j " + brfwout)

View File

@ -2335,6 +2335,10 @@ public class VirtualNetworkApplianceManagerImpl implements VirtualNetworkApplian
boolean add = (ipAddr.getState() == IpAddress.State.Releasing ? false : true);
boolean sourceNat = ipAddr.isSourceNat();
/* enable sourceNAT for the first ip of the public interface */
if (firstIP) {
sourceNat = true;
}
String vlanId = ipAddr.getVlanTag();
String vlanGateway = ipAddr.getGateway();
String vlanNetmask = ipAddr.getNetmask();

View File

@ -226,4 +226,6 @@ public interface StorageManager extends StorageService, Manager {
Long clusterId, ServiceOfferingVO offering,
DiskOfferingVO diskOffering, List<StoragePoolVO> avoids, long size,
HypervisorType hyperType) throws NoTransitionException;
String getSupportedImageFormatForCluster(Long clusterId);
}

View File

@ -3802,4 +3802,21 @@ public class StorageManagerImpl implements StorageManager, Manager, ClusterManag
return _volumeDao.search(sc, searchFilter);
}
@Override
public String getSupportedImageFormatForCluster(Long clusterId) {
ClusterVO cluster = ApiDBUtils.findClusterById(clusterId);
if (cluster.getHypervisorType() == HypervisorType.XenServer) {
return "vhd";
} else if (cluster.getHypervisorType() == HypervisorType.KVM) {
return "qcow2";
} else if (cluster.getHypervisorType() == HypervisorType.VMware) {
return "ova";
} else if (cluster.getHypervisorType() == HypervisorType.Ovm) {
return "raw";
} else {
return null;
}
}
}

View File

@ -108,7 +108,7 @@ public class PremiumDatabaseUpgradeChecker extends DatabaseUpgradeChecker {
new Upgrade30to301(), new Upgrade301to302(), new Upgrade302to303() });
_upgradeMap.put("2.2.10", new DbUpgrade[] { new Upgrade2210to2211(), new Upgrade2211to2212Premium(),
new Upgrade2212to2213(), new Upgrade2213to2214(), new Upgrade2214to30(), new Upgrade30to301(),
new Upgrade2212to2213(), new Upgrade2213to2214(), new Upgrade2214to30(), new Upgrade30to301(), new Upgrade301to302(),
new Upgrade302to303() });
_upgradeMap.put("2.2.11", new DbUpgrade[] { new Upgrade2211to2212Premium(), new Upgrade2212to2213(),

View File

@ -590,6 +590,11 @@ public class UserVmManagerImpl implements UserVmManager, UserVmService, Manager
volume = _storageMgr.createVolume(volume, vm, rootDiskTmplt, dcVO, pod, rootDiskPool.getClusterId(), svo, diskVO, new ArrayList<StoragePoolVO>(), volume.getSize(), rootDiskHyperType);
}else {
try {
// Format of data disk should be the same as root disk
if(_storageMgr.getSupportedImageFormatForCluster(rootDiskPool.getClusterId()) != volHostVO.getFormat().getFileExtension()){
throw new InvalidParameterValueException("Failed to attach volume to VM since volumes format " +volHostVO.getFormat().getFileExtension()+
" is not compatible with the vm hypervisor type" );
}
volume = _storageMgr.copyVolumeFromSecToPrimary(volume, vm, rootDiskTmplt, dcVO, pod, rootDiskPool.getClusterId(), svo, diskVO, new ArrayList<StoragePoolVO>(), volume.getSize(), rootDiskHyperType);
} catch (NoTransitionException e) {
e.printStackTrace();

View File

@ -1,5 +1,4 @@
/*[fmt]1C20-1C0D-E*/
/*dmin*/
/*+clearfix {*/
div.toolbar:after,
.multi-wizard .progress ul li:after,
@ -5453,6 +5452,10 @@ label.error {
overflow: hidden;
}
.multi-wizard.zone-wizard .setup-guest-traffic.basic .select-container {
background: #FFFFFF;
}
.multi-wizard.zone-wizard .main-desc {
width: 516px;
float: left;

View File

@ -51,10 +51,7 @@
// For localization
return str;
},
label: 'label.state',
converter: function(str) {
return 'state.' + str;
},
label: 'label.state',
indicator: {
'enabled': 'on',
'Destroyed': 'off',

View File

@ -47,11 +47,7 @@
instancename: { label: 'label.internal.name' },
zonename: { label: 'label.zone.name' },
state: {
label: 'label.state',
converter: function(str) {
// For localization
return 'state.' + str;
},
label: 'label.state',
indicator: {
'Running': 'on',
'Stopped': 'off',

View File

@ -576,16 +576,13 @@
displaytext: { label: 'label.display.name' },
domain: { label: 'label.domain' },
account: { label: 'label.owner.account' },
state: {
converter: function(str) {
// For localization
return 'state.' + str;
},
label: 'label.status', indicator: {
converter: function(str) {
return 'state.' + str;
},
'Active': 'on', 'Destroyed': 'off', 'Disabled': 'off', 'Left Project': 'off'
state: {
label: 'label.status',
indicator: {
'Active': 'on',
'Destroyed': 'off',
'Disabled': 'off',
'Left Project': 'off'
}
}
},
@ -870,11 +867,7 @@
project: { label: 'label.project' },
domain: { label: 'label.domain' },
state: {
label: 'label.status',
converter: function(str) {
// For localization
return 'state.' + str;
},
label: 'label.status',
indicator: {
'Accepted': 'on', 'Completed': 'on',
'Pending': 'off', 'Declined': 'off'

View File

@ -35,14 +35,12 @@
type: { label: 'label.type' },
storagetype: { label: 'label.storage.type' },
vmdisplayname: { label: 'label.vm.display.name' },
state: {
converter: function(str) {
// For localization
return 'state.' + str;
},
label: 'State',
indicator: { 'Ready': 'on' }
}
state: {
label: 'State',
indicator: {
'Ready': 'on'
}
}
},
// List view actions
@ -1000,16 +998,11 @@
volumename: { label: 'label.volume' },
intervaltype: { label: 'label.interval.type' },
created: { label: 'label.created', converter: cloudStack.converters.toLocalDate },
state: {
converter: function(str) {
// For localization
return 'state.'+str;
},
label: 'label.state', indicator: {
converter: function(str) {
return 'state.' + str;
},
'BackedUp': 'on', 'Destroyed': 'off'
state: {
label: 'label.state',
indicator: {
'BackedUp': 'on',
'Destroyed': 'off'
}
}
},

View File

@ -1258,7 +1258,7 @@
var selectedNetworkOfferingId = $(this).val();
$(networkOfferingObjs).each(function(){
if(this.id == selectedNetworkOfferingId) {
if(this.guestiptype == "Isolated") {
if(this.guestiptype == "Isolated") { //*** Isolated ***
if(this.specifyipranges == false) {
$form.find('.form-item[rel=guestStartIp]').hide();
$form.find('.form-item[rel=guestEndIp]').hide();
@ -1266,26 +1266,40 @@
else {
$form.find('.form-item[rel=guestStartIp]').css('display', 'inline-block');
$form.find('.form-item[rel=guestEndIp]').css('display', 'inline-block');
}
var includingSourceNat = false;
var serviceObjArray = this.service;
for(var k = 0; k < serviceObjArray.length; k++) {
if(serviceObjArray[k].name == "SourceNat") {
includingSourceNat = true;
break;
}
}
if(includingSourceNat == true) { //Isolated with SourceNat
cloudStack.dialog.createFormField.validation.required.remove($form.find('.form-item[rel=guestGateway]')); //make guestGateway optional
cloudStack.dialog.createFormField.validation.required.remove($form.find('.form-item[rel=guestNetmask]')); //make guestNetmask optional
}
//cloudStack.dialog.createFormField.validation.required.remove($form.find('.form-item[rel=guestGateway]')); //make guestGateway optional
//cloudStack.dialog.createFormField.validation.required.remove($form.find('.form-item[rel=guestNetmask]')); //make guestNetmask optional
else { //Isolated with no SourceNat
cloudStack.dialog.createFormField.validation.required.add($form.find('.form-item[rel=guestGateway]')); //make guestGateway required
cloudStack.dialog.createFormField.validation.required.add($form.find('.form-item[rel=guestNetmask]')); //make guestNetmask required
}
}
else { //this.guestiptype == "Shared"
else { //*** Shared ***
$form.find('.form-item[rel=guestStartIp]').css('display', 'inline-block');
$form.find('.form-item[rel=guestEndIp]').css('display', 'inline-block');
//cloudStack.dialog.createFormField.validation.required.add($form.find('.form-item[rel=guestGateway]')); //make guestGateway required
//cloudStack.dialog.createFormField.validation.required.add($form.find('.form-item[rel=guestNetmask]')); //make guestNetmask required
cloudStack.dialog.createFormField.validation.required.add($form.find('.form-item[rel=guestGateway]')); //make guestGateway required
cloudStack.dialog.createFormField.validation.required.add($form.find('.form-item[rel=guestNetmask]')); //make guestNetmask required
}
if(this.specifyvlan == false) {
$form.find('.form-item[rel=vlanId]').hide();
//cloudStack.dialog.createFormField.validation.required.remove($form.find('.form-item[rel=vlanId]')); //make vlanId optional
cloudStack.dialog.createFormField.validation.required.remove($form.find('.form-item[rel=vlanId]')); //make vlanId optional
}
else {
$form.find('.form-item[rel=vlanId]').css('display', 'inline-block');
//cloudStack.dialog.createFormField.validation.required.add($form.find('.form-item[rel=vlanId]')); //make vlanId required
cloudStack.dialog.createFormField.validation.required.add($form.find('.form-item[rel=vlanId]')); //make vlanId required
}
return false; //break each loop
}
@ -7815,10 +7829,7 @@
'Enabled': 'on',
'Disabled': 'off',
'Destroyed': 'off'
},
converter: function(str) {
return 'state.' + str;
}
}
}
},

View File

@ -53,6 +53,7 @@
var fields = $.map(args.form.fields, function(value, key) {
return key;
})
$(fields).each(function() {
var key = this;
var field = args.form.fields[key];
@ -86,15 +87,21 @@
closeOnEscape: false
}); */
// Label field
//if( field.label == 'label.network.offering' || field.label == 'label.guest.gateway')
// debugger;
var $name = $('<div>').addClass('name')
.appendTo($formItem)
.append(
$('<label>').html(_l(field.label) + ':')
);
// Add 'required asterisk' if field is required
if (field.validation && field.validation.required) {
$name.find('label').prepend($('<span>').addClass('field-required').html('*'));
// red asterisk
var $astersikSpan = $('<span>').addClass('field-required').html('*');
$name.find('label').prepend($astersikSpan);
if (field.validation == null || field.validation.required == false) {
$astersikSpan.hide();
}
// Tooltip description
@ -314,25 +321,31 @@
$input.addClass("disallowSpecialCharacters");
}
$input.data('validation-rules', field.validation);
$('<label>').addClass('error').appendTo($value).html('*' + _l('label.required'));
if(field.validation != null)
$input.data('validation-rules', field.validation);
else
$input.data('validation-rules', {});
});
$form.find('select').trigger('change');
var getFormValues = function() {
var formValues = {};
$.each(args.form.fields, function(key) {});
};
// Setup form validation
// Setup form validation
$formContainer.find('form').validate();
$formContainer.find('input, select').each(function() {
$formContainer.find('input, select').each(function() {
if ($(this).data('validation-rules')) {
$(this).rules('add', $(this).data('validation-rules'));
}
});
else {
$(this).rules('add', {});
}
});
$form.find('select').trigger('change');
var complete = function($formContainer) {
var $form = $formContainer.find('form');
var data = cloudStack.serializeForm($form);
@ -404,31 +417,36 @@
createFormField: {
validation: {
required: {
add: function($formField) {
if($formField.find('.name').find('label').find('span.field-required').length == 0) {
$formField.find('.name').find('label').prepend($('<span>').addClass('field-required').html('*'));
var $input = $formField.find('input');
var validationRules = $input.data('validation-rules');
add: function($formField) {
var $input = $formField.find('input, select');
var validationRules = $input.data('validation-rules');
if(validationRules == null || validationRules.required == null || validationRules.required == false) {
$formField.find('.name').find('label').find('span.field-required').css('display', 'inline'); //show red asterisk
if(validationRules == null)
validationRules = {};
validationRules = {};
validationRules.required = true;
$input.data('validation-rules', validationRules);
}
},
remove: function($formField) {
if($formField.find('.name').find('label').find('span.field-required').length > 0) {
$formField.find('.name').find('label').find('span.field-required').remove();
var $input = $formField.find('input');
var validationRules = $input.data('validation-rules');
if(validationRules != null && validationRules.required != null)
delete validationRules.required;
$input.data('validation-rules', validationRules);
//$formField.find('.value').find('label.error[generated=true]').remove();
$formField.find('.value').find('label.error').hide();
}
$input.rules('add', { required: true });
}
},
remove: function($formField) {
var $input = $formField.find('input, select');
var validationRules = $input.data('validation-rules');
if(validationRules != null && validationRules.required != null && validationRules.required == true) {
$formField.find('.name').find('label').find('span.field-required').hide(); //hide red asterisk
delete validationRules.required;
$input.data('validation-rules', validationRules);
$input.rules('remove', 'required');
$formField.find('.value').find('label.error').hide();
}
}
}
}

View File

@ -235,6 +235,14 @@
},
configureGuestTraffic: function(args) {
if (args.data['network-model'] == 'Basic') {
$('.setup-guest-traffic').addClass('basic');
$('.setup-guest-traffic').removeClass('advanced');
} else {
$('.setup-guest-traffic').removeClass('basic');
$('.setup-guest-traffic').addClass('advanced');
}
return args.data['network-model'] == 'Basic' ||
$.grep(args.groupedData.physicalNetworks, function(network) {
return $.inArray('guest', network.trafficTypes) > -1;

View File

@ -77,7 +77,7 @@ def build_jars ():
"cloud-servlet-api.jar", "cloud-commons-logging-1.1.1.jar",
"cloud-ws-commons-util-1.0.2.jar",
"cloud-commons-collections-3.2.1.jar", "vmware*.jar", "cloud-secstorage-extras.jar",
"cloud-agent-simulator.jar", "cloud-awsapi.jar", "cloud-test.jar"]
"cloud-agent-simulator.jar", "cloud-awsapi.jar", "cloud-test.jar", "cloud-wsdl4j.jar"]
for a in jars_str:
if _basename (a).startswith ("cloud-") \
@ -112,7 +112,7 @@ def build_thirdparty_dir ():
def build_dependences ():
excludes = ["cloud-xstream-1.3.1.jar", "cloud-servlet-api.jar", "cloud-commons-logging-1.1.1.jar",
"cloud-ws-commons-util-1.0.2.jar",
"cloud-commons-collections-3.2.1.jar"]
"cloud-commons-collections-3.2.1.jar", "cloud-wsdl4j.jar"]
start_path = bld.path.find_dir ("deps")
bld.install_files('${JAVADIR}',start_path.ant_glob("*.jar", excl = excludes), cwd=start_path)