kvm tools: Fix read-only support in QCOW
If the user specifies a read-only image, make sure we never write to it. Booting to a read-only image looks like this now: $ ./kvm run -i ~/images/linux-0.2.qcow2,ro [ snip ] [ 1.250236] end_request: I/O error, dev vda, sector 32856 [ 1.252867] Buffer I/O error on device vda, logical block 16428 [ 1.255706] lost page write due to I/O error on vda [ 1.258120] EXT4-fs (vda): previous I/O error to superblock detected [ 1.261157] end_request: I/O error, dev vda, sector 2 [ 1.263333] Buffer I/O error on device vda, logical block 1 [ 1.264944] lost page write due to I/O error on vda [ 1.266139] EXT4-fs (vda): re-mounted. Opts: [ 1.284390] end_request: I/O error, dev vda, sector 35842 [ 1.285679] Buffer I/O error on device vda, logical block 17921 [ 1.287175] EXT4-fs warning (device vda): ext4_end_bio:259: I/O error writing to inode 3756 (offset 0 size 1024 starting block 17922) Reported-by:Sasha Levin <levinsasha928@gmail.com> Cc: Asias He <asias.hejun@gmail.com> Cc: Avi Kivity <avi@redhat.com> Cc: Cyrill Gorcunov <gorcunov@gmail.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Prasad Joshi <prasadjoshi124@gmail.com> Cc: Sasha Levin <levinsasha928@gmail.com> Signed-off-by:
Pekka Enberg <penberg@kernel.org>
Loading
Please register or sign in to comment