Yaniv Bronhaim has uploaded a new change for review.

Change subject: Adding system information to getCapabilities from host
......................................................................

Adding system information to getCapabilities from host

Bug-Id: https://bugzilla.redhat.com/show_bug.cgi?id=867543
Signed-off-by: Yaniv Bronhaim <ybron...@redhat.com>
Change-Id: I142198d2059cf109be3859f255621e6ceca8582b
---
M backend/manager/dbscripts/create_tables.sql
M backend/manager/dbscripts/create_views.sql
M 
backend/manager/dbscripts/upgrade/post_upgrade/0010_add_object_column_white_list_table.sql
M backend/manager/dbscripts/vds_sp.sql
M 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VDS.java
M 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VdsDynamic.java
M 
backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VdsDAODbFacadeImpl.java
M 
backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VdsDynamicDAODbFacadeImpl.java
M backend/manager/modules/dal/src/test/resources/fixtures.xml
M 
backend/manager/modules/utils/src/test/java/org/ovirt/engine/core/utils/serialization/json/JsonObjectSerializationEntitiesTest.java
M 
backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/VdsBrokerObjectsBuilder.java
M 
backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/VdsProperties.java
12 files changed, 291 insertions(+), 19 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/37/9337/1

diff --git a/backend/manager/dbscripts/create_tables.sql 
b/backend/manager/dbscripts/create_tables.sql
index 0f5cd19..1478db1 100644
--- a/backend/manager/dbscripts/create_tables.sql
+++ b/backend/manager/dbscripts/create_tables.sql
@@ -433,6 +433,12 @@
 (
    vds_id UUID NOT NULL,
    status INTEGER NOT NULL,
+   host_manufacturer VARCHAR(40),
+   host_product_name VARCHAR(40),
+   host_version VARCHAR(40),
+   host_serial_number VARCHAR(40),
+   host_uuid VARCHAR(40),
+   host_family VARCHAR(40),
    cpu_cores INTEGER,
    cpu_model VARCHAR(255),
    cpu_speed_mh DECIMAL(18,0),
diff --git a/backend/manager/dbscripts/create_views.sql 
b/backend/manager/dbscripts/create_views.sql
index d6dd745..733c3e0 100644
--- a/backend/manager/dbscripts/create_views.sql
+++ b/backend/manager/dbscripts/create_views.sql
@@ -618,8 +618,10 @@
                       vds_groups.selection_algorithm as selection_algorithm, 
vds_static.vds_id as vds_id, vds_static.vds_name as vds_name, vds_static.ip as 
ip, vds_static.vds_unique_id as vds_unique_id,
                       vds_static.host_name as host_name, vds_static.port as 
port, vds_static.vds_strength as vds_strength, vds_static.server_SSL_enabled as 
server_SSL_enabled, vds_static.vds_type as vds_type,
                       vds_static.pm_type as pm_type, vds_static.pm_user as 
pm_user, vds_static.pm_password as pm_password, vds_static.pm_port as pm_port,
-                      vds_static.pm_options as pm_options, 
vds_static.pm_enabled as pm_enabled, vds_static.vds_spm_priority as 
vds_spm_priority, vds_dynamic.hooks as hooks,vds_dynamic.status as status, 
vds_dynamic.cpu_cores as cpu_cores, vds_dynamic.cpu_model as cpu_model,
-                      vds_dynamic.cpu_speed_mh as cpu_speed_mh, 
vds_dynamic.if_total_speed as if_total_speed, vds_dynamic.kvm_enabled as 
kvm_enabled, vds_dynamic.physical_mem_mb as physical_mem_mb,
+                      vds_static.pm_options as pm_options, 
vds_static.pm_enabled as pm_enabled, vds_static.vds_spm_priority as 
vds_spm_priority, vds_dynamic.hooks as hooks,vds_dynamic.status as status,
+                     vds_dynamic.host_manufacturer as host_manufacturer, 
vds_dynamic.host_product_name as host_product_name, vds_dynamic.host_version as 
host_version,
+                     vds_dynamic.host_serial_number as host_serial_number, 
vds_dynamic.host_uuid as host_uuid, vds_dynamic.host_family as host_family, 
vds_dynamic.cpu_cores as cpu_cores,
+                     vds_dynamic.cpu_model as cpu_model, 
vds_dynamic.cpu_speed_mh as cpu_speed_mh, vds_dynamic.if_total_speed as 
if_total_speed, vds_dynamic.kvm_enabled as kvm_enabled, 
vds_dynamic.physical_mem_mb as physical_mem_mb,
                       vds_dynamic.pending_vcpus_count as pending_vcpus_count, 
vds_dynamic.pending_vmem_size as pending_vmem_size,vds_dynamic.mem_commited as 
mem_commited, vds_dynamic.vm_active as vm_active, vds_dynamic.vm_count as 
vm_count,
                       vds_dynamic.vm_migrating as vm_migrating, 
vds_dynamic.vms_cores_count as vms_cores_count, 
vds_dynamic.cpu_over_commit_time_stamp as cpu_over_commit_time_stamp,
                       vds_dynamic.net_config_dirty as net_config_dirty, 
vds_groups.high_utilization as high_utilization, vds_groups.low_utilization as 
low_utilization,
@@ -650,7 +652,8 @@
                       vds_groups.selection_algorithm, vds_static.vds_id, 
vds_static.vds_name, vds_static.ip, vds_static.vds_unique_id,
                       vds_static.host_name, vds_static.port, 
vds_static.vds_strength, vds_static.server_SSL_enabled, vds_static.vds_type,
                       vds_static.pm_type, vds_static.pm_user, 
vds_static.pm_password, vds_static.pm_port,
-                      vds_static.pm_options, vds_static.pm_enabled, 
vds_dynamic.hooks, vds_dynamic.status, vds_dynamic.cpu_cores,
+                      vds_static.pm_options, vds_static.pm_enabled, 
vds_dynamic.hooks, vds_dynamic.status, vds_dynamic.host_manufacturer,
+                     vds_dynamic.host_product_name, vds_dynamic.host_version, 
vds_dynamic.host_serial_number, vds_dynamic.host_uuid, vds_dynamic.host_family, 
vds_dynamic.cpu_cores,
                       vds_dynamic.cpu_model, vds_dynamic.cpu_speed_mh, 
vds_dynamic.if_total_speed, vds_dynamic.kvm_enabled,
                       vds_dynamic.physical_mem_mb, 
vds_dynamic.pending_vcpus_count, vds_dynamic.pending_vmem_size,
                       vds_dynamic.mem_commited, vds_dynamic.vm_active, 
vds_dynamic.vm_count, vds_dynamic.vm_migrating,
diff --git 
a/backend/manager/dbscripts/upgrade/post_upgrade/0010_add_object_column_white_list_table.sql
 
b/backend/manager/dbscripts/upgrade/post_upgrade/0010_add_object_column_white_list_table.sql
index 6d712ad..32c986d 100644
--- 
a/backend/manager/dbscripts/upgrade/post_upgrade/0010_add_object_column_white_list_table.sql
+++ 
b/backend/manager/dbscripts/upgrade/post_upgrade/0010_add_object_column_white_list_table.sql
@@ -41,7 +41,8 @@
           'vds_group_id', 'vds_group_name', 'vds_group_description', 
'selection_algorithm',
           'vds_id', 'vds_name', 'ip', 'vds_unique_id', 'host_name', 'port', 
'vds_strength',
           'server_ssl_enabled', 'vds_type', 'pm_type', 'pm_user', 
'pm_password', 'pm_port',
-          'pm_options', 'pm_enabled', 'vds_spm_priority', 'hooks', 'status', 
'cpu_cores',
+          'pm_options', 'pm_enabled', 'vds_spm_priority', 'hooks', 'status', 
'host_manufacturer',
+          'host_product_name', 'host_version', 'host_serial_number', 
'host_uuid', 'host_family', 'cpu_cores',
           'cpu_model', 'cpu_speed_mh', 'if_total_speed', 'kvm_enabled', 
'physical_mem_mb',
           'pending_vcpus_count', 'pending_vmem_size', 'mem_commited', 
'vm_active', 'vm_count',
           'vm_migrating', 'vms_cores_count', 'cpu_over_commit_time_stamp', 
'hypervisor_type',
diff --git a/backend/manager/dbscripts/vds_sp.sql 
b/backend/manager/dbscripts/vds_sp.sql
index 92e7ff6..47f91ae 100644
--- a/backend/manager/dbscripts/vds_sp.sql
+++ b/backend/manager/dbscripts/vds_sp.sql
@@ -135,7 +135,14 @@
 --
 
 
-Create or replace FUNCTION InsertVdsDynamic(v_cpu_cores INTEGER ,
+Create or replace FUNCTION InsertVdsDynamic(
+ v_host_manufacturer VARCHAR(40),
+ v_host_product_name VARCHAR(40),
+ v_host_version VARCHAR(40),
+ v_host_serial_number VARCHAR(40),
+ v_host_uuid VARCHAR(40),
+ v_host_family VARCHAR(40),
+ v_cpu_cores INTEGER ,
  v_cpu_model VARCHAR(255) ,
  v_cpu_speed_mh DECIMAL(18,0) ,
  v_if_total_speed VARCHAR(40) ,
@@ -176,8 +183,8 @@
 BEGIN
 
    BEGIN
-INSERT INTO vds_dynamic(cpu_cores, cpu_model, cpu_speed_mh, if_total_speed, 
kvm_enabled, mem_commited, physical_mem_mb,        status, vds_id, vm_active, 
vm_count, vm_migrating, reserved_mem, guest_overhead, rpm_version, 
software_version, version_name, build_name, previous_status, cpu_flags, 
cpu_over_commit_time_stamp, vms_cores_count, pending_vcpus_count, 
pending_vmem_size, cpu_sockets,net_config_dirty, supported_cluster_levels, 
supported_engines, host_os, kvm_version, spice_version, kernel_version, 
iscsi_initiator_name, transparent_hugepages_state, anonymous_hugepages,hooks)
-       VALUES(v_cpu_cores,     v_cpu_model,    v_cpu_speed_mh, 
v_if_total_speed, v_kvm_enabled, v_mem_commited, v_physical_mem_mb,     
v_status, v_vds_id, v_vm_active, v_vm_count, v_vm_migrating,    v_reserved_mem, 
v_guest_overhead, v_rpm_version, v_software_version, v_version_name, 
v_build_name, v_previous_status, v_cpu_flags, v_cpu_over_commit_time_stamp, 
v_vms_cores_count,v_pending_vcpus_count, v_pending_vmem_size, v_cpu_sockets, 
v_net_config_dirty, v_supported_cluster_levels, v_supported_engines, v_host_os, 
v_kvm_version, v_spice_version, v_kernel_version, v_iscsi_initiator_name, 
v_transparent_hugepages_state, v_anonymous_hugepages,v_hooks);
+INSERT INTO vds_dynamic(host_manufacturer, host_product_name, host_version, 
host_serial_number, host_uuid, host_family, cpu_cores, cpu_model, cpu_speed_mh, 
if_total_speed, kvm_enabled, mem_commited, physical_mem_mb,        status, 
vds_id, vm_active, vm_count, vm_migrating, reserved_mem, guest_overhead, 
rpm_version, software_version, version_name, build_name, previous_status, 
cpu_flags, cpu_over_commit_time_stamp, vms_cores_count, pending_vcpus_count, 
pending_vmem_size, cpu_sockets,net_config_dirty, supported_cluster_levels, 
supported_engines, host_os, kvm_version, spice_version, kernel_version, 
iscsi_initiator_name, transparent_hugepages_state, anonymous_hugepages,hooks)
+       VALUES(v_host_manufacturer, v_host_product_name, v_host_version, 
v_host_serial_number, v_host_uuid, v_host_family, v_cpu_cores, v_cpu_model,    
v_cpu_speed_mh, v_if_total_speed, v_kvm_enabled, v_mem_commited, 
v_physical_mem_mb,     v_status, v_vds_id, v_vm_active, v_vm_count, 
v_vm_migrating,    v_reserved_mem, v_guest_overhead, v_rpm_version, 
v_software_version, v_version_name, v_build_name, v_previous_status, 
v_cpu_flags, v_cpu_over_commit_time_stamp, 
v_vms_cores_count,v_pending_vcpus_count, v_pending_vmem_size, v_cpu_sockets, 
v_net_config_dirty, v_supported_cluster_levels, v_supported_engines, v_host_os, 
v_kvm_version, v_spice_version, v_kernel_version, v_iscsi_initiator_name, 
v_transparent_hugepages_state, v_anonymous_hugepages,v_hooks);
    END;
 
    RETURN;
@@ -188,7 +195,14 @@
 
 
 
-Create or replace FUNCTION UpdateVdsDynamic(v_cpu_cores INTEGER ,
+Create or replace FUNCTION UpdateVdsDynamic(
+ v_host_manufacturer VARCHAR(40),
+ v_host_product_name VARCHAR(40),
+ v_host_version VARCHAR(40),
+ v_host_serial_number VARCHAR(40),
+ v_host_uuid VARCHAR(40),
+ v_host_family VARCHAR(40),
+ v_cpu_cores INTEGER ,
  v_cpu_model VARCHAR(255) ,
  v_cpu_speed_mh DECIMAL(18,0) ,
  v_if_total_speed VARCHAR(40) ,
@@ -233,7 +247,10 @@
 
    BEGIN
       UPDATE vds_dynamic
-      SET cpu_cores = v_cpu_cores,cpu_model = v_cpu_model,cpu_speed_mh = 
v_cpu_speed_mh,
+      SET host_manufacturer = v_host_manufacturer, host_product_name = 
v_host_product_name,
+      host_version = v_host_version, host_serial_number = v_host_serial_number,
+      host_uuid = v_host_uuid, host_family = v_host_family, cpu_cores = 
v_cpu_cores,
+      cpu_model = v_cpu_model,cpu_speed_mh = v_cpu_speed_mh,
       if_total_speed = v_if_total_speed,kvm_enabled = v_kvm_enabled,
       mem_commited = v_mem_commited,physical_mem_mb = v_physical_mem_mb,
       status = v_status,vm_active = v_vm_active,vm_count = v_vm_count,
diff --git 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VDS.java
 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VDS.java
index 9c5e281..a297e44 100644
--- 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VDS.java
+++ 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VDS.java
@@ -158,7 +158,9 @@
     }
 
     public VDS(Guid vds_group_id, String vds_group_name, String 
vds_group_description, Guid vds_id, String vds_name,
-            String ip, String host_name, int port, int status, Integer 
cpu_cores, String cpu_model,
+            String ip, String host_name, int port, int status, String 
host_manufacturer, String host_product_name,
+            String host_version, String host_serial_number, String host_uuid, 
String host_family,
+            Integer cpu_cores, String cpu_model,
             Double cpu_speed_mh, String if_total_speed, Boolean kvm_enabled, 
Integer physical_mem_mb,
             Double cpu_idle, Double cpu_load, Double cpu_sys,
             Double cpu_user, Integer mem_commited, Integer vm_active, int 
vm_count,
@@ -183,6 +185,12 @@
         this.sethost_name(host_name);
         this.setport(port);
         this.setstatus(VDSStatus.forValue(status));
+        this.sethost_manufacturer(host_manufacturer);
+        this.sethost_product_name(host_product_name);
+        this.sethost_version(host_version);
+        this.sethost_serial_number(host_serial_number);
+        this.sethost_uuid(host_uuid);
+        this.sethost_family(host_family);
         this.setcpu_cores(cpu_cores);
         this.setcpu_model(cpu_model);
         this.setcpu_speed_mh(cpu_speed_mh);
@@ -237,6 +245,12 @@
                         gethost_name(),
                         getport(),
                         getstatus().getValue(),
+                        gethost_manufacturer(),
+                        gethost_product_name(),
+                        gethost_version(),
+                        gethost_serial_number(),
+                        gethost_uuid(),
+                        gethost_family(),
                         getcpu_cores(),
                         getcpu_model(),
                         getcpu_speed_mh(),
@@ -433,10 +447,58 @@
         return this.mVdsDynamic.getcpu_cores();
     }
 
+    public String gethost_uuid() {
+        return this.mVdsDynamic.gethost_uuid();
+    }
+
+    public String gethost_manufacturer() {
+        return this.mVdsDynamic.gethost_manufacturer();
+    }
+
+    public String gethost_family() {
+        return this.mVdsDynamic.gethost_family();
+    }
+
+    public String gethost_serial_number() {
+        return this.mVdsDynamic.gethost_serial_number();
+    }
+
+    public String gethost_product_name() {
+        return this.mVdsDynamic.gethost_product_name();
+    }
+
+    public String gethost_version() {
+        return this.mVdsDynamic.gethost_version();
+    }
+
     public void setcpu_cores(Integer value) {
         this.mVdsDynamic.setcpu_cores(value);
     }
 
+    public void sethost_uuid(String value) {
+        this.mVdsDynamic.sethost_uuid(value);
+    }
+
+    public void sethost_family(String value) {
+        this.mVdsDynamic.sethost_family(value);
+    }
+
+    public void sethost_serial_number(String value) {
+        this.mVdsDynamic.sethost_serial_number(value);
+    }
+
+    public void sethost_version(String value) {
+        this.mVdsDynamic.sethost_version(value);
+    }
+
+    public void sethost_product_name(String value) {
+        this.mVdsDynamic.sethost_product_name(value);
+    }
+
+    public void sethost_manufacturer(String value) {
+        this.mVdsDynamic.sethost_manufacturer(value);
+    }
+
     public Integer getcpu_sockets() {
         return this.mVdsDynamic.getcpu_sockets();
     }
diff --git 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VdsDynamic.java
 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VdsDynamic.java
index c582bb8..b75349e 100644
--- 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VdsDynamic.java
+++ 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VdsDynamic.java
@@ -35,6 +35,25 @@
     @Column(name = "status")
     private VDSStatus status = VDSStatus.Unassigned;
 
+    @Column(name = "host_manufacturer")
+    private String host_manufacturer;
+
+    @Column(name = "host_product_name")
+    private String  host_product_name;
+
+    @Column(name = "host_version")
+    private String host_version;
+
+    @Column(name = "host_serial_number")
+    private String host_serial_number;
+
+    // System information on host
+    @Column(name = "host_uuid")
+    private String host_uuid;
+
+    @Column(name = "host_family")
+    private String host_family;
+
     @Column(name = "cpu_cores")
     private Integer cpu_cores;
 
@@ -163,13 +182,21 @@
         transparentHugePagesState = VdsTransparentHugePagesState.Never;
     }
 
-    public VdsDynamic(Integer cpu_cores, String cpu_model, Double 
cpu_speed_mh, String if_total_speed,
-                      Boolean kvm_enabled, Integer mem_commited, Integer 
physical_mem_mb, int status, Guid vds_id,
-                      Integer vm_active, int vm_count, Integer vm_migrating, 
Integer reserved_mem, Integer guest_overhead,
-                      VDSStatus previous_status, String software_version, 
String version_name, String build_name,
-                      Date cpu_over_commit_time_stamp, Integer 
pending_vcpus_count,
-                      Integer pending_vmem_sizeField, Boolean 
net_config_dirty) {
+    public VdsDynamic(String host_manufacturer, String host_product_name, 
String host_version,
+            String host_serial_number, String host_uuid, String host_family, 
Integer cpu_cores,
+            String cpu_model, Double cpu_speed_mh, String if_total_speed,
+            Boolean kvm_enabled, Integer mem_commited, Integer 
physical_mem_mb, int status, Guid vds_id,
+            Integer vm_active, int vm_count, Integer vm_migrating, Integer 
reserved_mem, Integer guest_overhead,
+            VDSStatus previous_status, String software_version, String 
version_name, String build_name,
+            Date cpu_over_commit_time_stamp, Integer pending_vcpus_count,
+            Integer pending_vmem_sizeField, Boolean net_config_dirty) {
         rpmVersion = new RpmVersion();
+        this.host_uuid = host_uuid;
+        this.host_family = host_family;
+        this.host_serial_number = host_serial_number;
+        this.host_version = host_version;
+        this.host_product_name = host_product_name;
+        this.host_manufacturer = host_manufacturer;
         this.cpu_cores = cpu_cores;
         this.cpu_model = cpu_model;
         this.cpu_speed_mh = BigDecimal.valueOf(cpu_speed_mh);
@@ -196,6 +223,54 @@
 
     public Integer getcpu_cores() {
         return this.cpu_cores;
+    }
+
+    public String gethost_uuid() {
+        return this.host_uuid;
+    }
+
+    public String gethost_family() {
+        return this.host_family;
+    }
+
+    public String gethost_serial_number() {
+        return this.host_serial_number;
+    }
+
+    public String gethost_version() {
+        return this.host_version;
+    }
+
+    public String gethost_product_name() {
+        return this.host_product_name;
+    }
+
+    public String gethost_manufacturer() {
+        return this.host_manufacturer;
+    }
+
+    public void sethost_uuid(String value) {
+        this.host_uuid = value;
+    }
+
+    public void sethost_family(String value) {
+        this.host_family = value;
+    }
+
+    public void sethost_serial_number(String value) {
+        this.host_serial_number = value;
+    }
+
+    public void sethost_version(String value) {
+        this.host_version = value;
+    }
+
+    public void sethost_product_name(String value) {
+        this.host_product_name = value;
+    }
+
+    public void sethost_manufacturer(String value) {
+        this.host_manufacturer = value;
     }
 
     public void setcpu_cores(Integer value) {
@@ -333,7 +408,7 @@
     }
 
     public String getsoftware_version() {
-       return this.softwareVersion;
+        return this.softwareVersion;
     }
 
     public void setsoftware_version(String value) {
@@ -534,6 +609,12 @@
         result = prime * result + anonymousHugePages;
         result = prime * result + ((buildName == null) ? 0 : 
buildName.hashCode());
         result = prime * result + ((cpu_cores == null) ? 0 : 
cpu_cores.hashCode());
+        result = prime * result + ((host_manufacturer == null) ? 0 : 
host_manufacturer.hashCode());
+        result = prime * result + ((host_product_name == null) ? 0 : 
host_product_name.hashCode());
+        result = prime * result + ((host_version == null) ? 0 : 
host_version.hashCode());
+        result = prime * result + ((host_serial_number == null) ? 0 : 
host_serial_number.hashCode());
+        result = prime * result + ((host_uuid == null) ? 0 : 
host_uuid.hashCode());
+        result = prime * result + ((host_family == null) ? 0 : 
host_family.hashCode());
         result = prime * result + ((cpu_flags == null) ? 0 : 
cpu_flags.hashCode());
         result = prime * result + ((cpu_model == null) ? 0 : 
cpu_model.hashCode());
         result = prime * result + ((cpu_over_commit_time_stamp == null) ? 0 : 
cpu_over_commit_time_stamp.hashCode());
@@ -597,6 +678,36 @@
                 return false;
         } else if (!buildName.equals(other.buildName))
             return false;
+        if (host_manufacturer == null) {
+            if (other.host_manufacturer != null)
+                return false;
+        } else if (!host_manufacturer.equals(other.host_manufacturer))
+            return false;
+        if (host_product_name == null) {
+            if (other.host_product_name != null)
+                return false;
+        } else if (!host_product_name.equals(other.host_product_name))
+            return false;
+        if (host_version == null) {
+            if (other.host_version != null)
+                return false;
+        } else if (!host_version.equals(other.host_version))
+            return false;
+        if (host_serial_number == null) {
+            if (other.host_serial_number != null)
+                return false;
+        } else if (!host_serial_number.equals(other.host_serial_number))
+            return false;
+        if (host_uuid == null) {
+            if (other.host_uuid != null)
+                return false;
+        } else if (!host_uuid.equals(other.host_uuid))
+            return false;
+        if (host_family == null) {
+            if (other.host_family != null)
+                return false;
+        } else if (!host_family.equals(other.host_family))
+            return false;
         if (cpu_cores == null) {
             if (other.cpu_cores != null)
                 return false;
diff --git 
a/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VdsDAODbFacadeImpl.java
 
b/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VdsDAODbFacadeImpl.java
index 06cf9ad..68df8b3 100644
--- 
a/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VdsDAODbFacadeImpl.java
+++ 
b/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VdsDAODbFacadeImpl.java
@@ -218,6 +218,12 @@
             entity.sethost_name(rs.getString("host_name"));
             entity.setport(rs.getInt("port"));
             entity.setstatus(VDSStatus.forValue(rs.getInt("status")));
+            entity.sethost_manufacturer(rs.getString("host_manufacturer"));
+            entity.sethost_product_name(rs.getString("host_product_name"));
+            entity.sethost_version(rs.getString("host_version"));
+            entity.sethost_serial_number(rs.getString("host_serial_number"));
+            entity.sethost_uuid(rs.getString("host_uuid"));
+            entity.sethost_family(rs.getString("host_family"));
             entity.setcpu_cores((Integer) rs.getObject("cpu_cores"));
             entity.setcpu_model(rs.getString("cpu_model"));
             entity.setcpu_user(rs.getDouble("cpu_user"));
diff --git 
a/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VdsDynamicDAODbFacadeImpl.java
 
b/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VdsDynamicDAODbFacadeImpl.java
index 64371a6..904f2c6 100644
--- 
a/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VdsDynamicDAODbFacadeImpl.java
+++ 
b/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VdsDynamicDAODbFacadeImpl.java
@@ -33,6 +33,12 @@
             public VdsDynamic mapRow(ResultSet rs, int rowNum)
                     throws SQLException {
                 VdsDynamic entity = new VdsDynamic();
+                entity.sethost_manufacturer(rs.getString("host_manufacturer"));
+                entity.sethost_product_name(rs.getString("host_product_name"));
+                entity.sethost_version(rs.getString("host_version"));
+                
entity.sethost_serial_number(rs.getString("host_serial_number"));
+                entity.sethost_uuid(rs.getString("host_uuid"));
+                entity.sethost_family(rs.getString("host_family"));
                 entity.setcpu_cores((Integer) rs.getObject("cpu_cores"));
                 entity.setcpu_model(rs.getString("cpu_model"));
                 entity.setcpu_speed_mh(rs.getDouble("cpu_speed_mh"));
@@ -92,6 +98,12 @@
     @Override
     public void save(VdsDynamic vds) {
         MapSqlParameterSource parameterSource = 
getCustomMapSqlParameterSource()
+                .addValue("host_manufacturer", vds.gethost_manufacturer())
+                .addValue("host_product_name", vds.gethost_product_name())
+                .addValue("host_version", vds.gethost_version())
+                .addValue("host_serial_number", vds.gethost_serial_number())
+                .addValue("host_uuid", vds.gethost_uuid())
+                .addValue("host_family", vds.gethost_family())
                 .addValue("cpu_cores", vds.getcpu_cores())
                 .addValue("cpu_model", vds.getcpu_model())
                 .addValue("cpu_speed_mh", vds.getcpu_speed_mh())
@@ -140,6 +152,12 @@
     @Override
     public void update(VdsDynamic vds) {
         MapSqlParameterSource parameterSource = 
getCustomMapSqlParameterSource()
+                .addValue("host_manufacturer", vds.gethost_manufacturer())
+                .addValue("host_product_name", vds.gethost_product_name())
+                .addValue("host_version", vds.gethost_version())
+                .addValue("host_serial_number", vds.gethost_serial_number())
+                .addValue("host_uuid", vds.gethost_uuid())
+                .addValue("host_family", vds.gethost_family())
                 .addValue("cpu_cores", vds.getcpu_cores())
                 .addValue("cpu_model", vds.getcpu_model())
                 .addValue("cpu_speed_mh", vds.getcpu_speed_mh())
diff --git a/backend/manager/modules/dal/src/test/resources/fixtures.xml 
b/backend/manager/modules/dal/src/test/resources/fixtures.xml
index 37c3347..a9aea75 100644
--- a/backend/manager/modules/dal/src/test/resources/fixtures.xml
+++ b/backend/manager/modules/dal/src/test/resources/fixtures.xml
@@ -1235,6 +1235,12 @@
     <table name="vds_dynamic">
         <column>vds_id</column>
         <column>status</column>
+       <column>host_manufacturer</column>
+       <column>host_product_name</column>
+       <column>host_version</column>
+       <column>host_serial_number</column>
+       <column>host_uuid</column>
+       <column>host_version</column>
         <column>cpu_cores</column>
         <column>cpu_model</column>
         <column>cpu_speed_mh</column>
@@ -3822,6 +3828,30 @@
                <value>build_name</value>
                </row>
                <row>
+                <value>vds</value>
+               <value>host_manufacturer</value>
+               </row>
+               <row>
+               <value>vds</value>
+               <value>host_product_name</value>
+               </row>
+               <row>
+               <value>vds</value>
+               <value>host_version</value>
+               </row>
+               <row>
+               <value>vds</value>
+               <value>host_serial_number</value>
+               </row>
+               <row>
+               <value>vds</value>
+               <value>host_uuid</value>
+               </row>
+               <row>
+               <value>vds</value>
+               <value>host_family</value>
+               </row>
+               <row>
                <value>vds</value>
                <value>cpu_cores</value>
                </row>
diff --git 
a/backend/manager/modules/utils/src/test/java/org/ovirt/engine/core/utils/serialization/json/JsonObjectSerializationEntitiesTest.java
 
b/backend/manager/modules/utils/src/test/java/org/ovirt/engine/core/utils/serialization/json/JsonObjectSerializationEntitiesTest.java
index 4674974..8aadd9f 100644
--- 
a/backend/manager/modules/utils/src/test/java/org/ovirt/engine/core/utils/serialization/json/JsonObjectSerializationEntitiesTest.java
+++ 
b/backend/manager/modules/utils/src/test/java/org/ovirt/engine/core/utils/serialization/json/JsonObjectSerializationEntitiesTest.java
@@ -59,7 +59,14 @@
         Object[][] data =
                 new Object[][] {
                         { vdsStatic },
-                        { new VdsDynamic(random.nextInt(),
+                        { new VdsDynamic(
+                                random.nextString(10),
+                                random.nextString(10),
+                                random.nextString(10),
+                                random.nextString(10),
+                                random.nextString(10),
+                                random.nextString(10),
+                                random.nextInt(),
                                 random.nextString(10),
                                 random.nextDouble(),
                                 random.nextString(10),
diff --git 
a/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/VdsBrokerObjectsBuilder.java
 
b/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/VdsBrokerObjectsBuilder.java
index a95e505..97dba81 100644
--- 
a/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/VdsBrokerObjectsBuilder.java
+++ 
b/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/VdsBrokerObjectsBuilder.java
@@ -300,7 +300,12 @@
 
     public static void updateVDSDynamicData(VDS vds, XmlRpcStruct 
xmlRpcStruct) {
         updateNetworkData(vds, xmlRpcStruct);
-
+        vds.sethost_manufacturer(AssignStringValue(xmlRpcStruct, 
VdsProperties.host_manufacturer));
+        vds.sethost_product_name(AssignStringValue(xmlRpcStruct, 
VdsProperties.host_product_name));
+        vds.sethost_version(AssignStringValue(xmlRpcStruct, 
VdsProperties.host_version));
+        vds.sethost_serial_number(AssignStringValue(xmlRpcStruct, 
VdsProperties.host_serial_number));
+        vds.sethost_uuid(AssignStringValue(xmlRpcStruct, 
VdsProperties.host_uuid));
+        vds.sethost_family(AssignStringValue(xmlRpcStruct, 
VdsProperties.host_family));
         vds.setcpu_cores(AssignIntValue(xmlRpcStruct, 
VdsProperties.cpu_cores));
         vds.setcpu_sockets(AssignIntValue(xmlRpcStruct, 
VdsProperties.cpu_sockets));
         vds.setcpu_model(AssignStringValue(xmlRpcStruct, 
VdsProperties.cpu_model));
diff --git 
a/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/VdsProperties.java
 
b/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/VdsProperties.java
index 225dd40..2f36fa5 100644
--- 
a/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/VdsProperties.java
+++ 
b/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/VdsProperties.java
@@ -25,6 +25,12 @@
     public static final String cpu_flags = "cpuFlags";
 
     public static final String SpiceSecureChannels = "spiceSecureChannels";
+    public static final String host_manufacturer = "hostManufacturer";
+    public static final String host_product_name = "hostProductName";
+    public static final String host_version = "hostVersion";
+    public static final String host_serial_number = "hostSerialNumber";
+    public static final String host_uuid = "hostUUID";
+    public static final String host_family = "hostFamily";
     public static final String cpu_cores = "cpuCores";
     public static final String cpu_sockets = "cpuSockets";
     public static final String cpu_model = "cpuModel";


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

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

Reply via email to