Omer Frenkel has uploaded a new change for review.

Change subject: core: update vm version for pool-vm
......................................................................

core: update vm version for pool-vm

When pool-vm is started by admin, it is not attached to any user, nor
doest it have a stateless snapshot.
so in this case, the logic that check if new version exists is skipped.

this patch calls restoreStatelessSnapshot (that contains the new version
logic) also to pool vms that are not attached to any user.

Change-Id: Ibce7bc6d744a0bc4ef42e7f039e880c595e44f89
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1167102
Signed-off-by: Omer Frenkel <ofren...@redhat.com>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ProcessDownVmCommand.java
1 file changed, 5 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/53/35453/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ProcessDownVmCommand.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ProcessDownVmCommand.java
index bff3987..9298fc7 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ProcessDownVmCommand.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ProcessDownVmCommand.java
@@ -84,9 +84,12 @@
         List<DbUser> users = getDbUserDAO().getAllForVm(getVmId());
         // check if this VM is attached to a user
         if (users == null || users.isEmpty()) {
-            return false;
+            // if not, check if new version or need to restore stateless
+            runInternalActionWithTasksContext(VdcActionType.RestoreStatelessVm,
+                    new VmOperationParameterBase(getVmId()),
+                    getLock());
+            return true;
         }
-
         VmPool pool = getVmPoolDAO().get(getVm().getVmPoolId());
         if (pool != null && pool.getVmPoolType() == VmPoolType.Automatic) {
             // should be only one user in the collection


-- 
To view, visit http://gerrit.ovirt.org/35453
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibce7bc6d744a0bc4ef42e7f039e880c595e44f89
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Omer Frenkel <ofren...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to