From 54a5c1a7ba6d8b7f68b7bf6b31e94e1a44685338 Mon Sep 17 00:00:00 2001
From: wangge <wangge20@huawei.com>
Date: Wed, 29 Sep 2021 16:19:14 +0800
Subject: [PATCH] add virt chipset support

---
 .../core/vdsbroker/monitoring/VirtMonitoringStrategy.java      | 3 +++
 packaging/dbscripts/upgrade/pre_upgrade/0000_config.sql        | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/monitoring/VirtMonitoringStrategy.java b/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/monitoring/VirtMonitoringStrategy.java
index 886a721..b889773 100644
--- a/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/monitoring/VirtMonitoringStrategy.java
+++ b/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/monitoring/VirtMonitoringStrategy.java
@@ -242,6 +242,9 @@ public class VirtMonitoringStrategy implements MonitoringStrategy {
         if (!StringUtils.isEmpty(matchedEmulatedMachine)) {
             setClusterEmulatedMachine(vds, matchedEmulatedMachine);
             return true;
+        } else if (supported.contains(ChipsetType.VIRT.getChipsetName())) {
+            setClusterEmulatedMachine(vds, ChipsetType.VIRT.getChipsetName());
+            return true;
         }
         return false;
     }
diff --git a/packaging/dbscripts/upgrade/pre_upgrade/0000_config.sql b/packaging/dbscripts/upgrade/pre_upgrade/0000_config.sql
index f50171b..3f42535 100644
--- a/packaging/dbscripts/upgrade/pre_upgrade/0000_config.sql
+++ b/packaging/dbscripts/upgrade/pre_upgrade/0000_config.sql
@@ -976,7 +976,7 @@ select fn_db_update_config_value('ClusterEmulatedMachines','pc-i440fx-rhel7.3.0,
 select fn_db_update_config_value('ClusterEmulatedMachines','pc-i440fx-rhel7.6.0,pc-i440fx-2.12,pseries-rhel7.6.0-sxxm,s390-ccw-virtio-2.12','4.3');
 -- Since 4.4 every x86 cluster keeps two emulated machine types: for i440fx and q35 chipsets. Thus, host must support
 -- both chipsets and ClusterEmulatedMachines list also should contain values for both of them.
-select fn_db_update_config_value_for_versions_from_up_to('ClusterEmulatedMachines','pc-q35-rhel8.1.0,pc-q35-4.1,pc-i440fx-rhel7.6.0,pc-i440fx-2.12,pseries-rhel8.1.0,s390-ccw-virtio-2.12','4.4','4.5');
+select fn_db_update_config_value_for_versions_from_up_to('ClusterEmulatedMachines','pc-q35-rhel8.1.0,pc-q35-4.1,pc-i440fx-rhel7.6.0,pc-i440fx-2.12,pseries-rhel8.1.0,s390-ccw-virtio-2.12,virt','4.4','4.5');
 select fn_db_update_config_value('SpiceDriverNameInGuest','{"windows": "RHEV-Spice", "linux" : "xorg-x11-drv-qxl" }','general');
 select fn_db_update_config_value('SupportedClusterLevels','4.2,4.3,4.4,4.5','general');
 select fn_db_update_config_value('SupportedVDSMVersions','4.20,4.30,4.40','general');
-- 
2.27.0

