[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 19/23] ide: Make PIIX and ISA IDE init functions ret
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PATCH 19/23] ide: Make PIIX and ISA IDE init functions return the qdev |
Date: |
Fri, 2 Jul 2010 18:38:28 +0200 |
From: Markus Armbruster <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
hw/ide.h | 11 ++++++-----
hw/ide/isa.c | 8 ++++----
hw/ide/piix.c | 6 ++++--
3 files changed, 14 insertions(+), 11 deletions(-)
diff --git a/hw/ide.h b/hw/ide.h
index bb635b6..82b3c11 100644
--- a/hw/ide.h
+++ b/hw/ide.h
@@ -1,17 +1,18 @@
#ifndef HW_IDE_H
#define HW_IDE_H
-#include "qdev.h"
+#include "isa.h"
+#include "pci.h"
/* ide-isa.c */
-int isa_ide_init(int iobase, int iobase2, int isairq,
- DriveInfo *hd0, DriveInfo *hd1);
+ISADevice *isa_ide_init(int iobase, int iobase2, int isairq,
+ DriveInfo *hd0, DriveInfo *hd1);
/* ide-pci.c */
void pci_cmd646_ide_init(PCIBus *bus, DriveInfo **hd_table,
int secondary_ide_enabled);
-void pci_piix3_ide_init(PCIBus *bus, DriveInfo **hd_table, int devfn);
-void pci_piix4_ide_init(PCIBus *bus, DriveInfo **hd_table, int devfn);
+PCIDevice *pci_piix3_ide_init(PCIBus *bus, DriveInfo **hd_table, int devfn);
+PCIDevice *pci_piix4_ide_init(PCIBus *bus, DriveInfo **hd_table, int devfn);
void vt82c686b_ide_init(PCIBus *bus, DriveInfo **hd_table, int devfn);
/* ide-macio.c */
diff --git a/hw/ide/isa.c b/hw/ide/isa.c
index b6c6347..10777ca 100644
--- a/hw/ide/isa.c
+++ b/hw/ide/isa.c
@@ -75,8 +75,8 @@ static int isa_ide_initfn(ISADevice *dev)
return 0;
};
-int isa_ide_init(int iobase, int iobase2, int isairq,
- DriveInfo *hd0, DriveInfo *hd1)
+ISADevice *isa_ide_init(int iobase, int iobase2, int isairq,
+ DriveInfo *hd0, DriveInfo *hd1)
{
ISADevice *dev;
ISAIDEState *s;
@@ -86,14 +86,14 @@ int isa_ide_init(int iobase, int iobase2, int isairq,
qdev_prop_set_uint32(&dev->qdev, "iobase2", iobase2);
qdev_prop_set_uint32(&dev->qdev, "irq", isairq);
if (qdev_init(&dev->qdev) < 0)
- return -1;
+ return NULL;
s = DO_UPCAST(ISAIDEState, dev, dev);
if (hd0)
ide_create_drive(&s->bus, 0, hd0);
if (hd1)
ide_create_drive(&s->bus, 1, hd1);
- return 0;
+ return dev;
}
static ISADeviceInfo isa_ide_info = {
diff --git a/hw/ide/piix.c b/hw/ide/piix.c
index dad6e86..fa22226 100644
--- a/hw/ide/piix.c
+++ b/hw/ide/piix.c
@@ -160,22 +160,24 @@ static int pci_piix4_ide_initfn(PCIDevice *dev)
/* hd_table must contain 4 block drivers */
/* NOTE: for the PIIX3, the IRQs and IOports are hardcoded */
-void pci_piix3_ide_init(PCIBus *bus, DriveInfo **hd_table, int devfn)
+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 */
-void pci_piix4_ide_init(PCIBus *bus, DriveInfo **hd_table, int devfn)
+PCIDevice *pci_piix4_ide_init(PCIBus *bus, DriveInfo **hd_table, int devfn)
{
PCIDevice *dev;
dev = pci_create_simple(bus, devfn, "piix4-ide");
pci_ide_create_devs(dev, hd_table);
+ return dev;
}
static PCIDeviceInfo piix_ide_info[] = {
--
1.6.6.1
- [Qemu-devel] [PULL 00/23] Block patches, Kevin Wolf, 2010/07/02
- [Qemu-devel] [PATCH 01/23] qcow2: Fix error handling during metadata preallocation, Kevin Wolf, 2010/07/02
- [Qemu-devel] [PATCH 02/23] block: allow filenames with colons again for host devices, Kevin Wolf, 2010/07/02
- [Qemu-devel] [PATCH 03/23] scsi: scsi_bus_legacy_handle_cmdline() can fail, fix callers, Kevin Wolf, 2010/07/02
- [Qemu-devel] [PATCH 06/23] Don't reset bs->is_temporary in bdrv_open_common, Kevin Wolf, 2010/07/02
- [Qemu-devel] [PATCH 10/23] blockdev: drive_get_by_id() is no longer used, remove, Kevin Wolf, 2010/07/02
- [Qemu-devel] [PATCH 11/23] block: Catch attempt to attach multiple devices to a blockdev, Kevin Wolf, 2010/07/02
- [Qemu-devel] [PATCH 19/23] ide: Make PIIX and ISA IDE init functions return the qdev,
Kevin Wolf <=
- [Qemu-devel] [PATCH 20/23] pc: Fix CMOS info for drives defined with -device, Kevin Wolf, 2010/07/02
- [Qemu-devel] [PATCH 22/23] block: Fix early failure in multiwrite, Kevin Wolf, 2010/07/02
- [Qemu-devel] [PATCH 23/23] block: Handle multiwrite errors only when all requests have completed, Kevin Wolf, 2010/07/02
- [Qemu-devel] [PATCH 21/23] qemu-img: avoid calling exit(1) to release resources properly, Kevin Wolf, 2010/07/02
- [Qemu-devel] [PATCH 15/23] blkdebug: Initialize state as 1, Kevin Wolf, 2010/07/02
- [Qemu-devel] [PATCH 09/23] qdev: Decouple qdev_prop_drive from DriveInfo, Kevin Wolf, 2010/07/02
- [Qemu-devel] [PATCH 07/23] blockdev: New drive_get_by_blockdev(), Kevin Wolf, 2010/07/02
- [Qemu-devel] [PATCH 08/23] blockdev: Clean up automatic drive deletion, Kevin Wolf, 2010/07/02
- [Qemu-devel] [PATCH 17/23] block: Clean up bdrv_snapshots(), Kevin Wolf, 2010/07/02
- [Qemu-devel] [PATCH 18/23] block: Fix virtual media change for if=none, Kevin Wolf, 2010/07/02