qemu: Forbid ib700 watchdogs for non-i440fx machine types

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>
This commit is contained in:
Martin Kletzander 2023-04-19 13:54:02 +02:00
parent 18f7dd6f1f
commit 2669b442f9
4 changed files with 13 additions and 4 deletions

View 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"),

View 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 \

View 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>

View File

@ -41,10 +41,12 @@
<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>