« Previous | Next » 

Revision 528f7663


Added by Markus Armbruster over 11 years ago

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 <>
Signed-off-by: Kevin Wolf <>


  • added
  • modified
  • copied
  • renamed
  • deleted

View differences