diff mbox series

[RFC,03/10] hw/i386/pc_piix: Allow for setting properties on "piix3-ide" before realizing it

Message ID 20220627071611.8793-4-shentey@gmail.com (mailing list archive)
State New, archived
Headers show
Series Resolve isabus global | expand

Commit Message

Bernhard Beschow June 27, 2022, 7:16 a.m. UTC
The next patch will introduce a quirk for user-created PIIX IDE devices for
backwards compatibility. In order to opt-in to new behavior for builtin
devices a property will need to be set until a deprecation period is over.

Signed-off-by: Bernhard Beschow <shentey@gmail.com>
---
 hw/i386/pc_piix.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index 0fc2361ffe..2d146b19c0 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -252,7 +252,8 @@  static void pc_init1(MachineState *machine,
     if (pcmc->pci_enabled) {
         PCIDevice *dev;
 
-        dev = pci_create_simple(pci_bus, piix3_devfn + 1, "piix3-ide");
+        dev = pci_new_multifunction(piix3_devfn + 1, false, "piix3-ide");
+        pci_realize_and_unref(dev, pci_bus, &error_fatal);
         pci_ide_create_devs(dev);
         idebus[0] = qdev_get_child_bus(&dev->qdev, "ide.0");
         idebus[1] = qdev_get_child_bus(&dev->qdev, "ide.1");