From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michal Novotny Subject: Re: [PATCH] qemu-xen-3.4-testing: Fix read-only image file handling Date: Fri, 04 Jun 2010 15:45:53 +0200 Message-ID: <4C090391.3080802@redhat.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Keir Fraser , "'xen-devel@lists.xensource.com'" List-Id: xen-devel@lists.xenproject.org On 06/04/2010 03:16 PM, Keir Fraser wrote: > On 04/06/2010 14:13, "Michal Novotny" wrote: > > =20 >> Keir, >> I tried it and it's already up to date: >> >> $ git pull -a >> Already up-to-date. Yeeah! >> $ >> =20 > Don't believe you, or it's not the one that's actually being built. :-)= If > you grep in the tree for xc_interface_open() you should see it is corre= ctly > passing three args now. Sorry, my bad, something was wrong with my git tree so I deleted it and=20 pulled again. Thanks, Michal > And if it is, then that will build okay. If it's not > passing three args, the tree is stale. > > -- Keir > > =20 >> -- Michal >> >> On 06/04/2010 03:11 PM, Keir Fraser wrote: >> =20 >>> You need to bring your qemu repo up to date. Throw it away, or go int= o it >>> and 'git pull -a'. >>> >>> -- Keir >>> >>> On 04/06/2010 14:00, "Michal Novotny" wrote: >>> >>> >>> =20 >>>> Well, now the kernel is booting but when I'm trying to recompile too= ls >>>> and stubdom images it's not OK returning those errors: >>>> >>>> ... >>>> qemu successfuly configured for Xen qemu-dm build >>>> make -C ioemu-dir install >>>> =3D=3D=3D PCI passthrough capability has been enabled =3D=3D=3D >>>> make[3]: Entering directory >>>> `/home2/shared/xen-unstable.hg/tools/ioemu-remote' >>>> =3D=3D=3D PCI passthrough capability has been enabled =3D=3D=3D >>>> =3D=3D=3D PCI passthrough capability has been enabled =3D=3D=3D >>>> make[4]: Entering directory >>>> `/home2/shared/xen-unstable.hg/tools/ioemu-remote/i386-dm' >>>> CC i386-dm/vl.o >>>> /home2/shared/xen-unstable.hg/tools/ioemu-dir/vl.c: In function =C5=92= main=C2=B9: >>>> /home2/shared/xen-unstable.hg/tools/ioemu-dir/vl.c:5729: warning: >>>> implicit declaration of function =C5=92dma_helper_init=C2=B9 >>>> /home2/shared/xen-unstable.hg/tools/ioemu-dir/vl.c:5731: error: too = few >>>> arguments to function =C5=92xc_interface_open=C2=B9 >>>> make[4]: *** [vl.o] Error 1 >>>> make[4]: Leaving directory >>>> `/home2/shared/xen-unstable.hg/tools/ioemu-remote/i386-dm' >>>> make[3]: *** [subdir-i386-dm] Error 2 >>>> make[3]: Leaving directory >>>> `/home2/shared/xen-unstable.hg/tools/ioemu-remote' >>>> make[2]: *** [subdir-install-ioemu-dir] Error 2 >>>> make[2]: Leaving directory `/home2/shared/xen-unstable.hg/tools' >>>> make[1]: *** [subdirs-install] Error 2 >>>> make[1]: Leaving directory `/home2/shared/xen-unstable.hg/tools' >>>> make: *** [install-tools] Error 2 >>>> # >>>> >>>> The command I used for compilation is `make install-xen&& make >>>> install-tools&& make install-stubdom&& make install-docs` on the >>>> latest updated xen-unstable staging mercurial tree so I need to >>>> investigate this further. Nevertheless, the dom0 2.6.31.13 is bootin= g on >>>> RHEL-5 which is good. That links you gave me Pasi helped, thanks! No= w I >>>> need to resolve those tools issues. >>>> >>>> Michal >>>> >>>> On 06/04/2010 12:57 PM, Michal Novotny wrote: >>>> >>>> =20 >>>>> On 06/04/2010 12:42 PM, Pasi K=C3=A4rkk=C3=A4inen wrote: >>>>> >>>>> =20 >>>>>> On Fri, Jun 04, 2010 at 11:37:51AM +0200, Michal Novotny wrote: >>>>>> >>>>>> =20 >>>>>>> Oh, one more thing I've discovered now. Since the codebase for >>>>>>> qemu-xen-unstable is looking the same like for qemu-xen-3.4-testi= ng and >>>>>>> the patch is applicable without any modifications it could be wor= king >>>>>>> for xen-4.1 unstable as well, unfortunately I was not able to boo= t >>>>>>> PVOPS >>>>>>> kernel since it always ends up in kernel panic, maybe the missing >>>>>>> drivers or something like that. >>>>>>> >>>>>>> >>>>>>> =20 >>>>>> What kernel version? Did you use xen/stable-2.6.32.x branch from >>>>>> xen.git? >>>>>> >>>>>> =20 >>>>> It's the one that's being automatically downloaded from git as >>>>> linux-2.6-pvops.git. The URL is >>>>> git://git.kernel.org/pub/scm/linux/kernel/git/jeremy/xen.git with t= he >>>>> "fetch" being set to "+refs/heads/*:refs/remotes/xen/*". This is th= e >>>>> .git/config automatically created by `make world` in xen-unstable t= ree: >>>>> >>>>> [core] >>>>> repositoryformatversion =3D 0 >>>>> filemode =3D true >>>>> bare =3D false >>>>> logallrefupdates =3D true >>>>> [remote "xen"] >>>>> url =3D git://git.kernel.org/pub/scm/linux/kernel/git/jeremy/xen.gi= t >>>>> fetch =3D +refs/heads/*:refs/remotes/xen/* >>>>> [branch "xen/stable-2.6.31.x"] >>>>> remote =3D xen >>>>> merge =3D refs/heads/xen/stable-2.6.31.x >>>>> >>>>> By default it's using uhci-hcd/ehci-hcd and ohci-hcd as builtins bu= t I >>>>> needed to change it to be modules since otherwise it's being stuck. >>>>> I'm trying this on RHEL-5 dom0 (I'm having second partition RHEL-5 >>>>> with upstream xen). >>>>> >>>>> =20 >>>>>> See my example .config files from: >>>>>> http://wiki.xensource.com/xenwiki/XenParavirtOps in the >>>>>> "troubleshooting" section. >>>>>> >>>>>> =20 >>>>> I'll have a look, thanks for the link. >>>>> >>>>> >>>>> =20 >>>>>> Works on F12/F13 dom0's. >>>>>> >>>>>> For el5 dom0 you might need these: >>>>>> http://wiki.xensource.com/xenwiki/2.6.18-to-2.6.31-and-higher >>>>>> >>>>>> =20 >>>>> Oh, ok, this may be very useful since I'm trying this on RHEL-5. Th= anks! >>>>> >>>>> >>>>> =20 >>>>>> aka >>>>>> CONFIG_SYSFS_DEPRECATED=3Dy >>>>>> CONFIG_SYSFS_DEPRECATED_V2=3Dy >>>>>> >>>>>> Also atm I think you need CONFIG_XEN_XENBUS_FRONTEND=3Dy in the .c= onfig >>>>>> because of the recently added pv-on-hvm drivers (you'll get build >>>>>> failure without that option), >>>>>> so you need XEN_PCIDEV_FRONTEND XEN_BLKDEV_FRONTEND or >>>>>> XEN_NETDEV_FRONTEND or XEN_FBDEV_FRONTEND needs to be =3Dy. >>>>>> >>>>>> >>>>>> =20 >>>>> Great! Thanks for your help Pasi! If anything I'll let you know. >>>>> >>>>> Michal >>>>> >>>>> >>>>> =20 >>>>>> -- Pasi >>>>>> >>>>>> >>>>>> >>>>>> =20 >>>>>>> On 06/03/2010 04:12 PM, Michal Novotny wrote: >>>>>>> >>>>>>> =20 >>>>>>>> Oh, just one more thing that should be mentioned: >>>>>>>> >>>>>>>> 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 resu= lts >>>>>>>> into I/O errors when processing the requests. Remounting as read= -only >>>>>>>> or unmounting and remounting using the `mount /dev/* /path/to/mo= unt -o >>>>>>>> ro` shall do the mounting the correct way, i.e. with no I/O erro= rs, so >>>>>>>> make sure you mount those disks as read-only otherwise you can b= e >>>>>>>> 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 DeviceF= ault >>>>>>>> errors since mounting the device read-write (default setting) wr= ites >>>>>>>> some data onto a disk at the mount-time. >>>>>>>> >>>>>>>> Michal >>>>>>>> >>>>>>>> On 06/03/2010 04:04 PM, Michal Novotny wrote: >>>>>>>> >>>>>>>> =20 >>>>>>>>> [Well, I did send an e-mail to the list using git but it's not = here >>>>>>>>> so I'm forwarding the e-mail to the list for sure:] >>>>>>>>> >>>>>>>>> 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. >>>>>>>>> >>>>>>>>> For SCSI devices the DATA PROTECT request sense has been added >>>>>>>>> as found at: http://en.wikipedia.org/wiki/SCSI_Request_Sense_Co= mmand >>>>>>>>> >>>>>>>>> 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 >>>>>>>>> Michal >>>>>>>>> >>>>>>>>> Signed-off-by: Michal Novotny >>>>>>>>> >>>>>>>>> >>>>>>>>> _______________________________________________ >>>>>>>>> Xen-devel mailing list >>>>>>>>> Xen-devel@lists.xensource.com >>>>>>>>> http://lists.xensource.com/xen-devel >>>>>>>>> >>>>>>>>> =20 >>>>>>>> >>>>>>>> =20 >>>>>>> --=20 >>>>>>> Michal Novotny, RHCE >>>>>>> Virtualization Team (xen userspace), Red Hat >>>>>>> >>>>>>> >>>>>>> _______________________________________________ >>>>>>> Xen-devel mailing list >>>>>>> Xen-devel@lists.xensource.com >>>>>>> http://lists.xensource.com/xen-devel >>>>>>> >>>>>>> =20 >>>>> >>>>> =20 >>>> >>>> =20 >>> >>> =20 >> =20 > > =20 --=20 Michal Novotny, RHCE Virtualization Team (xen userspace), Red Hat