[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] can't boot from iso on cifs mount
Sorry for the late reply. O_DIRECT is called BDRV_O_NOCACHE in QEMU, we don't set BDRV_O_NOCACHE in xenstore.c, so I don't know where the O_DIRECT flag comes from. What version of Xen and QEMU are you using? What is the last commit on your QEMU tree? Posting your QEMU logs after you applied this simple debug patch might help us understand the problem: diff --git a/block-raw-posix.c b/block-raw-posix.c index 795cd5b..ca6bc26 100644 --- a/block-raw-posix.c +++ b/block-raw-posix.c @@ -190,6 +190,7 @@ static int raw_open(BlockDriverState *bs, const char *filename, int flags) open_flags |= O_DIRECT; else if (!(flags & BDRV_O_CACHE_WB)) open_flags |= O_DSYNC; + printf("DEBUG flags=%lx open_flags=%lx\n", flags,open_flags); s->type = FTYPE_FILE; On Fri, 1 Feb 2013, Vasiliy Tolstov wrote: > Failed again. > may be in xenstore.c in this code i need to delete O_DIRECT flag? > > In strace before i get messages about fallback without O_DIRECT > (provided with patch) i get this: > > write(2, "Using file /var/storage/iso/SW_D"..., 130) = 130 > open("/var/storage/iso/SW_DVD5_Windows_Svr_DC_EE_SE_Web_2008_R2_64Bit_Russian_w_SP1_MLF_X17-22616_vase.iso", > O_RDONLY|O_DIRECT) = -1 EINVAL (Invalid argument) > write(2, "qemu: could not open vbd '/local"..., 216) = 216 > > My be in this code i append fallback? > > if (bdrv_open2(bs, params, flags|BDRV_O_CACHE_WB /* > snapshot and write-back */, format) < 0) { > fprintf(stderr, "qemu: could not open vbd '%s' or hard > disk image '%s' (drv '%s' format '%s')\n", buf, params, drv ? drv : > "?", format ? format->format_name : "0"); > } else { > char* snapshot = get_snapshot_name(atoi(e_danger[i])); > if (snapshot) { > fprintf(stderr, "Using snapshot %s\n", snapshot); > ret = bdrv_snapshot_goto(bs, snapshot); > switch (ret) { > case 0: > /* Success */ > break; > case -ENOTSUP: > /* Don't abort here (could be read-only ISO) */ > fprintf(stderr, "Snapshots are not supported for " > "this image file format\n"); > break; > case -ENOENT: > fprintf(stderr, "No such snapshot, skipping this " > "image file\n"); > continue; > default: > fprintf(stderr, "Could not load snapshot, skipping" > " this image file\n"); > continue; > } > } > } > > 2013/1/30 Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>: > > Sorry that was my stupid mistake. > > This should work: > > > > diff --git a/hw/xen_disk.c b/hw/xen_disk.c > > index 33a5531..1786db8 100644 > > --- a/hw/xen_disk.c > > +++ b/hw/xen_disk.c > > @@ -659,9 +659,16 @@ static int blk_init(struct XenDevice *xendev) > > if (blkdev->bs) { > > if (bdrv_open2(blkdev->bs, blkdev->filename, qflags, > > bdrv_find_format(blkdev->fileproto)) != 0) { > > - bdrv_delete(blkdev->bs); > > - blkdev->bs = NULL; > > - } > > + /* try without O_DIRECT */ > > + xen_be_printf(&blkdev->xendev, 0, "opening %s with > > O_DIRECT failed, trying write-through.\n", > > + blkdev->filename); > > + qflags &= ~BDRV_O_NOCACHE; > > + if (bdrv_open2(blkdev->bs, blkdev->filename, qflags, > > + bdrv_find_format(blkdev->fileproto)) != 0) { > > + bdrv_delete(blkdev->bs); > > + blkdev->bs = NULL; > > + } > > + } > > } > > if (!blkdev->bs) > > return -1; > > > > On Wed, 30 Jan 2013, Vasiliy Tolstov wrote: > >> Strace shows that qemu after O_DIRECT next try with O_DIRECT > >> open("/var/storage/iso/winpe_amd64.iso", O_RDONLY|O_DIRECT) = -1 > >> EINVAL (Invalid argument) > >> write(2, "xen be: qdisk-832: ", 19) = 19 > >> write(2, "xen be: qdisk-832: ", 19) = 19 > >> write(2, "opening /var/storage/iso/winpe_a"..., 85) = 85 > >> write(2, "opening /var/storage/iso/winpe_a"..., 85) = 85 > >> open("/var/storage/iso/winpe_amd64.iso", O_RDONLY|O_DIRECT) = -1 > >> EINVAL (Invalid argument) > >> > >> 2013/1/30 Vasiliy Tolstov <v.tolstov@xxxxxxxxx>: > >> > Thanks for patch. But it not solve problem: > >> > Now i have : > >> > domid: 6 > >> > Using file /dev/disk/vbd/21-828 in read-write mode > >> > Strip off blktap sub-type prefix to (drv 'aio') > >> > Watching /local/domain/0/device-model/6/logdirty/cmd > >> > Watching /local/domain/0/device-model/6/command > >> > Watching /local/domain/6/cpu > >> > char device redirected to /dev/pts/5 > >> > qemu_map_cache_init nr_buckets = 10000 size 4194304 > >> > Could not open /var/run/tap/qemu-read-6 > >> > shared page at pfn feffd > >> > buffered io page at pfn feffb > >> > Guest uuid = c98c33c8-1891-41ec-96a0-984f3df80def > >> > xen be: qdisk-5632: xen be: qdisk-5632: opening with O_DIRECT failed, > >> > trying write-through. > >> > opening with O_DIRECT failed, trying write-through. > >> > populating video RAM at ff000000 > >> > mapping video RAM from ff000000 > >> > Register xen platform. > >> > Done register platform. > >> > platform_fixed_ioport: changed ro/rw state of ROM memory area. now is rw > >> > state. > >> > xs_read(/local/domain/0/device-model/6/xen_extended_power_mgmt): read > >> > error > >> > medium change watch on `hdc' (index: 1): aio: > >> > I/O request not ready: 0, ptr: 0, port: 0, data: 0, count: 0, size: 0 > >> > Log-dirty: no command yet. > >> > I/O request not ready: 0, ptr: 0, port: 0, data: 0, count: 0, size: 0 > >> > I/O request not ready: 0, ptr: 0, port: 0, data: 0, count: 0, size: 0 > >> > vcpu-set: watch node error. > >> > I/O request not ready: 0, ptr: 0, port: 0, data: 0, count: 0, size: 0 > >> > xs_read(/local/domain/6/log-throttling): read error > >> > qemu: ignoring not-understood drive `/local/domain/6/log-throttling' > >> > medium change watch on `/local/domain/6/log-throttling' - unknown > >> > device, ignored > >> > xen be: qdisk-5632: xen be: qdisk-5632: opening with O_DIRECT failed, > >> > trying write-through. > >> > opening with O_DIRECT failed, trying write-through. > >> > log_throttling disabled > >> > qemu: ignoring not-understood drive `/local/domain/6/log-throttling' > >> > medium change watch on `/local/domain/6/log-throttling' - unknown > >> > device, ignored > >> > vga s->lfb_addr = f0000000 s->lfb_end = f1000000 > >> > platform_fixed_ioport: changed ro/rw state of ROM memory area. now is rw > >> > state. > >> > platform_fixed_ioport: changed ro/rw state of ROM memory area. now is ro > >> > state. > >> > > >> > > >> > (XEN) HVM6: VGABios $Id: vgabios.c,v 1.67 2008/01/27 09:44:12 vruppert > >> > Exp $ > >> > (XEN) HVM6: VBE Bios $Id: vbe.c,v 1.60 2008/03/02 07:47:21 vruppert Exp $ > >> > (XEN) HVM6: Bochs BIOS - build: 06/23/99 > >> > (XEN) HVM6: $Revision: 1.221 $ $Date: 2008/12/07 17:32:29 $ > >> > (XEN) HVM6: Options: apmbios pcibios eltorito PMM > >> > (XEN) HVM6: > >> > (XEN) HVM6: ata0-0: PCHS=16383/16/63 translation=lba LCHS=1024/255/63 > >> > (XEN) HVM6: ata0 master: QEMU HARDDISK ATA-7 Hard-Disk (10246 MBytes) > >> > (XEN) HVM6: IDE time out > >> > (XEN) HVM6: ata1 master: QEMU DVD-ROM ATAPI-4 CD-Rom/DVD-Rom > >> > (XEN) HVM6: IDE time out > >> > (XEN) HVM6: > >> > (XEN) HVM6: > >> > (XEN) HVM6: > >> > (XEN) HVM6: Press F12 for boot menu. > >> > (XEN) HVM6: > >> > (XEN) HVM6: Booting from Hard Disk... > >> > (XEN) HVM6: Boot from Hard Disk failed: not a bootable disk > >> > (XEN) HVM6: > >> > (XEN) HVM6: > >> > (XEN) HVM6: No bootable device. > >> > (XEN) HVM6: Powering off in 30 seconds. > >> > (XEN) hvm.c:1080:d6 All CPUs offline -- powering off. > >> > > >> > 2013/1/22 Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>: > >> >> On Tue, 22 Jan 2013, Ian Campbell wrote: > >> >>> Please don't top post. > >> >>> > >> >>> On Tue, 2013-01-22 at 05:38 +0000, Vasiliy Tolstov wrote: > >> >>> > Thanks! > >> >>> > I found, that now xl tries to open iso with O_DIRECT flag. > >> >>> > open("/var/storage/iso/SW_DVD5_Windows_Svr_DC_EE_SE_Web_2008_R2_64Bit_Russian_w_SP1_MLF_X17-22616_vase.iso", > >> >>> > O_RDONLY|O_DIRECT) = -1 EINVAL (Invalid argument) > >> >>> > write(2, "qemu: could not open vbd '/local"..., 217) = 217 > >> >> > >> >> xl? I guess you mean QEMU tries to open the ISO with O_DIRECT. > >> >> > >> >> > >> >>> I guess CIFS doesn't support O_DIRECT. It looks like it does have mount > >> >>> -o directio though, worth a try. > >> >>> > >> >>> I'm not sure what options exist to turn this off from the qemu side -- > >> >>> Stefano? I also have a feeling something changed in this regard in > >> >>> 4.2.x > >> >> > >> >> Given that you are not passing any device_model_version option to xl, I > >> >> assume that you are running qemu-xen-traditional (ps should show that a > >> >> binary called qemu-dm is running). > >> >> > >> >> If that is the case, there is currently no way to specify any flags. > >> >> However the interesting bit is that qemu-xen-traditional opens files > >> >> corresponding to emulated devices with BDRV_O_CACHE_WB and opens files > >> >> corresponding to PV interfaces using BDRV_O_NOCACHE (this means > >> >> O_DIRECT). > >> >> This means that the failure should be caused by hw/xen_disk.c trying to > >> >> opening the iso O_DIRECT. Paradoxically the PV inteface for a cdrom > >> >> drive is usually never used AFAIK. > >> >> > >> >> Did the Windows PV drivers start using the PV cdrom interface all of a > >> >> sudden? > >> >> > >> >> In any case I think that the best thing we could do it fall back to > >> >> write-through (or should it be write-back? It might not be safe..) in > >> >> case O_DIRECT fails. This is what qemu-xen does in such cases. > >> >> > >> >> Try this patch: > >> >> > >> >> --- > >> >> > >> >> diff --git a/hw/xen_disk.c b/hw/xen_disk.c > >> >> index 33a5531..d6d71fe 100644 > >> >> --- a/hw/xen_disk.c > >> >> +++ b/hw/xen_disk.c > >> >> @@ -659,9 +659,16 @@ static int blk_init(struct XenDevice *xendev) > >> >> if (blkdev->bs) { > >> >> if (bdrv_open2(blkdev->bs, blkdev->filename, qflags, > >> >> bdrv_find_format(blkdev->fileproto)) != 0) { > >> >> - bdrv_delete(blkdev->bs); > >> >> - blkdev->bs = NULL; > >> >> - } > >> >> + /* try without O_DIRECT */ > >> >> + xen_be_printf(&blkdev->xendev, 0, "opening %s with > >> >> O_DIRECT failed, trying write-through.\n", > >> >> + blkdev->filename); > >> >> + qflags &= BDRV_O_NOCACHE; > >> >> + if (bdrv_open2(blkdev->bs, blkdev->filename, qflags, > >> >> + bdrv_find_format(blkdev->fileproto)) != 0) > >> >> { > >> >> + bdrv_delete(blkdev->bs); > >> >> + blkdev->bs = NULL; > >> >> + } > >> >> + } > >> >> } > >> >> if (!blkdev->bs) > >> >> return -1; > >> >> > >> > > >> > > >> > > >> > -- > >> > Vasiliy Tolstov, > >> > Clodo.ru > >> > e-mail: v.tolstov@xxxxxxxxx > >> > jabber: vase@xxxxxxxxx > >> > >> > >> > >> -- > >> Vasiliy Tolstov, > >> Clodo.ru > >> e-mail: v.tolstov@xxxxxxxxx > >> jabber: vase@xxxxxxxxx > >> > > > > -- > Vasiliy Tolstov, > Clodo.ru > e-mail: v.tolstov@xxxxxxxxx > jabber: vase@xxxxxxxxx > _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |