]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: Forbid ib700 watchdogs for non-i440fx machine types
authorMartin Kletzander <mkletzan@redhat.com>
Wed, 19 Apr 2023 11:54:02 +0000 (13:54 +0200)
committerMartin Kletzander <mkletzan@redhat.com>
Thu, 20 Apr 2023 08:17:35 +0000 (10:17 +0200)
We can launch qemu with it, but it will not work since it's not even
probed by the kernel at the mapped address with different machine types
since they are expected to be connected to ISA and not even its newer
LPC counterpart found on q35.  And it does not exist on non-x86
architectures.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/qemu/qemu_validate.c
tests/qemuxml2argvdata/watchdog-q35-multiple.x86_64-latest.args
tests/qemuxml2argvdata/watchdog-q35-multiple.xml
tests/qemuxml2xmloutdata/watchdog-q35-multiple.x86_64-latest.xml

index b8d5e9bd74e99a8f0a748932e9d8961edaeb1e13..6ebd2ba0101fb7d69af886c45f3cd6d5b65d90bb 100644 (file)
@@ -2320,6 +2320,13 @@ qemuValidateDomainWatchdogDef(const virDomainWatchdogDef *dev,
         break;
 
     case VIR_DOMAIN_WATCHDOG_MODEL_IB700:
+        if (!qemuDomainIsI440FX(def)) {
+            virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+                           _("%1$s model of watchdog cannot be used with this machine type"),
+                           virDomainWatchdogModelTypeToString(dev->model));
+            return -1;
+        }
+
         if (dev->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE) {
             virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
                            _("%1$s model of watchdog does not support configuring the address"),
index 655d206421b6b79e0ffd8cdb5e09b2024a1be9b0..4c14a955208819b4b548997990bdfb86a1e7403d 100644 (file)
@@ -31,8 +31,8 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
 -device '{"driver":"pcie-root-port","port":9,"chassis":3,"id":"pci.3","bus":"pcie.0","addr":"0x1.0x1"}' \
 -device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.2","addr":"0x1"}' \
 -audiodev '{"id":"audio1","driver":"none"}' \
--device '{"driver":"ib700","id":"watchdog0"}' \
--device '{"driver":"i6300esb","id":"watchdog1","bus":"pci.2","addr":"0x2"}' \
+-device '{"driver":"i6300esb","id":"watchdog0","bus":"pci.2","addr":"0x2"}' \
+-device '{"driver":"i6300esb","id":"watchdog1","bus":"pci.2","addr":"0x3"}' \
 -global ICH9-LPC.noreboot=off \
 -watchdog-action poweroff \
 -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
index af0cb169f0d9a324413173c518b1a2fbee6e6133..1ed3aff41482166160a7c3384a0459a1889fb82c 100644 (file)
@@ -18,7 +18,7 @@
     <controller type='usb' index='0'/>
     <input type='mouse' bus='ps2'/>
     <input type='keyboard' bus='ps2'/>
-    <watchdog model='ib700' action='poweroff'/>
+    <watchdog model='i6300esb' action='poweroff'/>
     <watchdog model='i6300esb' action='poweroff'/>
     <memballoon model='none'/>
   </devices>
index 7e60c6e6517db135b8f36bb3588e002819c3f6b9..1ea084854ee6e54cb94b2a7296b5c8e327c76ec2 100644 (file)
     <input type='mouse' bus='ps2'/>
     <input type='keyboard' bus='ps2'/>
     <audio id='1' type='none'/>
-    <watchdog model='ib700' action='poweroff'/>
     <watchdog model='i6300esb' action='poweroff'>
       <address type='pci' domain='0x0000' bus='0x02' slot='0x02' function='0x0'/>
     </watchdog>
+    <watchdog model='i6300esb' action='poweroff'>
+      <address type='pci' domain='0x0000' bus='0x02' slot='0x03' function='0x0'/>
+    </watchdog>
     <watchdog model='itco' action='poweroff'/>
     <memballoon model='none'/>
   </devices>