All of lore.kernel.org
 help / color / mirror / Atom feed
From: Akio Takebe <takebe_akio@jp.fujitsu.com>
To: xen-devel <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>
Subject: Why cannot HVM open a file as a floopy disk?
Date: Wed, 10 Jun 2009 13:09:31 +0900	[thread overview]
Message-ID: <4A2F31FB.6040308@jp.fujitsu.com> (raw)

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@jp.fujitsu.com>

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;

             reply	other threads:[~2009-06-10  4:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-10  4:09 Akio Takebe [this message]
2009-06-16 15:10 ` Why cannot HVM open a file as a floopy disk? Ian Jackson
2009-06-19  2:22   ` Akio Takebe
2009-06-19 12:23     ` Ian Jackson
2009-06-23  7:32       ` Akio Takebe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A2F31FB.6040308@jp.fujitsu.com \
    --to=takebe_akio@jp.fujitsu.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.