[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 12/12] rocker: Tweak stubbed out monitor commands' error messages
From: |
Markus Armbruster |
Subject: |
[PULL 12/12] rocker: Tweak stubbed out monitor commands' error messages |
Date: |
Thu, 23 Feb 2023 14:46:26 +0100 |
The QERR_ macros are leftovers from the days of "rich" error objects.
We've been trying to reduce their remaining use.
The stubbed out Rocker monitor commands are the last remaining users
of QERR_FEATURE_DISABLED. They fail like this:
(qemu) info rocker mumble
Error: The feature 'rocker' is not enabled
The real rocker commands fail like this when the named object doesn't
exist:
Error: rocker mumble not found
If that's good enough when Rocker is enabled, then it's good enough
when it's disabled, so replace QERR_FEATURE_DISABLED with that, and
drop the macro.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20230207075115.1525-13-armbru@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Juan Quintela <quintela@redhat.com>
---
include/qapi/qmp/qerror.h | 3 ---
hw/net/rocker/qmp-norocker.c | 12 +++++-------
2 files changed, 5 insertions(+), 10 deletions(-)
diff --git a/include/qapi/qmp/qerror.h b/include/qapi/qmp/qerror.h
index 09006e69f7..8dd9fcb071 100644
--- a/include/qapi/qmp/qerror.h
+++ b/include/qapi/qmp/qerror.h
@@ -29,9 +29,6 @@
#define QERR_DEVICE_NO_HOTPLUG \
"Device '%s' does not support hotplugging"
-#define QERR_FEATURE_DISABLED \
- "The feature '%s' is not enabled"
-
#define QERR_INVALID_PARAMETER \
"Invalid parameter '%s'"
diff --git a/hw/net/rocker/qmp-norocker.c b/hw/net/rocker/qmp-norocker.c
index 5ef4f9324c..f6c1196a24 100644
--- a/hw/net/rocker/qmp-norocker.c
+++ b/hw/net/rocker/qmp-norocker.c
@@ -1,6 +1,5 @@
/*
- * QMP Target options - Commands handled based on a target config
- * versus a host config
+ * QMP command stubs
*
* Copyright (c) 2015 David Ahern <dsahern@gmail.com>
*
@@ -18,17 +17,16 @@
#include "qemu/osdep.h"
#include "qapi/error.h"
#include "qapi/qapi-commands-rocker.h"
-#include "qapi/qmp/qerror.h"
RockerSwitch *qmp_query_rocker(const char *name, Error **errp)
{
- error_setg(errp, QERR_FEATURE_DISABLED, "rocker");
+ error_setg(errp, "rocker %s not found", name);
return NULL;
};
RockerPortList *qmp_query_rocker_ports(const char *name, Error **errp)
{
- error_setg(errp, QERR_FEATURE_DISABLED, "rocker");
+ error_setg(errp, "rocker %s not found", name);
return NULL;
};
@@ -37,7 +35,7 @@ RockerOfDpaFlowList *qmp_query_rocker_of_dpa_flows(const char
*name,
uint32_t tbl_id,
Error **errp)
{
- error_setg(errp, QERR_FEATURE_DISABLED, "rocker");
+ error_setg(errp, "rocker %s not found", name);
return NULL;
};
@@ -46,6 +44,6 @@ RockerOfDpaGroupList *qmp_query_rocker_of_dpa_groups(const
char *name,
uint8_t type,
Error **errp)
{
- error_setg(errp, QERR_FEATURE_DISABLED, "rocker");
+ error_setg(errp, "rocker %s not found", name);
return NULL;
};
--
2.39.0
- [PULL 00/12] Error reporting patches patches for 2023-02-23, Markus Armbruster, 2023/02/23
- [PULL 02/12] dump: Improve error message when target doesn't support memory dump, Markus Armbruster, 2023/02/23
- [PULL 03/12] dump: Assert cpu_get_note_size() can't fail, Markus Armbruster, 2023/02/23
- [PULL 09/12] replay: Simplify setting replay blockers, Markus Armbruster, 2023/02/23
- [PULL 10/12] hw/core: Improve the query-hotpluggable-cpus error message, Markus Armbruster, 2023/02/23
- [PULL 01/12] error: Drop superfluous #include "qapi/qmp/qerror.h", Markus Armbruster, 2023/02/23
- [PULL 11/12] migration/colo: Improve an x-colo-lost-heartbeat error message, Markus Armbruster, 2023/02/23
- [PULL 05/12] hw/smbios: Dumb down smbios_entry_add() stub, Markus Armbruster, 2023/02/23
- [PULL 12/12] rocker: Tweak stubbed out monitor commands' error messages,
Markus Armbruster <=
- [PULL 08/12] qga: Drop dangling reference to QERR_QGA_LOGGING_DISABLED, Markus Armbruster, 2023/02/23
- [PULL 04/12] hw/core: Improve error message when machine doesn't provide NMIs, Markus Armbruster, 2023/02/23
- [PULL 07/12] hw/acpi: Move QMP command to hw/core/, Markus Armbruster, 2023/02/23
- [PULL 06/12] hw/acpi: Dumb down acpi_table_add() stub, Markus Armbruster, 2023/02/23
- Re: [PULL 00/12] Error reporting patches patches for 2023-02-23, Peter Maydell, 2023/02/24