blockdev: Clean up how readonly persists across virtual media change
commit528f7663473e146fd1b435d73ca21b219451877c
authorMarkus Armbruster <armbru@redhat.com>
Fri, 25 Jun 2010 13:26:48 +0000 (25 15:26 +0200)
committerKevin Wolf <kwolf@redhat.com>
Tue, 6 Jul 2010 15:05:49 +0000 (6 17:05 +0200)
tree1e6b6373da72dc492f473bda54f05333f2ea294b
parent2930b313dd602d67a568815b0b031b824916cec9
blockdev: Clean up how readonly persists across virtual media change

Since commit cb4e5f8e, monitor command change makes the new media
readonly iff the type hint is BDRV_TYPE_CDROM, i.e. the drive was
created with media=cdrom.  The intention is to avoid changing a block
device's read-only-ness.  However, BDRV_TYPE_CDROM is only a hint.  It
is currently sufficent for read-only.  But it's not necessary, and it
may not remain sufficient.

Use bdrv_is_read_only() instead.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
blockdev.c