From 4f8a066b5fc254eeaabbbde56ba4f5b29cc68fdf Mon Sep 17 00:00:00 2001 From: Kevin Wolf Date: Fri, 13 Sep 2013 15:51:47 +0200 Subject: blockdev: Remove IF_* check for read-only blockdev_init IF_NONE allows read-only, which makes forbidding it in this place for other types pretty much pointless. Instead, make sure that all devices for which the check would have errored out check in their init function that they don't get a read-only BlockDriverState. This catches even cases where IF_NONE and -device is used. Signed-off-by: Kevin Wolf Reviewed-by: Eric Blake --- blockdev.c | 6 ------ 1 file changed, 6 deletions(-) (limited to 'blockdev.c') diff --git a/blockdev.c b/blockdev.c index b11155caef..401ee25e02 100644 --- a/blockdev.c +++ b/blockdev.c @@ -528,12 +528,6 @@ static DriveInfo *blockdev_init(QDict *bs_opts, if (media == MEDIA_CDROM) { /* CDROM is fine for any interface, don't check. */ ro = 1; - } else if (ro == 1) { - if (type != IF_SCSI && type != IF_VIRTIO && type != IF_FLOPPY && - type != IF_NONE && type != IF_PFLASH) { - error_report("read-only not supported by this bus type"); - goto err; - } } bdrv_flags |= ro ? 0 : BDRV_O_RDWR; -- cgit v1.2.1