Shahar Havivi has uploaded a new change for review.

Change subject: engine: cannot run VM when path is null in devices spec-params
......................................................................

engine: cannot run VM when path is null in devices spec-params

Change-Id: I1d5e2d67adcbb46608a5349fdf39cd68e2108067
Bug-Url: https://bugzilla.redhat.com/875623
Signed-off-by: Shahar Havivi <shav...@redhat.com>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/utils/VmDeviceUtils.java
1 file changed, 4 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/27/9327/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/utils/VmDeviceUtils.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/utils/VmDeviceUtils.java
index 3274133..beb6c34 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/utils/VmDeviceUtils.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/utils/VmDeviceUtils.java
@@ -261,6 +261,8 @@
             specParams.put(VdsProperties.Path, isoPath);
         } else if (!StringUtils.isEmpty(srcCdPath)) { // get the path from the 
source device spec params
             specParams.put(VdsProperties.Path, srcCdPath);
+        } else {
+            specParams.put(VdsProperties.Path, "");
         }
     }
 
@@ -411,7 +413,8 @@
         List<VmDevice> cdList = 
DbFacade.getInstance().getVmDeviceDao().getVmDeviceByVmIdTypeAndDevice(oldVmBase.getId(),
 VmDeviceType.DISK.getName(), VmDeviceType.CDROM.getName());
         if (cdList.size() > 0){ // this is done only for safety, each VM must 
have at least an Empty CD
             VmDevice cd = cdList.get(0); // only one managed CD is currently 
supported.
-            cd.getSpecParams().put(VdsProperties.Path, 
newVmBase.getiso_path());
+            cd.getSpecParams()
+                    .put(VdsProperties.Path, (newVmBase.getiso_path() == null) 
? "" : newVmBase.getiso_path());
             dao.update(cd);
         }
     }


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

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

Reply via email to