Commit 2d5dfca8 authored by rodrigo.calheiros's avatar rodrigo.calheiros

Fixed Bug #34: Call getVm(vmId, userId) Function had swaped parameters in…

Fixed Bug #34: Call getVm(vmId, userId) Function had swaped parameters in several parts of the Datacenter class.
parent 7e9f686a
...@@ -386,7 +386,7 @@ public class Datacenter extends SimEntity { ...@@ -386,7 +386,7 @@ public class Datacenter extends SimEntity {
userId = data[1]; userId = data[1];
vmId = data[2]; vmId = data[2];
status = getVmAllocationPolicy().getHost(vmId, userId).getVm(userId, vmId).getCloudletScheduler() status = getVmAllocationPolicy().getHost(vmId, userId).getVm(vmId,userId).getCloudletScheduler()
.getCloudletStatus(cloudletId); .getCloudletStatus(cloudletId);
} }
...@@ -397,7 +397,7 @@ public class Datacenter extends SimEntity { ...@@ -397,7 +397,7 @@ public class Datacenter extends SimEntity {
cloudletId = cl.getCloudletId(); cloudletId = cl.getCloudletId();
userId = cl.getUserId(); userId = cl.getUserId();
status = getVmAllocationPolicy().getHost(vmId, userId).getVm(userId, vmId) status = getVmAllocationPolicy().getHost(vmId, userId).getVm(vmId,userId)
.getCloudletScheduler().getCloudletStatus(cloudletId); .getCloudletScheduler().getCloudletStatus(cloudletId);
} catch (Exception e) { } catch (Exception e) {
Log.printLine(getName() + ": Error in processing CloudSimTags.CLOUDLET_STATUS"); Log.printLine(getName() + ": Error in processing CloudSimTags.CLOUDLET_STATUS");
...@@ -653,7 +653,7 @@ public class Datacenter extends SimEntity { ...@@ -653,7 +653,7 @@ public class Datacenter extends SimEntity {
int destId = array[4]; int destId = array[4];
// get the cloudlet // get the cloudlet
Cloudlet cl = getVmAllocationPolicy().getHost(vmId, userId).getVm(userId, vmId) Cloudlet cl = getVmAllocationPolicy().getHost(vmId, userId).getVm(vmId,userId)
.getCloudletScheduler().cloudletCancel(cloudletId); .getCloudletScheduler().cloudletCancel(cloudletId);
boolean failed = false; boolean failed = false;
...@@ -675,7 +675,7 @@ public class Datacenter extends SimEntity { ...@@ -675,7 +675,7 @@ public class Datacenter extends SimEntity {
// the cloudlet will migrate from one vm to another does the destination VM exist? // the cloudlet will migrate from one vm to another does the destination VM exist?
if (destId == getId()) { if (destId == getId()) {
Vm vm = getVmAllocationPolicy().getHost(vmDestId, userId).getVm(userId, vmDestId); Vm vm = getVmAllocationPolicy().getHost(vmDestId, userId).getVm(vmDestId,userId);
if (vm == null) { if (vm == null) {
failed = true; failed = true;
} else { } else {
...@@ -824,7 +824,7 @@ public class Datacenter extends SimEntity { ...@@ -824,7 +824,7 @@ public class Datacenter extends SimEntity {
* @post $none * @post $none
*/ */
protected void processCloudletResume(int cloudletId, int userId, int vmId, boolean ack) { protected void processCloudletResume(int cloudletId, int userId, int vmId, boolean ack) {
double eventTime = getVmAllocationPolicy().getHost(vmId, userId).getVm(userId, vmId) double eventTime = getVmAllocationPolicy().getHost(vmId, userId).getVm(vmId,userId)
.getCloudletScheduler().cloudletResume(cloudletId); .getCloudletScheduler().cloudletResume(cloudletId);
boolean status = false; boolean status = false;
...@@ -859,7 +859,7 @@ public class Datacenter extends SimEntity { ...@@ -859,7 +859,7 @@ public class Datacenter extends SimEntity {
* @post $none * @post $none
*/ */
protected void processCloudletPause(int cloudletId, int userId, int vmId, boolean ack) { protected void processCloudletPause(int cloudletId, int userId, int vmId, boolean ack) {
boolean status = getVmAllocationPolicy().getHost(vmId, userId).getVm(userId, vmId) boolean status = getVmAllocationPolicy().getHost(vmId, userId).getVm(vmId,userId)
.getCloudletScheduler().cloudletPause(cloudletId); .getCloudletScheduler().cloudletPause(cloudletId);
if (ack) { if (ack) {
...@@ -885,9 +885,8 @@ public class Datacenter extends SimEntity { ...@@ -885,9 +885,8 @@ public class Datacenter extends SimEntity {
* @post $none * @post $none
*/ */
protected void processCloudletCancel(int cloudletId, int userId, int vmId) { protected void processCloudletCancel(int cloudletId, int userId, int vmId) {
Cloudlet cl = getVmAllocationPolicy().getHost(vmId, userId).getVm(userId, vmId) Cloudlet cl = getVmAllocationPolicy().getHost(vmId, userId).getVm(vmId,userId)
.getCloudletScheduler().cloudletCancel(cloudletId); .getCloudletScheduler().cloudletCancel(cloudletId);
sendNow(userId, CloudSimTags.CLOUDLET_CANCEL, cl); sendNow(userId, CloudSimTags.CLOUDLET_CANCEL, cl);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment