From patchwork Tue Mar 12 14:13:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Markus Armbruster X-Patchwork-Id: 779743 Delivered-To: patch@linaro.org Received: by 2002:a5d:604e:0:b0:33e:7753:30bd with SMTP id j14csp2043962wrt; Tue, 12 Mar 2024 07:16:39 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUMJKKigt/XC86Os6UO2+dBkvM3vT56EeAu1XuD18sMnfvl4jxlcZyu+xBUiBoCzohcW/4Zmlq0VA/bRFf7wE+E X-Google-Smtp-Source: AGHT+IGw+EtI1qarLYAnYN+2jsrAK31zjLUsjEE/XBWxWCUjXC5AFSdwQr+BIW+I7SUFWotiYi4t X-Received: by 2002:ae9:f809:0:b0:788:7208:ea80 with SMTP id x9-20020ae9f809000000b007887208ea80mr4753170qkh.37.1710252999418; Tue, 12 Mar 2024 07:16:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1710252999; cv=none; d=google.com; s=arc-20160816; b=ihMIOCboBGGsFUKfKI66oa65aH0Ty/epZRfjBgR78G1D/3/sB+DSiTA3mQ7/L7legh k+Cg+MKBLIGvsxlpJmPJdTr1T9TUcS6XdD4Ui3HpoxHlN6/0jLQi/lG3aK5jqDCsKfSr Bp1ZUaUFqvMw+J6IiGzu04cjLtXBzkZCqNwIKlyQnmcdS5iaJQKilfuL84OLYRhk64gG MUnuPOG0XfBy5QwM8C2cyaJG1MRLtomgPF8N5sSwzroAywO3yKoTHOFyKAYfFH44UxJ6 tsY32Q9j5K4mYftRYp8uh0zSliZgdblWYu4KRm3uQupmpU5Q9jWwafVS36dNJLJEq6Fj 6Irw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=EfKEUanZYxUIJ2dDav+OV0GW1QHkTACV4MMey+9QxoQ=; fh=7qHyDQX72txt1MtNSYHZ/YFp7+2Ya6YuqP0Hd6vdblA=; b=KonVnDwT7ZX8ngGpPH6a89XX6U0W8/1KYfRcDQNdbWG/Xhe8jSR9znIxsj5RSGgKwI QvlYOK5G0i7VV401mi8q6rgcU01ZtG303SB0N4/8lXPges2FCe26GiR1RhudtZNZlaAF zqAI6wetbWamFQXI/UnOAsLp/7cOwcY1qQwjBoRlEGzcFQ3P1sugIPXRgaQZ6/KRmNu2 746RUmVoejpkpYRjNFvBnQ4REdqARe3xISmegwZMui54gt1M71IcdcvAGTgy5q7lp1jD UKqp+Y7NIMKWZpI6IT6fRjWpdz7Bz/jZ+7WFcNRi2K7pTjw/MDCEHJchDn4BFOS9A/qA 0MvA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=KBZcPeqb; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id f5-20020ae9ea05000000b00788748a69ddsi2832084qkg.87.2024.03.12.07.16.39 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 12 Mar 2024 07:16:39 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=KBZcPeqb; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rk2tj-0000rz-FJ; Tue, 12 Mar 2024 10:14:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rk2t9-0000Yt-QH for qemu-devel@nongnu.org; Tue, 12 Mar 2024 10:13:55 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rk2t4-00029j-4s for qemu-devel@nongnu.org; Tue, 12 Mar 2024 10:13:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1710252828; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=EfKEUanZYxUIJ2dDav+OV0GW1QHkTACV4MMey+9QxoQ=; b=KBZcPeqbQgKxS9NLP5LWZWL13dTrXrEEtdefiIru9qJh+z25RXXD3pptrujE32svn7aOme 6PdSFv5D1E73BDb08h8c6WFB0izSC3kqgvPjVX96OyBn9oZqHqkvX1nKwQJke6cHD6Wss6 J+rtUXrAAFnLHnIuk4nsB/PBcuB0m8I= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-313-xZ7AfJZ3MSSzQ_lmlnR6Qw-1; Tue, 12 Mar 2024 10:13:44 -0400 X-MC-Unique: xZ7AfJZ3MSSzQ_lmlnR6Qw-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 723BC8A1931; Tue, 12 Mar 2024 14:13:44 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.138]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4A65C40C6DB7; Tue, 12 Mar 2024 14:13:44 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 2BC3721E691E; Tue, 12 Mar 2024 15:13:43 +0100 (CET) From: Markus Armbruster To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-block@nongnu.org, philmd@linaro.org, =?utf-8?q?C=C3=A9dric_Le_Goater?= Subject: [PATCH 02/10] qapi: Inline and remove QERR_BUS_NO_HOTPLUG definition Date: Tue, 12 Mar 2024 15:13:35 +0100 Message-ID: <20240312141343.3168265-3-armbru@redhat.com> In-Reply-To: <20240312141343.3168265-1-armbru@redhat.com> References: <20240312141343.3168265-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.2 Received-SPF: pass client-ip=170.10.129.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.687, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Philippe Mathieu-Daudé Address the comment added in commit 4629ed1e98 ("qerror: Finally unused, clean up"), from 2015: /* * These macros will go away, please don't use * in new code, and do not add new ones! */ Mechanical transformation using sed, and manual cleanup. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Cédric Le Goater Signed-off-by: Markus Armbruster Reviewed-by: Zhao Liu --- include/qapi/qmp/qerror.h | 3 --- hw/ppc/spapr_pci.c | 5 ++--- system/qdev-monitor.c | 8 +++++--- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/include/qapi/qmp/qerror.h b/include/qapi/qmp/qerror.h index 0c2689cf8a..06a1d2248e 100644 --- a/include/qapi/qmp/qerror.h +++ b/include/qapi/qmp/qerror.h @@ -17,9 +17,6 @@ * add new ones! */ -#define QERR_BUS_NO_HOTPLUG \ - "Bus '%s' does not support hotplugging" - #define QERR_DEVICE_HAS_NO_MEDIUM \ "Device '%s' has no medium" diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c index 25e0295d6f..72cfba419a 100644 --- a/hw/ppc/spapr_pci.c +++ b/hw/ppc/spapr_pci.c @@ -39,7 +39,6 @@ #include "trace.h" #include "qemu/error-report.h" #include "qemu/module.h" -#include "qapi/qmp/qerror.h" #include "hw/ppc/fdt.h" #include "hw/pci/pci_bridge.h" #include "hw/pci/pci_bus.h" @@ -1554,7 +1553,7 @@ static void spapr_pci_pre_plug(HotplugHandler *plug_handler, * we need to let them know it's not enabled */ if (plugged_dev->hotplugged) { - error_setg(errp, QERR_BUS_NO_HOTPLUG, + error_setg(errp, "Bus '%s' does not support hotplugging", phb->parent_obj.bus->qbus.name); return; } @@ -1675,7 +1674,7 @@ static void spapr_pci_unplug_request(HotplugHandler *plug_handler, SpaprDrc *drc = drc_from_dev(phb, pdev); if (!phb->dr_enabled) { - error_setg(errp, QERR_BUS_NO_HOTPLUG, + error_setg(errp, "Bus '%s' does not support hotplugging", phb->parent_obj.bus->qbus.name); return; } diff --git a/system/qdev-monitor.c b/system/qdev-monitor.c index 09e07cab9b..842c142c79 100644 --- a/system/qdev-monitor.c +++ b/system/qdev-monitor.c @@ -661,7 +661,8 @@ DeviceState *qdev_device_add_from_qdict(const QDict *opts, if (qdev_should_hide_device(opts, from_json, errp)) { if (bus && !qbus_is_hotpluggable(bus)) { - error_setg(errp, QERR_BUS_NO_HOTPLUG, bus->name); + error_setg(errp, "Bus '%s' does not support hotplugging", + bus->name); } return NULL; } else if (*errp) { @@ -669,7 +670,7 @@ DeviceState *qdev_device_add_from_qdict(const QDict *opts, } if (phase_check(PHASE_MACHINE_READY) && bus && !qbus_is_hotpluggable(bus)) { - error_setg(errp, QERR_BUS_NO_HOTPLUG, bus->name); + error_setg(errp, "Bus '%s' does not support hotplugging", bus->name); return NULL; } @@ -911,7 +912,8 @@ void qdev_unplug(DeviceState *dev, Error **errp) } if (dev->parent_bus && !qbus_is_hotpluggable(dev->parent_bus)) { - error_setg(errp, QERR_BUS_NO_HOTPLUG, dev->parent_bus->name); + error_setg(errp, "Bus '%s' does not support hotplugging", + dev->parent_bus->name); return; }