Revision f455e98c hw/ide/core.c

b/hw/ide/core.c
2506 2506
    s->media_changed = 0;
2507 2507
}
2508 2508

  
2509
void ide_init2(IDEBus *bus, BlockDriverState *hd0, BlockDriverState *hd1,
2509
void ide_init2(IDEBus *bus, DriveInfo *hd0, DriveInfo *hd1,
2510 2510
               qemu_irq irq)
2511 2511
{
2512 2512
    IDEState *s;
......
2518 2518
        s = bus->ifs + i;
2519 2519
        s->bus = bus;
2520 2520
        s->unit = i;
2521
        s->bs = (i == 0) ? hd0 : hd1;
2521
        if (i == 0 && hd0)
2522
            s->bs = hd0->bdrv;
2523
        if (i == 1 && hd1)
2524
            s->bs = hd1->bdrv;
2522 2525
        s->io_buffer = qemu_blockalign(s->bs, IDE_DMA_BUF_SECTORS*512 + 4);
2523 2526
        if (s->bs) {
2524 2527
            bdrv_get_geometry(s->bs, &nb_sectors);

Also available in: Unified diff