Skip to content

Commit 044e685

Browse files
committed
Revert "CLOUDSTACK-8748: VM UUID accessible in CreateVMSnapshotCommand and RevertToVMSnapshotCommand"
This reverts commit 180afe5. This broke the build on master: master build broken with the below error http://jenkins.buildacloud.org/job/build-master-slowbuild/2101/consoleText ``` [INFO] ------------------------------------------------------------- [ERROR] COMPILATION ERROR : [INFO] ------------------------------------------------------------- [ERROR] /home/jenkins/acs/workspace/build-master-slowbuild/plugins/hypervisors/xenserver/test/com/cloud/hypervisor/xenserver/resource/wrapper/xenbase/CitrixRequestWrapperTest.java:[1581,51] error: constructor CreateVMSnapshotCommand in class CreateVMSnapshotCommand cannot be applied to given types; [ERROR] required: String,String,VMSnapshotTO,List<VolumeObjectTO>,String found: String,VMSnapshotTO,List<VolumeObjectTO>,String reason: actual and formal argument lists differ in length /home/jenkins/acs/workspace/build-master-slowbuild/plugins/hypervisors/xenserver/test/com/cloud/hypervisor/xenserver/resource/wrapper/xenbase/CitrixRequestWrapperTest.java:[1623,53] error: no suitable constructor found for RevertToVMSnapshotCommand(String,VMSnapshotTO,List<VolumeObjectTO>,String) [INFO] 2 errors [INFO] ------------------------------------------------------------- ``` This was PR apache#717 towards 4.5
1 parent 180afe5 commit 044e685

4 files changed

Lines changed: 7 additions & 19 deletions

File tree

‎core/src/com/cloud/agent/api/CreateVMSnapshotCommand.java‎

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,8 @@
2525

2626

2727
public class CreateVMSnapshotCommand extends VMSnapshotBaseCommand {
28-
private String vmUuid;
2928

30-
public CreateVMSnapshotCommand(String vmName, String vmUuid, VMSnapshotTO snapshot, List<VolumeObjectTO> volumeTOs, String guestOSType) {
29+
public CreateVMSnapshotCommand(String vmName, VMSnapshotTO snapshot, List<VolumeObjectTO> volumeTOs, String guestOSType) {
3130
super(vmName, snapshot, volumeTOs, guestOSType);
32-
this.vmUuid = vmUuid;
33-
}
34-
35-
public String getVmUuid() {
36-
return vmUuid;
3731
}
3832
}

‎core/src/com/cloud/agent/api/RevertToVMSnapshotCommand.java‎

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,16 @@
2525

2626
public class RevertToVMSnapshotCommand extends VMSnapshotBaseCommand {
2727

28-
public RevertToVMSnapshotCommand(String vmName, String vmUuid, VMSnapshotTO snapshot, List<VolumeObjectTO> volumeTOs, String guestOSType) {
28+
public RevertToVMSnapshotCommand(String vmName, VMSnapshotTO snapshot, List<VolumeObjectTO> volumeTOs, String guestOSType) {
2929
super(vmName, snapshot, volumeTOs, guestOSType);
30-
this.vmUuid = vmUuid;
3130
}
3231

33-
public RevertToVMSnapshotCommand(String vmName, String vmUuid, VMSnapshotTO snapshot, List<VolumeObjectTO> volumeTOs, String guestOSType, boolean reloadVm) {
34-
this(vmName, vmUuid, snapshot, volumeTOs, guestOSType);
32+
public RevertToVMSnapshotCommand(String vmName, VMSnapshotTO snapshot, List<VolumeObjectTO> volumeTOs, String guestOSType, boolean reloadVm) {
33+
this(vmName, snapshot, volumeTOs, guestOSType);
3534
setReloadVm(reloadVm);
3635
}
3736

3837
private boolean reloadVm = false;
39-
private String vmUuid;
4038

4139
public boolean isReloadVm() {
4240
return reloadVm;
@@ -45,8 +43,4 @@ public boolean isReloadVm() {
4543
public void setReloadVm(boolean reloadVm) {
4644
this.reloadVm = reloadVm;
4745
}
48-
49-
public String getVmUuid() {
50-
return vmUuid;
51-
}
5246
}

‎engine/storage/snapshot/src/org/apache/cloudstack/storage/vmsnapshot/DefaultVMSnapshotStrategy.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ public VMSnapshot takeVMSnapshot(VMSnapshot vmSnapshot) {
137137
HostVO host = hostDao.findById(hostId);
138138
GuestOSHypervisorVO guestOsMapping = guestOsHypervisorDao.findByOsIdAndHypervisor(guestOS.getId(), host.getHypervisorType().toString(), host.getHypervisorVersion());
139139

140-
CreateVMSnapshotCommand ccmd = new CreateVMSnapshotCommand(userVm.getInstanceName(), userVm.getUuid(), target, volumeTOs, guestOS.getDisplayName());
140+
CreateVMSnapshotCommand ccmd = new CreateVMSnapshotCommand(userVm.getInstanceName(), target, volumeTOs, guestOS.getDisplayName());
141141
if (guestOsMapping == null) {
142142
ccmd.setPlatformEmulator(null);
143143
} else {
@@ -350,7 +350,7 @@ public boolean revertVMSnapshot(VMSnapshot vmSnapshot) {
350350
snapshot.getCurrent(), parent, true);
351351
Long hostId = vmSnapshotHelper.pickRunningHost(vmSnapshot.getVmId());
352352
GuestOSVO guestOS = guestOSDao.findById(userVm.getGuestOSId());
353-
RevertToVMSnapshotCommand revertToSnapshotCommand = new RevertToVMSnapshotCommand(vmInstanceName, userVm.getUuid(), vmSnapshotTO, volumeTOs, guestOS.getDisplayName());
353+
RevertToVMSnapshotCommand revertToSnapshotCommand = new RevertToVMSnapshotCommand(vmInstanceName, vmSnapshotTO, volumeTOs, guestOS.getDisplayName());
354354
HostVO host = hostDao.findById(hostId);
355355
GuestOSHypervisorVO guestOsMapping = guestOsHypervisorDao.findByOsIdAndHypervisor(guestOS.getId(), host.getHypervisorType().toString(), host.getHypervisorVersion());
356356
if (guestOsMapping == null) {

‎engine/storage/src/org/apache/cloudstack/storage/helper/HypervisorHelperImpl.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ public VMSnapshotTO quiesceVm(VirtualMachine virtualMachine) {
124124
GuestOSVO guestOS = guestOSDao.findById(virtualMachine.getGuestOSId());
125125
List<VolumeObjectTO> volumeTOs = vmSnapshotHelper.getVolumeTOList(virtualMachine.getId());
126126
CreateVMSnapshotCommand ccmd =
127-
new CreateVMSnapshotCommand(virtualMachine.getInstanceName(), virtualMachine.getUuid(), vmSnapshotTO, volumeTOs, guestOS.getDisplayName());
127+
new CreateVMSnapshotCommand(virtualMachine.getInstanceName(), vmSnapshotTO, volumeTOs, guestOS.getDisplayName());
128128
HostVO host = hostDao.findById(hostId);
129129
GuestOSHypervisorVO guestOsMapping = guestOsHypervisorDao.findByOsIdAndHypervisor(guestOS.getId(), host.getHypervisorType().toString(), host.getHypervisorVersion());
130130
ccmd.setPlatformEmulator(guestOsMapping.getGuestOsName());

0 commit comments

Comments
 (0)