diff options
Diffstat (limited to 'hw/ppc440_bamboo.c')
-rw-r--r-- | hw/ppc440_bamboo.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/hw/ppc440_bamboo.c b/hw/ppc440_bamboo.c index d9ef3eca82..624e15b117 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++; } |