From patchwork Thu Jan 31 15:42:24 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laszlo Ersek X-Patchwork-Id: 217202 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 90E622C0091 for ; Fri, 1 Feb 2013 02:40:52 +1100 (EST) Received: from localhost ([::1]:34324 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U0wFu-0006kZ-MB for incoming@patchwork.ozlabs.org; Thu, 31 Jan 2013 10:40:50 -0500 Received: from eggs.gnu.org ([208.118.235.92]:59661) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U0wFj-0006kS-JC for qemu-devel@nongnu.org; Thu, 31 Jan 2013 10:40:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U0wFf-00022C-Mc for qemu-devel@nongnu.org; Thu, 31 Jan 2013 10:40:39 -0500 Received: from mx1.redhat.com ([209.132.183.28]:33621) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U0wFf-00021r-FB for qemu-devel@nongnu.org; Thu, 31 Jan 2013 10:40:35 -0500 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r0VFeWbo021644 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 31 Jan 2013 10:40:32 -0500 Received: from lacos-laptop.usersys.redhat.com (vpn-61-61.rdu2.redhat.com [10.10.61.61]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r0VFeP8x009299; Thu, 31 Jan 2013 10:40:30 -0500 From: Laszlo Ersek To: qemu-devel@nongnu.org, fred.konrad@greensocs.com, peter.maydell@linaro.org, lcapitulino@redhat.com Date: Thu, 31 Jan 2013 16:42:24 +0100 Message-Id: <1359646945-2876-2-git-send-email-lersek@redhat.com> In-Reply-To: <510A7683.2000303@greensocs.com> References: <510A7683.2000303@greensocs.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [RFC 1/2] qbus_find_recursive(): don't abort search for named bus on full bus node 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 The bus we're looking for could be in the sub-tree rooted at the node being checked; don't skip looping over the children. Signed-off-by: Laszlo Ersek --- hw/qdev-monitor.c | 10 +--------- 1 files changed, 1 insertions(+), 9 deletions(-) diff --git a/hw/qdev-monitor.c b/hw/qdev-monitor.c index 4e2a92b..34f5014 100644 --- a/hw/qdev-monitor.c +++ b/hw/qdev-monitor.c @@ -295,15 +295,7 @@ static BusState *qbus_find_recursive(BusState *bus, const char *name, match = 0; } if ((bus_class->max_dev != 0) && (bus_class->max_dev <= bus->max_index)) { - if (name != NULL) { - /* bus was explicitly specified: return an error. */ - qerror_report(ERROR_CLASS_GENERIC_ERROR, "Bus '%s' is full", - bus->name); - return NULL; - } else { - /* bus was not specified: try to find another one. */ - match = 0; - } + match = 0; } if (match) { return bus;