Tal Nisan has uploaded a new change for review.

Change subject: core: End VM export gracefully upon failure in updating OVF
......................................................................

core: End VM export gracefully upon failure in updating OVF

When exporting a VM and encountering an error in the VM OVF update, the
VM and disks are remained locked and the end operation is repeated again
and again, this fix ends the command correctly, logs the exception and
unlocking the VM and disks as it should

Change-Id: Iefa719e8872a69de5b3d3fa79758e12e7b63f80f
Signed-off-by: Tal Nisan <[email protected]>
Bug-Url: https://bugzilla.redhat.com/1170378
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ExportVmCommand.java
1 file changed, 8 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/83/37583/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ExportVmCommand.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ExportVmCommand.java
index 666bbce..e7ff7a4 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ExportVmCommand.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ExportVmCommand.java
@@ -510,7 +510,7 @@
         return super.getAuditLogTypeValue();
     }
 
-    protected boolean updateVmInSpm() {
+    private void updateVmInSpm() {
         OvfUpdateProcessHelper ovfHelper = new OvfUpdateProcessHelper();
         Map<Guid, KeyValuePairCompat<String, List<Guid>>> metaDictionary =
                 new HashMap<Guid, KeyValuePairCompat<String, List<Guid>>>();
@@ -518,8 +518,13 @@
         ovfHelper.buildMetadataDictionaryForVm(getVm(),
                 metaDictionary,
                 ovfHelper.getVmImagesFromDb(getVm()));
-        return 
ovfHelper.executeUpdateVmInSpmCommand(getVm().getStoragePoolId(),
-                metaDictionary, getParameters().getStorageDomainId());
+        try {
+            ovfHelper.executeUpdateVmInSpmCommand(getVm().getStoragePoolId(),
+                    metaDictionary, getParameters().getStorageDomainId());
+        }
+        catch (VdcBLLException e) {
+            log.error("Error updating VM OVF in export domain", e);
+        }
     }
 
     @Override


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iefa719e8872a69de5b3d3fa79758e12e7b63f80f
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Tal Nisan <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to