[PATCH 3/7] Add iTCO watchdog support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Supported only with q35 machine types.

Signed-off-by: Martin Kletzander <mkletzan@xxxxxxxxxx>
---
 src/conf/domain_conf.c            |  1 +
 src/conf/domain_conf.h            |  1 +
 src/conf/schemas/domaincommon.rng |  1 +
 src/qemu/qemu_domain_address.c    |  1 +
 src/qemu/qemu_validate.c          | 25 +++++++++++++++++++++++++
 5 files changed, 29 insertions(+)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 7c61da1d765b..4a5f538a565a 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -837,6 +837,7 @@ VIR_ENUM_IMPL(virDomainWatchdogModel,
               "i6300esb",
               "ib700",
               "diag288",
+              "itco",
 );
 
 VIR_ENUM_IMPL(virDomainWatchdogAction,
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index da785076151d..f125ace9c082 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -1745,6 +1745,7 @@ typedef enum {
     VIR_DOMAIN_WATCHDOG_MODEL_I6300ESB,
     VIR_DOMAIN_WATCHDOG_MODEL_IB700,
     VIR_DOMAIN_WATCHDOG_MODEL_DIAG288,
+    VIR_DOMAIN_WATCHDOG_MODEL_ITCO,
 
     VIR_DOMAIN_WATCHDOG_MODEL_LAST
 } virDomainWatchdogModel;
diff --git a/src/conf/schemas/domaincommon.rng b/src/conf/schemas/domaincommon.rng
index a5d0505d9b9b..c051bb7a697d 100644
--- a/src/conf/schemas/domaincommon.rng
+++ b/src/conf/schemas/domaincommon.rng
@@ -5345,6 +5345,7 @@
             <value>i6300esb</value>
             <value>ib700</value>
             <value>diag288</value>
+            <value>itco</value>
           </choice>
         </attribute>
         <optional>
diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c
index db4e91501d3f..a0168b2f2a2c 100644
--- a/src/qemu/qemu_domain_address.c
+++ b/src/qemu/qemu_domain_address.c
@@ -925,6 +925,7 @@ qemuDomainDeviceCalculatePCIConnectFlags(virDomainDeviceDef *dev,
 
         case VIR_DOMAIN_WATCHDOG_MODEL_IB700:
         case VIR_DOMAIN_WATCHDOG_MODEL_DIAG288:
+        case VIR_DOMAIN_WATCHDOG_MODEL_ITCO:
         case VIR_DOMAIN_WATCHDOG_MODEL_LAST:
             return 0;
         }
diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c
index cb002dee0eb9..03f5a84ffec2 100644
--- a/src/qemu/qemu_validate.c
+++ b/src/qemu/qemu_validate.c
@@ -1191,6 +1191,7 @@ qemuValidateDomainDefTPMs(const virDomainDef *def)
 static int
 qemuValidateDomainDefWatchdogs(const virDomainDef *def)
 {
+    bool found_itco = false;
     ssize_t i = 0;
 
     for (i = 0; i < def->nwatchdogs; i++) {
@@ -1204,6 +1205,15 @@ qemuValidateDomainDefWatchdogs(const virDomainDef *def)
                              "with this QEMU binary"));
             return -1;
         }
+
+        if (def->watchdogs[i]->model == VIR_DOMAIN_WATCHDOG_MODEL_ITCO) {
+            if (found_itco) {
+                virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+                               _("Multiple iTCO watchdogs are not supported"));
+                return -1;
+            }
+            found_itco = true;
+        }
     }
 
     return 0;
@@ -2410,6 +2420,21 @@ qemuValidateDomainWatchdogDef(const virDomainWatchdogDef *dev,
         }
         break;
 
+    case VIR_DOMAIN_WATCHDOG_MODEL_ITCO:
+        if (dev->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE) {
+            virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+                           _("%s model of watchdog is part of the machine and cannot have any address set."),
+                           virDomainWatchdogModelTypeToString(dev->model));
+            return -1;
+        }
+        if (!qemuDomainIsQ35(def)) {
+            virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+                           _("%s model of watchdog is only part of q35 machine"),
+                           virDomainWatchdogModelTypeToString(dev->model));
+            return -1;
+        }
+        break;
+
     case VIR_DOMAIN_WATCHDOG_MODEL_LAST:
     default:
         virReportEnumRangeError(virDomainWatchdogModel, dev->model);
-- 
2.39.1




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux