[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [Xen-devel] floppy image under 3.3 - resolved?

  • To: <xen-devel@xxxxxxxxxxxxxxxxxxx>
  • From: "James Harper" <james.harper@xxxxxxxxxxxxxxxx>
  • Date: Sat, 6 Dec 2008 20:57:54 +1100
  • Delivery-date: Sat, 06 Dec 2008 01:58:50 -0800
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>
  • Thread-index: AclXaNASedTkTD0bRK+lxn55L2Hs+QAGy15AAAEiQ9A=
  • Thread-topic: [Xen-devel] floppy image under 3.3 - resolved?

> >
> > 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
> > correct length (1474560) and permissions.
> >
> I'm posting this into dev as I think there is a problem with the
> 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
> message.
> Is this roughly what is supposed to happen? I'm continuing to debug
> 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.


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
            approximation.  */
     case IF_FLOPPY:
         bdrv_set_type_hint(bdrv, BDRV_TYPE_FLOPPY);
+       if (!drv)
+           drv = &bdrv_raw;
     case IF_PFLASH:
     case IF_MTD:

Xen-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.