diff options
| author | Kevin Wolf | 2019-07-30 15:37:08 +0200 |
|---|---|---|
| committer | Kevin Wolf | 2019-07-30 17:31:58 +0200 |
| commit | 0b9e918f03df47ae393fa68d9ac37ce4820cbaaf (patch) | |
| tree | 1b9ed026b183b18e9ec0cab1542b2e3dff51fb35 /block/commit.c | |
| parent | Merge remote-tracking branch 'remotes/maxreitz/tags/pull-block-2019-07-30' in... (diff) | |
| download | qemu-0b9e918f03df47ae393fa68d9ac37ce4820cbaaf.tar.gz qemu-0b9e918f03df47ae393fa68d9ac37ce4820cbaaf.tar.xz qemu-0b9e918f03df47ae393fa68d9ac37ce4820cbaaf.zip | |
fdc: Fix inserting read-only media in empty drive
In order to insert a read-only medium (i.e. a read-only block node) to
the BlockBackend of a floppy drive, we must not have taken write
permissions on that BlockBackend, or the operation will fail with the
error message "Block node is read-only".
The device already takes care to remove all permissions when the medium
is ejected, but the state isn't correct if the drive is initially empty:
It uses blk_is_read_only() to check whether write permissions should be
taken, but this function returns false for empty BlockBackends in the
common case.
Fix floppy_drive_realize() to avoid taking write permissions if the
drive is empty.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
Diffstat (limited to 'block/commit.c')
0 files changed, 0 insertions, 0 deletions
