Revision f455e98c hw/pc.c

b/hw/pc.c
264 264

  
265 265
/* hd_table must contain 4 block drivers */
266 266
static void cmos_init(ram_addr_t ram_size, ram_addr_t above_4g_mem_size,
267
                      const char *boot_device, BlockDriverState **hd_table)
267
                      const char *boot_device, DriveInfo **hd_table)
268 268
{
269 269
    RTCState *s = rtc_state;
270 270
    int nbds, bds[3] = { 0, };
......
355 355

  
356 356
    rtc_set_memory(s, 0x12, (hd_table[0] ? 0xf0 : 0) | (hd_table[1] ? 0x0f : 0));
357 357
    if (hd_table[0])
358
        cmos_init_hd(0x19, 0x1b, hd_table[0]);
358
        cmos_init_hd(0x19, 0x1b, hd_table[0]->bdrv);
359 359
    if (hd_table[1])
360
        cmos_init_hd(0x1a, 0x24, hd_table[1]);
360
        cmos_init_hd(0x1a, 0x24, hd_table[1]->bdrv);
361 361

  
362 362
    val = 0;
363 363
    for (i = 0; i < 4; i++) {
......
367 367
                geometry.  It is always such that: 1 <= sects <= 63, 1
368 368
                <= heads <= 16, 1 <= cylinders <= 16383. The BIOS
369 369
                geometry can be different if a translation is done. */
370
            translation = bdrv_get_translation_hint(hd_table[i]);
370
            translation = bdrv_get_translation_hint(hd_table[i]->bdrv);
371 371
            if (translation == BIOS_ATA_TRANSLATION_AUTO) {
372
                bdrv_get_geometry_hint(hd_table[i], &cylinders, &heads, &sectors);
372
                bdrv_get_geometry_hint(hd_table[i]->bdrv, &cylinders, &heads, &sectors);
373 373
                if (cylinders <= 1024 && heads <= 16 && sectors <= 63) {
374 374
                    /* No translation. */
375 375
                    translation = 0;
......
1131 1131
    qemu_irq *i8259;
1132 1132
    IsaIrqState *isa_irq_state;
1133 1133
    DriveInfo *dinfo;
1134
    BlockDriverState *hd[MAX_IDE_BUS * MAX_IDE_DEVS];
1134
    DriveInfo *hd[MAX_IDE_BUS * MAX_IDE_DEVS];
1135 1135
    BlockDriverState *fd[MAX_FD];
1136 1136
    int using_vga = cirrus_vga_enabled || std_vga_enabled || vmsvga_enabled;
1137 1137
    void *fw_cfg;
......
1359 1359
    }
1360 1360

  
1361 1361
    for(i = 0; i < MAX_IDE_BUS * MAX_IDE_DEVS; i++) {
1362
        dinfo = drive_get(IF_IDE, i / MAX_IDE_DEVS, i % MAX_IDE_DEVS);
1363
        hd[i] = dinfo ? dinfo->bdrv : NULL;
1362
        hd[i] = drive_get(IF_IDE, i / MAX_IDE_DEVS, i % MAX_IDE_DEVS);
1364 1363
    }
1365 1364

  
1366 1365
    if (pci_enabled) {

Also available in: Unified diff