From patchwork Tue Jun 15 22:38:25 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 55804 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id E96841007D4 for ; Wed, 16 Jun 2010 08:40:57 +1000 (EST) Received: from localhost ([127.0.0.1]:38595 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OOeoP-00080F-J8 for incoming@patchwork.ozlabs.org; Tue, 15 Jun 2010 18:40:53 -0400 Received: from [140.186.70.92] (port=33322 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OOemi-0007oc-KG for qemu-devel@nongnu.org; Tue, 15 Jun 2010 18:39:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OOemg-0005VT-Cn for qemu-devel@nongnu.org; Tue, 15 Jun 2010 18:39:08 -0400 Received: from fmmailgate02.web.de ([217.72.192.227]:39268) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OOemf-0005Ux-VJ for qemu-devel@nongnu.org; Tue, 15 Jun 2010 18:39:06 -0400 Received: from smtp04.web.de ( [172.20.0.225]) by fmmailgate02.web.de (Postfix) with ESMTP id CF094167181DD; Wed, 16 Jun 2010 00:39:04 +0200 (CEST) Received: from [92.74.52.35] (helo=localhost.localdomain) by smtp04.web.de with asmtp (TLSv1:AES256-SHA:256) (WEB.DE 4.110 #4) id 1OOeme-0003C9-01; Wed, 16 Jun 2010 00:39:04 +0200 From: Jan Kiszka To: qemu-devel@nongnu.org, Anthony Liguori Date: Wed, 16 Jun 2010 00:38:25 +0200 Message-Id: <37ada83704ec5cccacbd9411fe4034c8140d860d.1276641524.git.jan.kiszka@web.de> X-Mailer: git-send-email 1.6.0.2 In-Reply-To: References: In-Reply-To: References: X-Sender: jan.kiszka@web.de X-Provags-ID: V01U2FsdGVkX1+xANOR4grolyS8QtCr6ulp1ccA1JoJmkSujuLl otMd6fsbGemSNyrBwWQ++zQ4F+JO/43R0sJAx6pQAamujnVyLg /VViMnt70= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6 Cc: Juan Quintela , Jan Kiszka , Markus Armbruster , Luiz Capitulino , Blue Swirl , Avi Kivity Subject: [Qemu-devel] [PATCH v4 01/23] qdev: Rework qtree path abbreviations X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Jan Kiszka Path abbreviations suffer from the inconsistency that bus names can only be omitted at the end of a path. Drop this special rule, and also remove the now obsolete QERR_DEVICE_MULTIPLE_BUSSES. Signed-off-by: Jan Kiszka --- hw/qdev.c | 22 ++++------------------ qerror.c | 4 ---- qerror.h | 3 --- 3 files changed, 4 insertions(+), 25 deletions(-) diff --git a/hw/qdev.c b/hw/qdev.c index 61f999c..7c4f039 100644 --- a/hw/qdev.c +++ b/hw/qdev.c @@ -608,32 +608,18 @@ static BusState *qbus_find(const char *path) } return NULL; } + if (dev->num_child_bus == 0) { + qerror_report(QERR_DEVICE_NO_BUS, elem); + return NULL; + } assert(path[pos] == '/' || !path[pos]); while (path[pos] == '/') { pos++; } - if (path[pos] == '\0') { - /* last specified element is a device. If it has exactly - * one child bus accept it nevertheless */ - switch (dev->num_child_bus) { - case 0: - qerror_report(QERR_DEVICE_NO_BUS, elem); - return NULL; - case 1: - return QLIST_FIRST(&dev->child_bus); - default: - qerror_report(QERR_DEVICE_MULTIPLE_BUSSES, elem); - if (!monitor_cur_is_qmp()) { - qbus_list_bus(dev); - } - return NULL; - } - } /* find bus */ if (sscanf(path+pos, "%127[^/]%n", elem, &len) != 1) { - assert(0); elem[0] = len = 0; } pos += len; diff --git a/qerror.c b/qerror.c index 44d0bf8..786b5dc 100644 --- a/qerror.c +++ b/qerror.c @@ -77,10 +77,6 @@ static const QErrorStringTable qerror_table[] = { .desc = "Device '%(device)' is locked", }, { - .error_fmt = QERR_DEVICE_MULTIPLE_BUSSES, - .desc = "Device '%(device)' has multiple child busses", - }, - { .error_fmt = QERR_DEVICE_NOT_ACTIVE, .desc = "Device '%(device)' has not been activated by the guest", }, diff --git a/qerror.h b/qerror.h index 77ae574..88474fb 100644 --- a/qerror.h +++ b/qerror.h @@ -73,9 +73,6 @@ QError *qobject_to_qerror(const QObject *obj); #define QERR_DEVICE_LOCKED \ "{ 'class': 'DeviceLocked', 'data': { 'device': %s } }" -#define QERR_DEVICE_MULTIPLE_BUSSES \ - "{ 'class': 'DeviceMultipleBusses', 'data': { 'device': %s } }" - #define QERR_DEVICE_NOT_ACTIVE \ "{ 'class': 'DeviceNotActive', 'data': { 'device': %s } }"