Revision 528f7663

b/blockdev.c
589 589
    if (eject_device(mon, bs, 0) < 0) {
590 590
        return -1;
591 591
    }
592
    bdrv_flags = bdrv_get_type_hint(bs) == BDRV_TYPE_CDROM ? 0 : BDRV_O_RDWR;
592
    bdrv_flags = bdrv_is_read_only(bs) ? 0 : BDRV_O_RDWR;
593 593
    if (bdrv_open(bs, filename, bdrv_flags, drv) < 0) {
594 594
        qerror_report(QERR_OPEN_FILE_FAILED, filename);
595 595
        return -1;

Also available in: Unified diff