From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Damien Hedde" <damien.hedde@greensocs.com>,
"Daniel P. Berrangé" <berrange@redhat.com>,
"Eduardo Habkost" <ehabkost@redhat.com>,
"Richard Henderson" <richard.henderson@linaro.org>,
"Dr. David Alan Gilbert" <dgilbert@redhat.com>,
"Markus Armbruster" <armbru@redhat.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Philippe Mathieu-Daudé" <philmd@redhat.com>
Subject: [PATCH 5/5] hw/core: Remove uses of QERR_INVALID_PARAMETER_VALUE
Date: Sat, 30 Oct 2021 01:01:47 +0200 [thread overview]
Message-ID: <20211029230147.2465055-6-philmd@redhat.com> (raw)
In-Reply-To: <20211029230147.2465055-1-philmd@redhat.com>
QERR_INVALID_PARAMETER_VALUE definition is obsolete since 2015
(commit 4629ed1e989, "qerror: Finally unused, clean up").
Replace the definitions used in hw/core/.
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
hw/core/qdev-properties-system.c | 2 +-
monitor/misc.c | 3 +--
softmmu/cpus.c | 3 +--
softmmu/qdev-monitor.c | 7 +++----
4 files changed, 6 insertions(+), 9 deletions(-)
diff --git a/hw/core/qdev-properties-system.c b/hw/core/qdev-properties-system.c
index a91f60567aa..91b322fe372 100644
--- a/hw/core/qdev-properties-system.c
+++ b/hw/core/qdev-properties-system.c
@@ -749,7 +749,7 @@ static void set_pci_devfn(Object *obj, Visitor *v, const char *name,
return;
}
if (value < -1 || value > 255) {
- error_setg(errp, QERR_INVALID_PARAMETER_VALUE,
+ error_setg(errp, "Parameter '%s' expects %s",
name ? name : "null", "a value between -1 and 255");
return;
}
diff --git a/monitor/misc.c b/monitor/misc.c
index ffe79668706..5a33458173e 100644
--- a/monitor/misc.c
+++ b/monitor/misc.c
@@ -125,8 +125,7 @@ char *qmp_human_monitor_command(const char *command_line, bool has_cpu_index,
if (has_cpu_index) {
int ret = monitor_set_cpu(&hmp.common, cpu_index);
if (ret < 0) {
- error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "cpu-index",
- "a CPU number");
+ error_setg(errp, "Parameter 'cpu-index' expects a CPU number");
goto out;
}
}
diff --git a/softmmu/cpus.c b/softmmu/cpus.c
index 071085f840b..0e7f44154fa 100644
--- a/softmmu/cpus.c
+++ b/softmmu/cpus.c
@@ -741,8 +741,7 @@ void qmp_memsave(int64_t addr, int64_t size, const char *filename,
cpu = qemu_get_cpu(cpu_index);
if (cpu == NULL) {
- error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "cpu-index",
- "a CPU number");
+ error_setg(errp, "Parameter 'cpu-index' expects a CPU number");
return;
}
diff --git a/softmmu/qdev-monitor.c b/softmmu/qdev-monitor.c
index 35a885a6623..27f3a1248ac 100644
--- a/softmmu/qdev-monitor.c
+++ b/softmmu/qdev-monitor.c
@@ -241,16 +241,15 @@ static DeviceClass *qdev_get_device_class(const char **driver, Error **errp)
}
if (object_class_is_abstract(oc)) {
- error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "driver",
- "a non-abstract device type");
+ error_setg(errp,
+ "Parameter 'driver' expects a non-abstract device type");
return NULL;
}
dc = DEVICE_CLASS(oc);
if (!dc->user_creatable ||
(phase_check(PHASE_MACHINE_READY) && !dc->hotpluggable)) {
- error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "driver",
- "a pluggable device type");
+ error_setg(errp, "Parameter 'driver' expects a pluggable device type");
return NULL;
}
--
2.31.1
next prev parent reply other threads:[~2021-10-29 23:06 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-29 23:01 [PATCH 0/5] hw/core: Remove uses of obsolete QERR_ definitions Philippe Mathieu-Daudé
2021-10-29 23:01 ` [PATCH 1/5] hw/core: Remove use of QERR_UNSUPPORTED Philippe Mathieu-Daudé
2021-11-19 7:01 ` Markus Armbruster
2021-10-29 23:01 ` [PATCH 2/5] hw/core: Remove use of QERR_FEATURE_DISABLED Philippe Mathieu-Daudé
2021-11-19 8:18 ` Markus Armbruster
2021-10-29 23:01 ` [PATCH 3/5] hw/core: Remove uses of QERR_DEVICE_NO_HOTPLUG Philippe Mathieu-Daudé
2021-11-19 8:20 ` Markus Armbruster
2021-11-19 11:27 ` Damien Hedde
2021-10-29 23:01 ` [PATCH 4/5] hw/core: Remove uses of QERR_PROPERTY_VALUE_BAD Philippe Mathieu-Daudé
2021-11-02 9:47 ` Damien Hedde
2021-11-02 11:59 ` Philippe Mathieu-Daudé
2021-11-19 6:51 ` Markus Armbruster
2021-10-29 23:01 ` Philippe Mathieu-Daudé [this message]
2021-11-19 8:27 ` [PATCH 5/5] hw/core: Remove uses of QERR_INVALID_PARAMETER_VALUE Markus Armbruster
2021-11-02 9:51 ` [PATCH 0/5] hw/core: Remove uses of obsolete QERR_ definitions Damien Hedde
2021-11-02 11:58 ` Philippe Mathieu-Daudé
2021-11-19 8:35 ` Markus Armbruster
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=20211029230147.2465055-6-philmd@redhat.com \
--to=philmd@redhat.com \
--cc=armbru@redhat.com \
--cc=berrange@redhat.com \
--cc=damien.hedde@greensocs.com \
--cc=dgilbert@redhat.com \
--cc=ehabkost@redhat.com \
--cc=pbonzini@redhat.com \
--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).