Repository: cloudstack
Updated Branches:
  refs/heads/master 180afe52e -> 044e685c9


Revert "CLOUDSTACK-8748: VM UUID accessible in CreateVMSnapshotCommand and 
RevertToVMSnapshotCommand"

This reverts commit 180afe52e555f2610e81ccee1b2f1551b7b7f5e8.

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 #717 towards 4.5


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/044e685c
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/044e685c
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/044e685c

Branch: refs/heads/master
Commit: 044e685c92ef98d08771f04c766ec42d97fe5c35
Parents: 180afe5
Author: Remi Bergsma <[email protected]>
Authored: Thu Aug 20 07:19:53 2015 +0200
Committer: Remi Bergsma <[email protected]>
Committed: Thu Aug 20 07:21:27 2015 +0200

----------------------------------------------------------------------
 .../com/cloud/agent/api/CreateVMSnapshotCommand.java    |  8 +-------
 .../com/cloud/agent/api/RevertToVMSnapshotCommand.java  | 12 +++---------
 .../storage/vmsnapshot/DefaultVMSnapshotStrategy.java   |  4 ++--
 .../cloudstack/storage/helper/HypervisorHelperImpl.java |  2 +-
 4 files changed, 7 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/044e685c/core/src/com/cloud/agent/api/CreateVMSnapshotCommand.java
