From: Markus Armbruster <armbru@redhat.com>
To: qemu-devel@nongnu.org
Cc: richard.henderson@linaro.org,
"Philippe Mathieu-Daudé" <philmd@linaro.org>,
"Cédric Le Goater" <clg@kaod.org>
Subject: [PULL 02/10] qapi: Inline and remove QERR_BUS_NO_HOTPLUG definition
Date: Wed, 24 Apr 2024 10:03:29 +0200 [thread overview]
Message-ID: <20240424080337.2782594-3-armbru@redhat.com> (raw)
In-Reply-To: <20240424080337.2782594-1-armbru@redhat.com>
From: Philippe Mathieu-Daudé <philmd@linaro.org>
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é <philmd@linaro.org>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-ID: <20240312141343.3168265-3-armbru@redhat.com>
---
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 840177d19f..2ae1460e21 100644
--- a/system/qdev-monitor.c
+++ b/system/qdev-monitor.c
@@ -660,7 +660,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) {
@@ -668,7 +669,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;
}
@@ -910,7 +911,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;
}
--
2.44.0
next prev parent reply other threads:[~2024-04-24 8:05 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-24 8:03 [PULL 00/10] Error reporting patches for 2024-04-24 Markus Armbruster
2024-04-24 8:03 ` [PULL 01/10] error: Drop superfluous #include "qapi/qmp/qerror.h" Markus Armbruster
2024-04-24 8:03 ` Markus Armbruster [this message]
2024-04-24 8:03 ` [PULL 03/10] qapi: Inline and remove QERR_DEVICE_HAS_NO_MEDIUM definition Markus Armbruster
2024-04-24 8:03 ` [PULL 04/10] qapi: Inline and remove QERR_DEVICE_NO_HOTPLUG definition Markus Armbruster
2024-04-24 8:03 ` [PULL 05/10] qapi: Inline and remove QERR_INVALID_PARAMETER definition Markus Armbruster
2024-04-24 8:03 ` [PULL 06/10] qapi: Inline QERR_INVALID_PARAMETER_TYPE definition (constant value) Markus Armbruster
2024-04-24 8:03 ` [PULL 07/10] qapi: Inline and remove QERR_INVALID_PARAMETER_TYPE definition Markus Armbruster
2024-04-24 8:03 ` [PULL 08/10] qapi: Correct error message for 'vcpu_dirty_limit' parameter Markus Armbruster
2024-04-24 8:03 ` [PULL 09/10] qapi: Inline and remove QERR_MIGRATION_ACTIVE definition Markus Armbruster
2024-04-24 8:03 ` [PULL 10/10] qapi: Inline and remove QERR_PROPERTY_VALUE_BAD definition Markus Armbruster
2024-04-24 18:47 ` [PULL 00/10] Error reporting patches for 2024-04-24 Richard Henderson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240424080337.2782594-3-armbru@redhat.com \
--to=armbru@redhat.com \
--cc=clg@kaod.org \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).