ide: consolidate drive_get(IF_IDE)

factor out ide initialization to call drive_get(IF_IDE)

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
Isaku Yamahata 2011-04-03 20:32:46 +09:00 committed by Kevin Wolf
parent e2982c3a27
commit 757179038c
10 changed files with 28 additions and 69 deletions

View file

@ -681,15 +681,7 @@ static void ppc_prep_init (ram_addr_t ram_size,
}
}
if (drive_get_max_bus(IF_IDE) >= MAX_IDE_BUS) {
fprintf(stderr, "qemu: too many IDE bus\n");
exit(1);
}
for(i = 0; i < MAX_IDE_BUS * MAX_IDE_DEVS; i++) {
hd[i] = drive_get(IF_IDE, i / MAX_IDE_DEVS, i % MAX_IDE_DEVS);
}
ide_drive_get(hd, MAX_IDE_BUS);
for(i = 0; i < MAX_IDE_BUS; i++) {
isa_ide_init(ide_iobase[i], ide_iobase2[i], ide_irq[i],
hd[2 * i],