----------------------------------------------------------------------
diff --git a/core/src/com/cloud/agent/api/CreateVMSnapshotCommand.java 
b/core/src/com/cloud/agent/api/CreateVMSnapshotCommand.java
index 1455145..ab4edaf 100644
--- a/core/src/com/cloud/agent/api/CreateVMSnapshotCommand.java
+++ b/core/src/com/cloud/agent/api/CreateVMSnapshotCommand.java
@@ -25,14 +25,8 @@ import org.apache.cloudstack.storage.to.VolumeObjectTO;
 
 
 public class CreateVMSnapshotCommand extends VMSnapshotBaseCommand {
-    private String vmUuid;
 
-    public CreateVMSnapshotCommand(String vmName, String vmUuid, VMSnapshotTO 
snapshot, List<VolumeObjectTO> volumeTOs, String guestOSType) {
+    public CreateVMSnapshotCommand(String vmName, VMSnapshotTO snapshot, 
List<VolumeObjectTO> volumeTOs, String guestOSType) {
         super(vmName, snapshot, volumeTOs, guestOSType);
-        this.vmUuid = vmUuid;
-    }
-
-    public String getVmUuid() {
-        return vmUuid;
     }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/044e685c/core/src/com/cloud/agent/api/RevertToVMSnapshotCommand.java
----------------------------------------------------------------------
diff --git a/core/src/com/cloud/agent/api/RevertToVMSnapshotCommand.java 
b/core/src/com/cloud/agent/api/RevertToVMSnapshotCommand.java
index fc8ba08..7a7d3d4 100644
--- a/core/src/com/cloud/agent/api/RevertToVMSnapshotCommand.java
+++ b/core/src/com/cloud/agent/api/RevertToVMSnapshotCommand.java
@@ -25,18 +25,16 @@ import org.apache.cloudstack.storage.to.VolumeObjectTO;
 
 public class RevertToVMSnapshotCommand extends VMSnapshotBaseCommand {
 
-    public RevertToVMSnapshotCommand(String vmName, String vmUuid, 
VMSnapshotTO snapshot, List<VolumeObjectTO> volumeTOs, String guestOSType) {
+    public RevertToVMSnapshotCommand(String vmName, VMSnapshotTO snapshot, 
List<VolumeObjectTO> volumeTOs, String guestOSType) {
         super(vmName, snapshot, volumeTOs, guestOSType);
-        this.vmUuid = vmUuid;
     }
 
-    public RevertToVMSnapshotCommand(String vmName, String vmUuid, 
VMSnapshotTO snapshot, List<VolumeObjectTO> volumeTOs, String guestOSType, 
boolean reloadVm) {
-        this(vmName, vmUuid, snapshot, volumeTOs, guestOSType);
+    public RevertToVMSnapshotCommand(String vmName, VMSnapshotTO snapshot, 
List<VolumeObjectTO> volumeTOs, String guestOSType, boolean reloadVm) {
+        this(vmName, snapshot, volumeTOs, guestOSType);
         setReloadVm(reloadVm);
     }
 
     private boolean reloadVm = false;
-    private String vmUuid;
 
     public boolean isReloadVm() {
         return reloadVm;
@@ -45,8 +43,4 @@ public class RevertToVMSnapshotCommand extends 
VMSnapshotBaseCommand {
     public void setReloadVm(boolean reloadVm) {
         this.reloadVm = reloadVm;
     }
-
-    public String getVmUuid() {
-        return vmUuid;
-    }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/044e685c/engine/storage/snapshot/src/org/apache/cloudstack/storage/vmsnapshot/DefaultVMSnapshotStrategy.java
----------------------------------------------------------------------
diff --git 
a/engine/storage/snapshot/src/org/apache/cloudstack/storage/vmsnapshot/DefaultVMSnapshotStrategy.java
 
b/engine/storage/snapshot/src/org/apache/cloudstack/storage/vmsnapshot/DefaultVMSnapshotStrategy.java
index 13fd54c..c204d29 100644
--- 
a/engine/storage/snapshot/src/org/apache/cloudstack/storage/vmsnapshot/DefaultVMSnapshotStrategy.java
+++ 
b/engine/storage/snapshot/src/org/apache/cloudstack/storage/vmsnapshot/DefaultVMSnapshotStrategy.java
@@ -137,7 +137,7 @@ public class DefaultVMSnapshotStrategy extends ManagerBase 
implements VMSnapshot
             HostVO host = hostDao.findById(hostId);
             GuestOSHypervisorVO guestOsMapping = 
guestOsHypervisorDao.findByOsIdAndHypervisor(guestOS.getId(), 
host.getHypervisorType().toString(), host.getHypervisorVersion());
 
-            CreateVMSnapshotCommand ccmd = new 
CreateVMSnapshotCommand(userVm.getInstanceName(), userVm.getUuid(), target, 
volumeTOs, guestOS.getDisplayName());
+            CreateVMSnapshotCommand ccmd = new 
CreateVMSnapshotCommand(userVm.getInstanceName(), target, volumeTOs, 
guestOS.getDisplayName());
             if (guestOsMapping == null) {
                 ccmd.setPlatformEmulator(null);
             } else {
@@ -350,7 +350,7 @@ public class DefaultVMSnapshotStrategy extends ManagerBase 
implements VMSnapshot
                     snapshot.getCurrent(), parent, true);
             Long hostId = 
vmSnapshotHelper.pickRunningHost(vmSnapshot.getVmId());
             GuestOSVO guestOS = guestOSDao.findById(userVm.getGuestOSId());
-            RevertToVMSnapshotCommand revertToSnapshotCommand = new 
RevertToVMSnapshotCommand(vmInstanceName, userVm.getUuid(), vmSnapshotTO, 
volumeTOs, guestOS.getDisplayName());
+            RevertToVMSnapshotCommand revertToSnapshotCommand = new 
RevertToVMSnapshotCommand(vmInstanceName, vmSnapshotTO, volumeTOs, 
guestOS.getDisplayName());
             HostVO host = hostDao.findById(hostId);
             GuestOSHypervisorVO guestOsMapping = 
guestOsHypervisorDao.findByOsIdAndHypervisor(guestOS.getId(), 
host.getHypervisorType().toString(), host.getHypervisorVersion());
             if (guestOsMapping == null) {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/044e685c/engine/storage/src/org/apache/cloudstack/storage/helper/HypervisorHelperImpl.java
----------------------------------------------------------------------
diff --git 
a/engine/storage/src/org/apache/cloudstack/storage/helper/HypervisorHelperImpl.java
 
b/engine/storage/src/org/apache/cloudstack/storage/helper/HypervisorHelperImpl.java
index 9b7007d..e90770e 100644
--- 
a/engine/storage/src/org/apache/cloudstack/storage/helper/HypervisorHelperImpl.java
+++ 
b/engine/storage/src/org/apache/cloudstack/storage/helper/HypervisorHelperImpl.java
@@ -124,7 +124,7 @@ public class HypervisorHelperImpl implements 
HypervisorHelper {
         GuestOSVO guestOS = guestOSDao.findById(virtualMachine.getGuestOSId());
         List<VolumeObjectTO> volumeTOs = 
vmSnapshotHelper.getVolumeTOList(virtualMachine.getId());
         CreateVMSnapshotCommand ccmd =
-            new CreateVMSnapshotCommand(virtualMachine.getInstanceName(), 
virtualMachine.getUuid(), vmSnapshotTO, volumeTOs, guestOS.getDisplayName());
+            new CreateVMSnapshotCommand(virtualMachine.getInstanceName(), 
vmSnapshotTO, volumeTOs, guestOS.getDisplayName());
         HostVO host = hostDao.findById(hostId);
         GuestOSHypervisorVO guestOsMapping = 
guestOsHypervisorDao.findByOsIdAndHypervisor(guestOS.getId(), 
host.getHypervisorType().toString(), host.getHypervisorVersion());
         ccmd.setPlatformEmulator(guestOsMapping.getGuestOsName());

Reply via email to