]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: Check all watchdogs for iTCO duplicates
authorMartin Kletzander <mkletzan@redhat.com>
Wed, 19 Apr 2023 12:19:16 +0000 (14:19 +0200)
committerMartin Kletzander <mkletzan@redhat.com>
Thu, 20 Apr 2023 08:17:35 +0000 (10:17 +0200)
The loop initially skipped the first one because it was mainly checking
the incompatible actions, but was then modified to also check the
duplicity of iTCO watchdogs.

While at it change the type of the iteration variable to the usual size_t.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2187133
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/qemu/qemu_validate.c

index 6ebd2ba0101fb7d69af886c45f3cd6d5b65d90bb..a03f7056b191473c190161ebc2da67bc38386390 100644 (file)
@@ -1111,9 +1111,9 @@ static int
 qemuValidateDomainDefWatchdogs(const virDomainDef *def)
 {
     bool found_itco = false;
-    ssize_t i = 0;
+    size_t i = 0;
 
-    for (i = 1; i < def->nwatchdogs; i++) {
+    for (i = 0; i < def->nwatchdogs; i++) {
         /* We could theoretically support different watchdogs having dump and
          * pause, but let's be honest, we support multiple watchdogs only
          * because we need to be able to add a second, implicit one, not because