I just tried booting a HVM domain with ''floppy=/images/floppy.img'' in the config, and I get this in the logfile: qemu: could not open disk image /installmedia/IDR/floppy.img Can anyone tell me what is wrong? It worked under 3.2. The file is the correct length (1474560) and permissions. Thanks James _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
> > I just tried booting a HVM domain with ''fda=/images/floppy.img'' in > the config, and I get this in the logfile: > > qemu: could not open disk image /installmedia/IDR/floppy.img > > Can anyone tell me what is wrong? It worked under 3.2. The file is the > correct length (1474560) and permissions. >I''m posting this into dev as I think there is a problem with the code... In qemu, drive_init calls bdrv_open2, which calls find_image_format, which calls bdrv_open2, which succeeds. find_image_format appears to fail though, causing the original bdrv_open2 to fail, giving me my error message. Is this roughly what is supposed to happen? I''m continuing to debug but if anyone can tell me that I''m doing something wrong, or has already fixed this bug then please stop me :) Thanks James _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
> > > > I just tried booting a HVM domain with ''fda=/images/floppy.img'' in > > the config, and I get this in the logfile: > > > > qemu: could not open disk image /installmedia/IDR/floppy.img > > > > Can anyone tell me what is wrong? It worked under 3.2. The file isthe> > correct length (1474560) and permissions. > > > > I''m posting this into dev as I think there is a problem with thecode...> > In qemu, drive_init calls bdrv_open2, which calls find_image_format, > which calls bdrv_open2, which succeeds. find_image_format appears to > fail though, causing the original bdrv_open2 to fail, giving me myerror> message. > > Is this roughly what is supposed to happen? I''m continuing to debugbut> if anyone can tell me that I''m doing something wrong, or has already > fixed this bug then please stop me :) >Okay I think I can see the problem here, and I have gotten it working but I don''t know how correct my solution is. The problem appears to be that qemu doesn''t know how the floppy image should be accessed - normally you''d resolve this by prefixing it with ''file:'' or something, but then something (xm/xend?) complains because ''file:somefilename'' isn''t a valid filename (it''s treating ''file:'' as part of the filename). To work around this I explicitly set the file driver to raw when the type is floppy, as per the patch at the bottom of this email. Perhaps a more correct solution would be to fix xen to allow ''file:'' formatted filename, but maybe that''s overkill for a floppy disk. Either way, unless there is some magic incantation to get it working, the present functionality is broken and should be fixed. James diff --git a/vl.c b/vl.c index e50a02d..1366a37 100644 --- a/vl.c +++ b/vl.c @@ -5401,6 +5401,8 @@ static int drive_init(struct drive_opt *arg, int snapshot, approximation. */ case IF_FLOPPY: bdrv_set_type_hint(bdrv, BDRV_TYPE_FLOPPY); + if (!drv) + drv = &bdrv_raw; break; case IF_PFLASH: case IF_MTD: _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
James Harper writes ("RE: [Xen-devel] floppy image under 3.3 - resolved?"):> To work around this I explicitly set the file driver to raw when the > type is floppy, as per the patch at the bottom of this email. Perhaps a > more correct solution would be to fix xen to allow ''file:'' formatted > filename, but maybe that''s overkill for a floppy disk. Either way, > unless there is some magic incantation to get it working, the present > functionality is broken and should be fixed.I think this is correct for our tree. I''ll apply your patch (and backport it to 3.3, too). Ian. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel