qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: qemu-devel@nongnu.org
Cc: kwolf@redhat.com, lersek@redhat.com, kraxel@redhat.com,
	stefanha@redhat.com
Subject: [Qemu-devel] [PATCH 2/2] ide: Fix bootindex for bus_id > 9
Date: Fri, 15 Aug 2014 13:32:37 +0200	[thread overview]
Message-ID: <1408102357-914-3-git-send-email-armbru@redhat.com> (raw)
In-Reply-To: <1408102357-914-1-git-send-email-armbru@redhat.com>

We identify devices by their Open Firmware device paths.  The encoding
of bus numbers is incorrect: idebus_get_fw_dev_path() formats them in
decimal, while SeaBIOS uses hexadecimal.  With bus number > 9, SeaBIOS
will miss the bootindex (lucky case), or apply it to another device
(unlucky case).

Bug can't bite right now: ich9-ahci has six ports, and the sysbus-ahci
created by Calxeda Highbank has just one.

Fix it anyway, by changing %d to %x.

I couldn't find an Open Firmware spec covering this.  For what it's
worth, OVMF agrees with SeaBIOS.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 hw/ide/qdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/ide/qdev.c b/hw/ide/qdev.c
index 6e475e6..9c4d221 100644
--- a/hw/ide/qdev.c
+++ b/hw/ide/qdev.c
@@ -59,7 +59,7 @@ static char *idebus_get_fw_dev_path(DeviceState *dev)
 {
     char path[30];
 
-    snprintf(path, sizeof(path), "%s@%d", qdev_fw_name(dev),
+    snprintf(path, sizeof(path), "%s@%x", qdev_fw_name(dev),
              ((IDEBus*)dev->parent_bus)->bus_id);
 
     return g_strdup(path);
-- 
1.9.3

  parent reply	other threads:[~2014-08-15 11:32 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-15 11:32 [Qemu-devel] [PATCH 0/2] Fix latent(?) bootindex bugs Markus Armbruster
2014-08-15 11:32 ` [Qemu-devel] [PATCH 1/2] usb: Fix bootindex for portnr > 9 Markus Armbruster
2014-08-25 12:48   ` Gerd Hoffmann
2014-08-25 14:33     ` Markus Armbruster
2014-08-15 11:32 ` Markus Armbruster [this message]
2014-08-26 10:51   ` [Qemu-devel] [PATCH 2/2] ide: Fix bootindex for bus_id " Stefan Hajnoczi
2014-08-15 11:55 ` [Qemu-devel] [PATCH 0/2] Fix latent(?) bootindex bugs Laszlo Ersek

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=1408102357-914-3-git-send-email-armbru@redhat.com \
    --to=armbru@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=lersek@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).