WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [xen-iommu PATCH] Fix read-only image file handling

To: "'xen-devel@xxxxxxxxxxxxxxxxxxx'" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [xen-iommu PATCH] Fix read-only image file handling
From: Michal Novotny <minovotn@xxxxxxxxxx>
Date: Tue, 08 Jun 2010 13:03:21 +0200
Cc: Ian.Jackson@xxxxxxxxxxxxx, Keir Fraser <keir.fraser@xxxxxxxxxxxxx>
Delivery-date: Tue, 08 Jun 2010 04:05:24 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100430 Fedora/3.0.4-3.fc13 Thunderbird/3.0.4
Hi,
this is the patch for qemu-xen-3.4-testing and qemu-xen-unstable
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.

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

It's been tested on RHEL-5 with xen-3.4-testing version of upstream
xen with xen-3.4-testing qemu implementation and then later with
xen-4.1-unstable version of upstream (when I was finally able to make
it working).

Michal

Signed-off-by: Michal Novotny <minovotn@xxxxxxxxxx>

--
Michal Novotny<minovotn@xxxxxxxxxx>, RHCE
Virtualization Team (xen userspace), Red Hat

Attachment: xen-qemu-fix-readonly-image-handling.patch
Description: Text Data

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [xen-iommu PATCH] Fix read-only image file handling, Michal Novotny <=