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

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

To: <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: RE: [Xen-devel] floppy image under 3.3 - resolved?
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
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <AEC6C66638C05B468B556EA548C1A77D0154FEB9@trantor>
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>
References: <AEC6C66638C05B468B556EA548C1A77D0154FEB7@trantor> <AEC6C66638C05B468B556EA548C1A77D0154FEB9@trantor>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
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
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 :)
> 

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@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>