Arik Hadas has uploaded a new change for review.

Change subject: [WIP] core: add memory disks
......................................................................

[WIP] core: add memory disks

Change-Id: Ie1632be2da8aa0fb1f122c2d40fedebe191aba57
Signed-off-by: Arik Hadas <[email protected]>
---
M 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/storage/DiskContentType.java
M 
backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/DiskImageDAODbFacadeImpl.java
2 files changed, 15 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/44/39144/1

diff --git 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/storage/DiskContentType.java
 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/storage/DiskContentType.java
index f50419a..ca386a5 100644
--- 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/storage/DiskContentType.java
+++ 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/storage/DiskContentType.java
@@ -2,6 +2,7 @@
 
 public enum DiskContentType{
     DATA,
-    OVF_STORE;
+    OVF_STORE,
+    MEMORY;
 }
 
diff --git 
a/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/DiskImageDAODbFacadeImpl.java
 
b/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/DiskImageDAODbFacadeImpl.java
index b47604c..ecaacbb 100644
--- 
a/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/DiskImageDAODbFacadeImpl.java
+++ 
b/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/DiskImageDAODbFacadeImpl.java
@@ -198,7 +198,7 @@
             entity.setBoot(rs.getBoolean("boot"));
             entity.setReadRate(rs.getInt("read_rate"));
             entity.setWriteRate(rs.getInt("write_rate"));
-            entity.setContentType(rs.getBoolean("ovf_store") ? 
DiskContentType.OVF_STORE : DiskContentType.DATA);
+            entity.setContentType(getDiskContentType(rs));
             entity.setReadLatency(rs.getObject("read_latency_seconds") != null 
? rs.getDouble("read_latency_seconds")
                     : null);
             entity.setWriteLatency(rs.getObject("write_latency_seconds") != 
null ? rs.getDouble("write_latency_seconds")
@@ -213,6 +213,18 @@
             
entity.setDiskProfileNames(splitPreserveAllTokens(rs.getString("disk_profile_name")));
         }
 
+        private DiskContentType getDiskContentType(ResultSet rs) throws 
SQLException {
+            if (rs.getBoolean("ovf_store")) {
+                return DiskContentType.OVF_STORE;
+            }
+
+            if (rs.getBoolean("memory_dump")) {
+                return DiskContentType.MEMORY;
+            }
+
+            return DiskContentType.DATA;
+        }
+
         @Override
         protected DiskImage createDiskEntity() {
             return new DiskImage();


-- 
To view, visit https://gerrit.ovirt.org/39144
To unsubscribe, visit https://gerrit.ovirt.org/settings

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

Reply via email to