Revision 1c66869a

b/hw/ide/core.c
1019 1019
    return true;
1020 1020
}
1021 1021

  
1022
static bool cmd_identify(IDEState *s, uint8_t cmd)
1023
{
1024
    if (s->bs && s->drive_kind != IDE_CD) {
1025
        if (s->drive_kind != IDE_CFATA) {
1026
            ide_identify(s);
1027
        } else {
1028
            ide_cfata_identify(s);
1029
        }
1030
        s->status = READY_STAT | SEEK_STAT;
1031
        ide_transfer_start(s, s->io_buffer, 512, ide_transfer_stop);
1032
        ide_set_irq(s->bus);
1033
        return false;
1034
    } else {
1035
        if (s->drive_kind == IDE_CD) {
1036
            ide_set_signature(s);
1037
        }
1038
        ide_abort_command(s);
1039
    }
1040

  
1041
    return true;
1042
}
1043

  
1022 1044
#define HD_OK (1u << IDE_HD)
1023 1045
#define CD_OK (1u << IDE_CD)
1024 1046
#define CFA_OK (1u << IDE_CFATA)
......
1086 1108
    [WIN_SLEEPNOW1]               = { NULL, ALL_OK },
1087 1109
    [WIN_FLUSH_CACHE]             = { NULL, ALL_OK },
1088 1110
    [WIN_FLUSH_CACHE_EXT]         = { NULL, HD_CFA_OK },
1089
    [WIN_IDENTIFY]                = { NULL, ALL_OK },
1111
    [WIN_IDENTIFY]                = { cmd_identify, ALL_OK },
1090 1112
    [WIN_SETFEATURES]             = { NULL, ALL_OK },
1091 1113
    [IBM_SENSE_CONDITION]         = { NULL, CFA_OK },
1092 1114
    [CFA_WEAR_LEVEL]              = { NULL, HD_CFA_OK },
......
1144 1166
    }
1145 1167

  
1146 1168
    switch(val) {
1147
    case WIN_IDENTIFY:
1148
        if (s->bs && s->drive_kind != IDE_CD) {
1149
            if (s->drive_kind != IDE_CFATA)
1150
                ide_identify(s);
1151
            else
1152
                ide_cfata_identify(s);
1153
            s->status = READY_STAT | SEEK_STAT;
1154
            ide_transfer_start(s, s->io_buffer, 512, ide_transfer_stop);
1155
        } else {
1156
            if (s->drive_kind == IDE_CD) {
1157
                ide_set_signature(s);
1158
            }
1159
            ide_abort_command(s);
1160
        }
1161
        ide_set_irq(s->bus);
1162
        break;
1163 1169
    case WIN_SPECIFY:
1164 1170
    case WIN_RECAL:
1165 1171
        s->error = 0;

Also available in: Unified diff