From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44815) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XIFkW-0002V8-Mb for qemu-devel@nongnu.org; Fri, 15 Aug 2014 07:32:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XIFkO-0008MH-Jh for qemu-devel@nongnu.org; Fri, 15 Aug 2014 07:32:48 -0400 Received: from mx1.redhat.com ([209.132.183.28]:6743) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XIFkO-0008Kf-Bk for qemu-devel@nongnu.org; Fri, 15 Aug 2014 07:32:40 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s7FBWdvi025468 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Fri, 15 Aug 2014 07:32:39 -0400 From: Markus Armbruster Date: Fri, 15 Aug 2014 13:32:37 +0200 Message-Id: <1408102357-914-3-git-send-email-armbru@redhat.com> In-Reply-To: <1408102357-914-1-git-send-email-armbru@redhat.com> References: <1408102357-914-1-git-send-email-armbru@redhat.com> Subject: [Qemu-devel] [PATCH 2/2] ide: Fix bootindex for bus_id > 9 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, lersek@redhat.com, kraxel@redhat.com, stefanha@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 --- 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