Stefan Hajnoczi da888d37b0 block/raw-posix: detect readonly Linux block devices using BLKROGET
Linux block devices can be set read-only with "blockdev --setro
<device>".  The same thing can be done for LVM volumes using "lvchange
--permission r <volume>".  This read-only setting is independent of
device node permissions.  Therefore the device can still be opened
O_RDWR but actual writes will fail.

This results in odd behavior for QEMU.  bdrv_open() is supposed to fail
if a read-only image is being opened with BDRV_O_RDWR.  By not failing
for Linux block devices, the guest boots up but every write produces an
I/O error.

This patch checks whether the block device is read-only so that Linux
block devices behave like regular files.

Reported-by: Sibiao Luo <sluo@redhat.com>
Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2013-02-12 12:22:49 +01:00
2013-01-10 15:11:53 -06:00
2013-01-26 13:15:35 +00:00
2012-12-19 08:29:06 +01:00
2013-01-18 19:06:57 +01:00
2013-02-07 13:13:39 -06:00
2013-02-09 13:39:45 +00:00
2012-10-24 10:26:22 +02:00
2013-02-01 15:53:11 -06:00
2013-02-09 13:39:45 +00:00
2013-01-30 16:03:57 +00:00
2013-02-06 15:52:07 +01:00
2012-09-07 09:02:44 +03:00
2012-11-01 13:10:06 +01:00
2012-05-14 07:27:24 +02:00
2013-02-06 08:29:21 -06:00
2008-10-12 17:54:42 +00:00
2012-12-20 23:08:47 +01:00
2011-12-09 11:25:22 +00:00
2013-01-30 10:42:29 +01:00
2013-01-26 13:15:35 +00:00
2012-12-20 23:09:25 +01:00
2013-01-17 10:24:52 -02:00
2013-02-11 13:22:39 -06:00
2011-12-11 17:50:43 -06:00
2010-03-14 22:04:50 +01:00
2008-12-04 11:29:42 +00:00
2013-02-06 18:33:47 -06:00
2013-01-15 04:09:14 +01:00

Read the documentation in qemu-doc.html or on http://wiki.qemu.org

- QEMU team
Description
A fork of QEMU-Nyx which is better suited for my bachelors thesis
Readme 154 MiB