[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2] block/raw-posix: detect readonly Linux block
From: |
Kevin Wolf |
Subject: |
Re: [Qemu-devel] [PATCH v2] block/raw-posix: detect readonly Linux block devices using BLKROGET |
Date: |
Wed, 06 Feb 2013 11:30:56 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120605 Thunderbird/13.0 |
Am 05.02.2013 16:12, schrieb Markus Armbruster:
> Stefan Hajnoczi <address@hidden> writes:
>
>> 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 <address@hidden>
>> Suggested-by: Paolo Bonzini <address@hidden>
>> Signed-off-by: Stefan Hajnoczi <address@hidden>
>
> Reviewed-by: Markus Armbruster <address@hidden>
Thanks, applied to the block branch.
Kevin