cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bfede...@apache.org
Subject [09/50] [abbrv] git commit: updated refs/heads/ui-restyle to 500c798
Date Thu, 24 Oct 2013 18:30:47 GMT
CLOUDSTACK-4931, CLOUDSTACK-4937: setDetails to user VMs only
(cherry picked from commit a94acc5a43aeaf5f18f1912e2653a92f6041a6e5)


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

Branch: refs/heads/ui-restyle
Commit: 69b131fa1501ed7f6950a6dae4161efb659ad113
Parents: 294b0c7
Author: Wei Zhou <w.zhou@leaseweb.com>
Authored: Wed Oct 23 16:55:10 2013 +0200
Committer: Wei Zhou <w.zhou@leaseweb.com>
Committed: Wed Oct 23 17:04:02 2013 +0200

----------------------------------------------------------------------
 .../com/cloud/vm/VirtualMachineManagerImpl.java | 41 ++++++++++++--------
 1 file changed, 24 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/69b131fa/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java b/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java
index aa5af54..c2242c7 100755
--- a/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java
+++ b/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java
@@ -887,10 +887,12 @@ public class VirtualMachineManagerImpl extends ManagerBase implements
VirtualMac
                            if ( answer != null ) {
                                 String hypervisortoolsversion = answer.getHypervisorToolsVersion();
                                 if (hypervisortoolsversion != null) {
-                                    UserVmVO userVm = _userVmDao.findById(vm.getId());
-                                    _userVmDao.loadDetails(userVm);
-                                    userVm.setDetail("hypervisortoolsversion",  hypervisortoolsversion);
-                                    _userVmDao.saveDetails(userVm);
+                                    if (vm.getType() == VirtualMachine.Type.User) {
+                                        UserVmVO userVm = _userVmDao.findById(vm.getId());
+                                        _userVmDao.loadDetails(userVm);
+                                        userVm.setDetail("hypervisortoolsversion",  hypervisortoolsversion);
+                                        _userVmDao.saveDetails(userVm);
+                                    }
                                 }
                             }
 
@@ -1003,10 +1005,12 @@ public class VirtualMachineManagerImpl extends ManagerBase implements
VirtualMac
             if ( answer != null ) {
                 String hypervisortoolsversion = answer.getHypervisorToolsVersion();
                 if (hypervisortoolsversion != null) {
-                    UserVmVO userVm = _userVmDao.findById(vm.getId());
-                    _userVmDao.loadDetails(userVm);
-                    userVm.setDetail("hypervisortoolsversion",  hypervisortoolsversion);
-                    _userVmDao.saveDetails(userVm);
+                    if (vm.getType() == VirtualMachine.Type.User) {
+                        UserVmVO userVm = _userVmDao.findById(vm.getId());
+                        _userVmDao.loadDetails(userVm);
+                        userVm.setDetail("hypervisortoolsversion",  hypervisortoolsversion);
+                        _userVmDao.saveDetails(userVm);
+                    }
                 }
             }
             if (!answer.getResult()) {
@@ -1208,10 +1212,12 @@ public class VirtualMachineManagerImpl extends ManagerBase implements
VirtualMac
             if ( answer != null ) {
                 String hypervisortoolsversion = answer.getHypervisorToolsVersion();
                 if (hypervisortoolsversion != null) {
-                    UserVmVO userVm = _userVmDao.findById(vm.getId());
-                    _userVmDao.loadDetails(userVm);
-                    userVm.setDetail("hypervisortoolsversion",  hypervisortoolsversion);
-                    _userVmDao.saveDetails(userVm);
+                    if (vm.getType() == VirtualMachine.Type.User) {
+                        UserVmVO userVm = _userVmDao.findById(vm.getId());
+                        _userVmDao.loadDetails(userVm);
+                        userVm.setDetail("hypervisortoolsversion",  hypervisortoolsversion);
+                        _userVmDao.saveDetails(userVm);
+                    }
                 }
             }
             stopped = answer.getResult();
@@ -2296,11 +2302,12 @@ public class VirtualMachineManagerImpl extends ManagerBase implements
VirtualMac
         }
         // track hypervsion tools version
         if( info.hvtoolsversion != null && !info.hvtoolsversion.isEmpty() ) {
-
-            UserVmVO userVm = _userVmDao.findById(vm.getId());
-            _userVmDao.loadDetails(userVm);
-            userVm.setDetail("hypervisortoolsversion",  info.hvtoolsversion);
-            _userVmDao.saveDetails(userVm);
+            if (vm.getType() == VirtualMachine.Type.User) {
+                UserVmVO userVm = _userVmDao.findById(vm.getId());
+                _userVmDao.loadDetails(userVm);
+                userVm.setDetail("hypervisortoolsversion",  info.hvtoolsversion);
+                _userVmDao.saveDetails(userVm);
+            }
         }
 
         if (trackExternalChange) {


Mime
View raw message