]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: Enable iTCO watchdog by disabling its noreboot pin strap
authorMartin Kletzander <mkletzan@redhat.com>
Fri, 20 Jan 2023 13:15:06 +0000 (14:15 +0100)
committerMartin Kletzander <mkletzan@redhat.com>
Thu, 26 Jan 2023 15:40:30 +0000 (16:40 +0100)
In order for the iTCO watchdog to be operational we must disable the
noreboot pin strap in qemu.  This is the default starting from 8.0
machine types, but desirable for older ones as well.  And we can safely
do that since that is not guest-visible.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/qemu/qemu_command.c

index 987c9d20db96db2b7e04927d9502d0e938f302e8..297f53ba843683812f0bd8920e5fe949eb65aa54 100644 (file)
@@ -4054,6 +4054,7 @@ qemuBuildWatchdogCommandLine(virCommand *cmd,
     const char *action;
     int actualAction;
     ssize_t i = 0;
+    bool itco_pin_strap = false;
 
     if (def->nwatchdogs == 0)
         return 0;
@@ -4063,6 +4064,12 @@ qemuBuildWatchdogCommandLine(virCommand *cmd,
 
         watchdog = def->watchdogs[i];
 
+        /* iTCO is part of q35 and cannot be added */
+        if (watchdog->model == VIR_DOMAIN_WATCHDOG_MODEL_ITCO) {
+            itco_pin_strap = true;
+            continue;
+        }
+
         if (qemuCommandAddExtDevice(cmd, &watchdog->info, def, qemuCaps) < 0)
             return -1;
 
@@ -4073,6 +4080,9 @@ qemuBuildWatchdogCommandLine(virCommand *cmd,
             return -1;
     }
 
+    if (itco_pin_strap)
+        virCommandAddArgList(cmd, "-global", "ICH9-LPC.noreboot=off", NULL);
+
     /* qemu doesn't have a 'dump' action; we tell qemu to 'pause', then
        libvirt listens for the watchdog event, and we perform the dump
        ourselves. so convert 'dump' to 'pause' for the qemu cli. The