[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH 01/10] hw/ide/piix: Check for presence of ISABus before using
From: |
Bernhard Beschow |
Subject: |
[RFC PATCH 01/10] hw/ide/piix: Check for presence of ISABus before using it |
Date: |
Mon, 27 Jun 2022 09:16:02 +0200 |
This is an alternative solution to commit
9405d87be25db6dff4d7b5ab48a81bbf6d083e47 'hw/ide: Fix crash when plugging a
piix3-ide device into the x-remote machine' which allows for cleaning up the
ISA API while keeping PIIX IDE functions user-createable for an arbitrarily
long deprecation period.
Signed-off-by: Bernhard Beschow <shentey@gmail.com>
---
hw/ide/piix.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/hw/ide/piix.c b/hw/ide/piix.c
index 9a9b28078e..e8f3abc4b5 100644
--- a/hw/ide/piix.c
+++ b/hw/ide/piix.c
@@ -136,6 +136,17 @@ static int pci_piix_init_ports(PCIIDEState *d)
};
int i, ret;
+ {
+ ISABus *isa_bus;
+ bool ambiguous;
+
+ isa_bus = ISA_BUS(object_resolve_path_type("", TYPE_ISA_BUS,
+ &ambiguous));
+ if (!isa_bus || ambiguous) {
+ return -ENODEV;
+ }
+ }
+
for (i = 0; i < 2; i++) {
ide_bus_init(&d->bus[i], sizeof(d->bus[i]), DEVICE(d), i, 2);
ret = ide_init_ioport(&d->bus[i], NULL, port_info[i].iobase,
--
2.36.1
- [RFC PATCH 00/10] Resolve isabus global, Bernhard Beschow, 2022/06/27
- [RFC PATCH 01/10] hw/ide/piix: Check for presence of ISABus before using it,
Bernhard Beschow <=
- [RFC PATCH 02/10] Revert "hw/ide: Fix crash when plugging a piix3-ide device into the x-remote machine", Bernhard Beschow, 2022/06/27
- [RFC PATCH 06/10] hw/ide/ioport: Rename ide_init_ioport() to isa_ide_init_ioport(), Bernhard Beschow, 2022/06/27
- [RFC PATCH 05/10] hw/isa/isa-bus: assert() if isa_get_irq() gets passed a NULL ISADevice, Bernhard Beschow, 2022/06/27
- [RFC PATCH 04/10] hw/ide/piix: Avoid the isabus global when wiring ISA interrupts for internal devices, Bernhard Beschow, 2022/06/27
- [RFC PATCH 08/10] hw/ide/piix: Use pci_ide_init_ioport() rather than isa_ide_init_ioport(), Bernhard Beschow, 2022/06/27
- [RFC PATCH 09/10] hw/isa: Resolve unneeded usage of isabus global, Bernhard Beschow, 2022/06/27
- [RFC PATCH 10/10] hw/isa/isa-bus: Resolve isabus global, Bernhard Beschow, 2022/06/27
- [RFC PATCH 07/10] hw/pci/pci: Introduce pci_register_portio_list(), Bernhard Beschow, 2022/06/27
- [RFC PATCH 03/10] hw/i386/pc_piix: Allow for setting properties on "piix3-ide" before realizing it, Bernhard Beschow, 2022/06/27