aboutsummaryrefslogtreecommitdiff
path: root/hw/ppc440_bamboo.c
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2009-07-22 16:42:57 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2009-07-27 14:08:23 -0500
commit751c6a17042b5d011013d6963c0505d671cf708e (patch)
tree61a769ed1a1c16ebdfc1397ce9d775222dfa8e57 /hw/ppc440_bamboo.c
parent8a14daa5a1ae22fcfc317f4727a88d6c15c39aae (diff)
downloadqemu-751c6a17042b5d011013d6963c0505d671cf708e.zip
qemu-751c6a17042b5d011013d6963c0505d671cf708e.tar.gz
qemu-751c6a17042b5d011013d6963c0505d671cf708e.tar.bz2
kill drives_table
First step cleaning up the drives handling. This one does nothing but removing drives_table[], still it became seriously big. drive_get_index() is gone and is replaced by drives_get() which hands out DriveInfo pointers instead of a table index. This needs adaption in *tons* of places all over. The drives are now maintained as linked list. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/ppc440_bamboo.c')
-rw-r--r--hw/ppc440_bamboo.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/hw/ppc440_bamboo.c b/hw/ppc440_bamboo.c
index d9ef3ec..624e15b 100644
--- a/hw/ppc440_bamboo.c
+++ b/hw/ppc440_bamboo.c
@@ -102,6 +102,7 @@ static void bamboo_init(ram_addr_t ram_size,
target_ulong dt_base = 0;
void *fdt;
int i;
+ DriveInfo *dinfo;
/* Setup CPU. */
env = ppc440ep_init(&ram_size, &pcibus, pci_irq_nrs, 1, cpu_model);
@@ -110,8 +111,8 @@ static void bamboo_init(ram_addr_t ram_size,
int unit_id = 0;
/* Add virtio block devices. */
- while ((i = drive_get_index(IF_VIRTIO, 0, unit_id)) != -1) {
- pci_dev = pci_create("virtio-blk-pci", drives_table[i].devaddr);
+ while ((dinfo = drive_get(IF_VIRTIO, 0, unit_id)) != NULL) {
+ pci_dev = pci_create("virtio-blk-pci", dinfo->devaddr);
qdev_init(&pci_dev->qdev);
unit_id++;
}