mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-12-17 21:26:13 -07:00
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:
parent
e2982c3a27
commit
757179038c
10 changed files with 28 additions and 69 deletions
10
hw/pc_piix.c
10
hw/pc_piix.c
|
|
@ -129,15 +129,7 @@ static void pc_init1(ram_addr_t ram_size,
|
|||
pci_nic_init_nofail(nd, "e1000", NULL);
|
||||
}
|
||||
|
||||
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);
|
||||
if (pci_enabled) {
|
||||
PCIDevice *dev;
|
||||
dev = pci_piix3_ide_init(pci_bus, hd, piix3_devfn + 1);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue