Revision abd7f68d blockdev.c

b/blockdev.c
90 90
    return "\0";
91 91
}
92 92

  
93
BlockInterfaceErrorAction drive_get_on_error(
94
    BlockDriverState *bdrv, int is_read)
95
{
96
    DriveInfo *dinfo;
97

  
98
    QTAILQ_FOREACH(dinfo, &drives, next) {
99
        if (dinfo->bdrv == bdrv)
100
            return is_read ? dinfo->on_read_error : dinfo->on_write_error;
101
    }
102

  
103
    return is_read ? BLOCK_ERR_REPORT : BLOCK_ERR_STOP_ENOSPC;
104
}
105

  
106 93
static void bdrv_format_print(void *opaque, const char *name)
107 94
{
108 95
    fprintf(stderr, " %s", name);
......
418 405
    dinfo->type = type;
419 406
    dinfo->bus = bus_id;
420 407
    dinfo->unit = unit_id;
421
    dinfo->on_read_error = on_read_error;
422
    dinfo->on_write_error = on_write_error;
423 408
    dinfo->opts = opts;
424 409
    if (serial)
425 410
        strncpy(dinfo->serial, serial, sizeof(dinfo->serial) - 1);
426 411
    QTAILQ_INSERT_TAIL(&drives, dinfo, next);
427 412

  
413
    bdrv_set_on_error(dinfo->bdrv, on_read_error, on_write_error);
414

  
428 415
    switch(type) {
429 416
    case IF_IDE:
430 417
    case IF_SCSI:

Also available in: Unified diff