]> xenbits.xensource.com Git - qemu-xen-4.0-testing.git/commit
Fix read-only image file handling xen-4.0.1-rc2 xen-4.0.1-rc3
authorIan Jackson <ian.jackson@eu.citrix.com>
Wed, 9 Jun 2010 16:10:59 +0000 (17:10 +0100)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Wed, 9 Jun 2010 16:12:53 +0000 (17:12 +0100)
commitceeeacd1754dfc923e81a46bfd5a0eb67c7e3874
treee55273f3722b444f034213e5ccce8edaac430f57
parent8db09666b4db736eb825460097106016c1276476
Fix read-only image file handling

Hi,
this is the patch for qemu-xen-3.4-testing to fix the read-only
image file handling since the image file was always treated as
read-write which means that all the HVM guests were able to
write to all the disk images available in domain configuration
file no matter what the mode of the image was defined. This
patch fixes this functionality to honor the O_RDONLY in the
BDRV_O_ACCESS flag in block.c and also fixes the IDE and SCSI
interfaces that uses it.

It's been tested on RHEL-5 with xen-3.4-testing version of
upstream xen with xen-3.4-testing qemu implementation. The
patch is applicable to qemu-xen-unstable.git as well with no
modifications.

When you want to mount an image that is set as read-only in the
domain configuration file but you omit to set mode to read-only
it results into I/O errors when processing the requests.
Remounting as read-only or unmounting and remounting using the
`mount /dev/* /path/to/mount -o ro` shall do the mounting the
correct way, i.e. with no I/O errors, so make sure you mount
those disks as read-only otherwise you can be getting errors like:

end_request: I/O error, dev hdb, sector 52
Buffer I/O error on device hdb1, logical block 1
lost page write due to I/O error on hdb1

and for IDE devices you'll be getting several additional DeviceFault
errors since mounting the device read-write (default setting) writes
some data onto a disk at the mount-time.

For SCSI devices the DATA PROTECT request sense has been added
as found at: http://en.wikipedia.org/wiki/SCSI_Request_Sense_Command

Michal

Signed-off-by: Michal Novotny <minovotn@redhat.com>
(cherry picked from commit 6392763643311272590ef5c6f75ba11d5b132585)
block.c
hw/ide.c
hw/scsi-disk.c
xenstore.c