mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
hw/pcspk: check the "pit" is set
We don't let the user create a "isa-pcspk" via -device yet (in theory, we could, and fallback on a lookup PIT), but we can add some safety checks that the property was correctly set nonetheless. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-ID: <20251021090317.425409-7-marcandre.lureau@redhat.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
This commit is contained in:
committed by
Philippe Mathieu-Daudé
parent
64a013e18b
commit
840c2c4ed9
@@ -189,6 +189,11 @@ static void pcspk_realizefn(DeviceState *dev, Error **errp)
|
||||
ISADevice *isadev = ISA_DEVICE(dev);
|
||||
PCSpkState *s = PC_SPEAKER(dev);
|
||||
|
||||
if (!s->pit) {
|
||||
error_setg(errp, "pcspk: No \"pit\" set or available");
|
||||
return;
|
||||
}
|
||||
|
||||
isa_register_ioport(isadev, &s->ioport, s->iobase);
|
||||
|
||||
if (s->card.state && AUD_register_card(s_spk, &s->card, errp)) {
|
||||
|
||||
Reference in New Issue
Block a user