From patchwork Fri Aug 15 11:32:37 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Armbruster X-Patchwork-Id: 380198 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4FE7114009B for ; Fri, 15 Aug 2014 21:34:51 +1000 (EST) Received: from localhost ([::1]:58789 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XIFmT-0004h5-8j for incoming@patchwork.ozlabs.org; Fri, 15 Aug 2014 07:34:49 -0400 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 Received: from blackfin.pond.sub.org (ovpn-116-70.ams2.redhat.com [10.36.116.70]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s7FBWbGX030297 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 15 Aug 2014 07:32:39 -0400 Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 4012D3046020; Fri, 15 Aug 2014 13:32:37 +0200 (CEST) From: Markus Armbruster To: qemu-devel@nongnu.org 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> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 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 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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);