diff options
author | BALATON Zoltan <balaton@eik.bme.hu> | 2020-03-17 16:05:37 +0100 |
---|---|---|
committer | John Snow <jsnow@redhat.com> | 2020-03-17 12:22:36 -0400 |
commit | df45d38f7328219a709047ebf3b726d0f4ba4ee7 (patch) | |
tree | 0162af3e328f8aac6bcb920b2831e7b1bdfb5519 /hw | |
parent | 6e9d611a1b4f858962cccfe16625bd82aa894e25 (diff) | |
download | qemu-df45d38f7328219a709047ebf3b726d0f4ba4ee7.zip qemu-df45d38f7328219a709047ebf3b726d0f4ba4ee7.tar.gz qemu-df45d38f7328219a709047ebf3b726d0f4ba4ee7.tar.bz2 |
hw/ide: Get rid of piix3_init functions
This removes pci_piix3_ide_init() and pci_piix3_xen_ide_init()
functions similar to clean up done to other ide devices.
Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
Reviewed-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Message-id: adddfa21552783020d64e1314318cab6d24362c3.1584457537.git.balaton@eik.bme.hu
Signed-off-by: John Snow <jsnow@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/i386/pc_piix.c | 10 | ||||
-rw-r--r-- | hw/ide/pci.c | 1 | ||||
-rw-r--r-- | hw/ide/piix.c | 21 |
3 files changed, 7 insertions, 25 deletions
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index e2d9824..c399398 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -39,6 +39,7 @@ #include "hw/usb.h" #include "net/net.h" #include "hw/ide.h" +#include "hw/ide/pci.h" #include "hw/irq.h" #include "sysemu/kvm.h" #include "hw/kvm/clock.h" @@ -242,11 +243,10 @@ static void pc_init1(MachineState *machine, ide_drive_get(hd, ARRAY_SIZE(hd)); if (pcmc->pci_enabled) { PCIDevice *dev; - if (xen_enabled()) { - dev = pci_piix3_xen_ide_init(pci_bus, hd, piix3_devfn + 1); - } else { - dev = pci_piix3_ide_init(pci_bus, hd, piix3_devfn + 1); - } + + dev = pci_create_simple(pci_bus, piix3_devfn + 1, + xen_enabled() ? "piix3-ide-xen" : "piix3-ide"); + pci_ide_create_devs(dev, hd); idebus[0] = qdev_get_child_bus(&dev->qdev, "ide.0"); idebus[1] = qdev_get_child_bus(&dev->qdev, "ide.1"); pc_cmos_init(pcms, idebus[0], idebus[1], rtc_state); diff --git a/hw/ide/pci.c b/hw/ide/pci.c index 1a6a287..4fc76c5 100644 --- a/hw/ide/pci.c +++ b/hw/ide/pci.c @@ -476,6 +476,7 @@ const VMStateDescription vmstate_ide_pci = { } }; +/* hd_table must contain 4 block drivers */ void pci_ide_create_devs(PCIDevice *dev, DriveInfo **hd_table) { PCIIDEState *d = PCI_IDE(dev); diff --git a/hw/ide/piix.c b/hw/ide/piix.c index bc575b4..8bcd6b7 100644 --- a/hw/ide/piix.c +++ b/hw/ide/piix.c @@ -197,15 +197,6 @@ int pci_piix3_xen_ide_unplug(DeviceState *dev, bool aux) return 0; } -PCIDevice *pci_piix3_xen_ide_init(PCIBus *bus, DriveInfo **hd_table, int devfn) -{ - PCIDevice *dev; - - dev = pci_create_simple(bus, devfn, "piix3-ide-xen"); - pci_ide_create_devs(dev, hd_table); - return dev; -} - static void pci_piix_ide_exitfn(PCIDevice *dev) { PCIIDEState *d = PCI_IDE(dev); @@ -218,17 +209,6 @@ static void pci_piix_ide_exitfn(PCIDevice *dev) } /* hd_table must contain 4 block drivers */ -/* NOTE: for the PIIX3, the IRQs and IOports are hardcoded */ -PCIDevice *pci_piix3_ide_init(PCIBus *bus, DriveInfo **hd_table, int devfn) -{ - PCIDevice *dev; - - dev = pci_create_simple(bus, devfn, "piix3-ide"); - pci_ide_create_devs(dev, hd_table); - return dev; -} - -/* hd_table must contain 4 block drivers */ /* NOTE: for the PIIX4, the IRQs and IOports are hardcoded */ PCIDevice *pci_piix4_ide_init(PCIBus *bus, DriveInfo **hd_table, int devfn) { @@ -239,6 +219,7 @@ PCIDevice *pci_piix4_ide_init(PCIBus *bus, DriveInfo **hd_table, int devfn) return dev; } +/* NOTE: for the PIIX3, the IRQs and IOports are hardcoded */ static void piix3_ide_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); |