From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46618) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XNP47-000793-4a for qemu-devel@nongnu.org; Fri, 29 Aug 2014 12:30:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XNP40-0002fG-Tx for qemu-devel@nongnu.org; Fri, 29 Aug 2014 12:30:19 -0400 Received: from mx1.redhat.com ([209.132.183.28]:27887) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XNP40-0002f6-My for qemu-devel@nongnu.org; Fri, 29 Aug 2014 12:30:12 -0400 From: Stefan Hajnoczi Date: Fri, 29 Aug 2014 17:29:29 +0100 Message-Id: <1409329803-20744-2-git-send-email-stefanha@redhat.com> In-Reply-To: <1409329803-20744-1-git-send-email-stefanha@redhat.com> References: <1409329803-20744-1-git-send-email-stefanha@redhat.com> Subject: [Qemu-devel] [PULL 01/35] 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: Peter Maydell , Markus Armbruster , Stefan Hajnoczi From: Markus Armbruster 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 Signed-off-by: Stefan Hajnoczi --- 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 b4a4671..efab95b 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