diff options
author | Martin Kletzander <mkletzan@redhat.com> | 2023-04-19 13:54:02 +0200 |
---|---|---|
committer | Martin Kletzander <mkletzan@redhat.com> | 2023-04-20 10:17:35 +0200 |
commit | 2669b442f9c3cb65bfcbd24f04130e6f9eaeebfc (patch) | |
tree | 2edd213805c2b0a066cf910a9fdee26f911ba5c7 | |
parent | 18f7dd6f1fc332438719b7e35841990bdc48622b (diff) | |
download | libvirt-2669b442f9c3cb65bfcbd24f04130e6f9eaeebfc.tar.gz |
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>
4 files changed, 13 insertions, 4 deletions
diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index b8d5e9bd74..6ebd2ba010 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -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"), diff --git a/tests/qemuxml2argvdata/watchdog-q35-multiple.x86_64-latest.args b/tests/qemuxml2argvdata/watchdog-q35-multiple.x86_64-latest.args index 655d206421..4c14a95520 100644 --- a/tests/qemuxml2argvdata/watchdog-q35-multiple.x86_64-latest.args +++ b/tests/qemuxml2argvdata/watchdog-q35-multiple.x86_64-latest.args @@ -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 \ diff --git a/tests/qemuxml2argvdata/watchdog-q35-multiple.xml b/tests/qemuxml2argvdata/watchdog-q35-multiple.xml index af0cb169f0..1ed3aff414 100644 --- a/tests/qemuxml2argvdata/watchdog-q35-multiple.xml +++ b/tests/qemuxml2argvdata/watchdog-q35-multiple.xml @@ -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> diff --git a/tests/qemuxml2xmloutdata/watchdog-q35-multiple.x86_64-latest.xml b/tests/qemuxml2xmloutdata/watchdog-q35-multiple.x86_64-latest.xml index 7e60c6e651..1ea084854e 100644 --- a/tests/qemuxml2xmloutdata/watchdog-q35-multiple.x86_64-latest.xml +++ b/tests/qemuxml2xmloutdata/watchdog-q35-multiple.x86_64-latest.xml @@ -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> |