diff options
author | Kevin Wolf <kwolf@redhat.com> | 2013-09-13 15:51:47 +0200 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2013-10-11 16:50:01 +0200 |
commit | 4f8a066b5fc254eeaabbbde56ba4f5b29cc68fdf (patch) | |
tree | caca58e5bd84ca7eaf74ed97b128ca966c29ba98 /blockdev.c | |
parent | 394c7d4d6bd06386308e2fef0cf1c613a10e0d23 (diff) | |
download | qemu-4f8a066b5fc254eeaabbbde56ba4f5b29cc68fdf.zip qemu-4f8a066b5fc254eeaabbbde56ba4f5b29cc68fdf.tar.gz qemu-4f8a066b5fc254eeaabbbde56ba4f5b29cc68fdf.tar.bz2 |
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 <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'blockdev.c')
-rw-r--r-- | blockdev.c | 6 |
1 files changed, 0 insertions, 6 deletions
@@ -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; |