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

[Xen-devel] Why cannot HVM open a file as a floopy disk?



Hi, Ian

I found a issue which we cannot open a file as a floppy disk in HVM guest.
If I specify fda="/dev/null", I can boot the HVM guest.
But if I specify fda="/root/floppy.img",
I cannot boot the HVM guest and xend hungs up.

I found your patch of 8e45e56e7c20e2918c2141a11134c217aa30b07e of ioemu-remote.
The cause is the following part.
============================================================================
 static BlockDriver *find_protocol(const char *filename)
 {
+    /* Return values:
+     *   &bdrv_xxx
+     *      filename specifies protocol xxx
+     *      caller should use that
+     *   NULL                    filename does not specify any protocol
+     *       caller may apply their own default
+     *   &bdrv_invalid_protocol  filename speciies an unknown protocol
+     *       caller should return -ENOENT; or may just try to open with
+     *       that bdrv, which always fails that way.
+     */
     BlockDriver *drv1;
     char protocol[128];
     int len;
@@ -240,7 +260,7 @@ static BlockDriver *find_protocol(const char *filename)
 #endif
     p = strchr(filename, ':');
     if (!p)
-        return &bdrv_raw;
+        return NULL;       <<<<<<***HERE***
     len = p - filename;
     if (len > sizeof(protocol) - 1)
         len = sizeof(protocol) - 1;
@@ -251,7 +271,7 @@ static BlockDriver *find_protocol(const char *filename)
             !strcmp(drv1->protocol_name, protocol))
             return drv1;
     }
-    return NULL;
+    return &bdrv_invalid_protocol;
 }
============================================================================

qemu-dm fails because find_protocol() doesn't return "raw" format.
Why did you need to change the line?
If it's not necessary, is the following patch acceptable?

Signed-off-by: Akio Takebe <takebe_akio@xxxxxxxxxxxxxx>

Best Regards,

Akio Takebe

---
diff --git a/block.c b/block.c
index 36f5eb9..0c0c1a5 100644
--- a/block.c
+++ b/block.c
@@ -262,7 +262,7 @@ static BlockDriver *find_protocol(const char *filename)
 #endif
     p = strchr(filename, ':');
     if (!p)
-        return NULL;
+        return &bdrv_raw;
     len = p - filename;
     if (len > sizeof(protocol) - 1)
         len = sizeof(protocol) - 1;

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

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