On 8/1/26 08:06, Markus Armbruster wrote:
A few error messages show numeric errno codes. Use error_setg_errno()
to show human-readable text instead.
Signed-off-by: Markus Armbruster <[email protected]>
Message-ID: <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
[Trivial fixup to riscv_kvm_cpu_finalize_features()]
---
backends/cryptodev-lkcf.c | 2 +-
hw/ppc/spapr.c | 6 +++---
hw/vfio/migration-multifd.c | 5 +++--
migration/rdma.c | 3 +--
net/l2tpv3.c | 6 ++----
target/riscv/kvm/kvm-cpu.c | 10 +++++-----
6 files changed, 15 insertions(+), 17 deletions(-)
diff --git a/target/riscv/kvm/kvm-cpu.c b/target/riscv/kvm/kvm-cpu.c
index 5d792563b9..b047ffa9c0 100644
--- a/target/riscv/kvm/kvm-cpu.c
+++ b/target/riscv/kvm/kvm-cpu.c
@@ -1996,8 +1996,8 @@ static bool kvm_cpu_realize(CPUState *cs, Error **errp)
if (riscv_has_ext(&cpu->env, RVV)) {
ret = prctl(PR_RISCV_V_SET_CONTROL, PR_RISCV_V_VSTATE_CTRL_ON);
if (ret) {
- error_setg(errp, "Error in prctl PR_RISCV_V_SET_CONTROL, code: %s",
- strerrorname_np(errno));
+ error_setg_errno(errp, errno,
+ "Error in prctl PR_RISCV_V_SET_CONTROL");
return false;
}
}
I thought we had removed this one with ce1992d45c8...
Author: Daniel Henrique Barboza <[email protected]>
Date: Wed Apr 24 17:24:25 2024 -0300
checkpatch.pl: forbid strerrorname_np()
Commit d424db2354 removed an instance of strerrorname_np() because
it was breaking building with musl libc. A recent RISC-V patch ended
up re-introducing it again by accident.
Put this function in the baddies list in checkpatch.pl to avoid this
situation again. This is what it will look like next time:
$ ./scripts/checkpatch.pl 0001-temp-test.patch
ERROR: use strerror() instead of strerrorname_np()
#22: FILE: target/riscv/kvm/kvm-cpu.c:1058:
+ strerrorname_np(errno));
total: 1 errors, 0 warnings, 10 lines checked
Signed-off-by: Daniel Henrique Barboza <[email protected]>
Reviewed-by: Thomas Huth <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Alistair Francis <[email protected]>
Reviewed-by: Michael Tokarev <[email protected]>
Signed-off-by: Michael Tokarev <[email protected]>
Just curious, was
https://lore.kernel.org/qemu-devel/[email protected]/
never merged?
Anyway we are good now.