Revision 2db7ad59 vl.c

b/vl.c
1185 1185
        bdrv_flags &= ~BDRV_O_NATIVE_AIO;
1186 1186
    }
1187 1187

  
1188
    if (ro == 1) {
1188
    if (media == MEDIA_CDROM) {
1189
        /* CDROM is fine for any interface, don't check.  */
1190
        ro = 1;
1191
    } else if (ro == 1) {
1189 1192
        if (type != IF_SCSI && type != IF_VIRTIO && type != IF_FLOPPY) {
1190 1193
            fprintf(stderr, "qemu: readonly flag not supported for drive with this interface\n");
1191 1194
            return NULL;
1192 1195
        }
1193 1196
    }
1194
    /* 
1195
     * cdrom is read-only. Set it now, after above interface checking
1196
     * since readonly attribute not explicitly required, so no error.
1197
     */
1198
    if (media == MEDIA_CDROM) {
1199
        ro = 1;
1200
    }
1197

  
1201 1198
    bdrv_flags |= ro ? 0 : BDRV_O_RDWR;
1202 1199

  
1203 1200
    if (bdrv_open2(dinfo->bdrv, file, bdrv_flags, drv) < 0) {

Also available in: Unified diff