Revision 908c7b9f

b/hw/xen_disk.c
179 179
    switch (ioreq->req.operation) {
180 180
    case BLKIF_OP_READ:
181 181
	ioreq->prot = PROT_WRITE; /* to memory */
182
        if (ioreq->req.operation != BLKIF_OP_READ && blkdev->mode[0] != 'w') {
183
	    xen_be_printf(&blkdev->xendev, 0, "error: write req for ro device\n");
184
	    goto err;
185
	}
186 182
	break;
187 183
    case BLKIF_OP_WRITE_BARRIER:
188 184
	if (!syncwrite)
......
199 195
	goto err;
200 196
    };
201 197

  
198
    if (ioreq->req.operation != BLKIF_OP_READ && blkdev->mode[0] != 'w') {
199
        xen_be_printf(&blkdev->xendev, 0, "error: write req for ro device\n");
200
        goto err;
201
    }
202

  
202 203
    ioreq->start = ioreq->req.sector_number * blkdev->file_blk;
203 204
    for (i = 0; i < ioreq->req.nr_segments; i++) {
204 205
	if (i == BLKIF_MAX_SEGMENTS_PER_REQUEST) {

Also available in: Unified diff