[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Stable-8.2.1 04/38] target/riscv/kvm: do not use non-portable strerrorn
From: |
Michael Tokarev |
Subject: |
[Stable-8.2.1 04/38] target/riscv/kvm: do not use non-portable strerrorname_np() |
Date: |
Thu, 18 Jan 2024 10:52:31 +0300 |
From: Natanael Copa <ncopa@alpinelinux.org>
strerrorname_np is non-portable and breaks building with musl libc.
Use strerror(errno) instead, like we do other places.
Cc: qemu-stable@nongnu.org
Fixes: commit 082e9e4a58ba (target/riscv/kvm: improve 'init_multiext_cfg' error
msg)
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2041
Buglink: https://gitlab.alpinelinux.org/alpine/aports/-/issues/15541
Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
Reviewed-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
(cherry picked from commit d424db235434b8356c6b2d9420b846c7ddcc83ea)
diff --git a/target/riscv/kvm/kvm-cpu.c b/target/riscv/kvm/kvm-cpu.c
index 45b6cf1cfa..117e33cf90 100644
--- a/target/riscv/kvm/kvm-cpu.c
+++ b/target/riscv/kvm/kvm-cpu.c
@@ -832,9 +832,8 @@ static void kvm_riscv_read_multiext_legacy(RISCVCPU *cpu,
multi_ext_cfg->supported = false;
val = false;
} else {
- error_report("Unable to read ISA_EXT KVM register %s, "
- "error code: %s", multi_ext_cfg->name,
- strerrorname_np(errno));
+ error_report("Unable to read ISA_EXT KVM register %s: %s",
+ multi_ext_cfg->name, strerror(errno));
exit(EXIT_FAILURE);
}
} else {
@@ -895,8 +894,8 @@ static void kvm_riscv_init_multiext_cfg(RISCVCPU *cpu,
KVMScratchCPU *kvmcpu)
*
* Error out if we get any other errno.
*/
- error_report("Error when accessing get-reg-list, code: %s",
- strerrorname_np(errno));
+ error_report("Error when accessing get-reg-list: %s",
+ strerror(errno));
exit(EXIT_FAILURE);
}
@@ -905,8 +904,8 @@ static void kvm_riscv_init_multiext_cfg(RISCVCPU *cpu,
KVMScratchCPU *kvmcpu)
reglist->n = rl_struct.n;
ret = ioctl(kvmcpu->cpufd, KVM_GET_REG_LIST, reglist);
if (ret) {
- error_report("Error when reading KVM_GET_REG_LIST, code %s ",
- strerrorname_np(errno));
+ error_report("Error when reading KVM_GET_REG_LIST: %s",
+ strerror(errno));
exit(EXIT_FAILURE);
}
@@ -927,9 +926,8 @@ static void kvm_riscv_init_multiext_cfg(RISCVCPU *cpu,
KVMScratchCPU *kvmcpu)
reg.addr = (uint64_t)&val;
ret = ioctl(kvmcpu->cpufd, KVM_GET_ONE_REG, ®);
if (ret != 0) {
- error_report("Unable to read ISA_EXT KVM register %s, "
- "error code: %s", multi_ext_cfg->name,
- strerrorname_np(errno));
+ error_report("Unable to read ISA_EXT KVM register %s: %s",
+ multi_ext_cfg->name, strerror(errno));
exit(EXIT_FAILURE);
}
--
2.39.2
- [Stable-8.2.1 00/38] Patch Round-up for stable 8.2.1, freeze on 2024-01-27, Michael Tokarev, 2024/01/18
- [Stable-8.2.1 01/38] block: Fix crash when loading snapshot on inactive node, Michael Tokarev, 2024/01/18
- [Stable-8.2.1 02/38] vl: Improve error message for conflicting -incoming and -loadvm, Michael Tokarev, 2024/01/18
- [Stable-8.2.1 03/38] iotests: Basic tests for internal snapshots, Michael Tokarev, 2024/01/18
- [Stable-8.2.1 04/38] target/riscv/kvm: do not use non-portable strerrorname_np(),
Michael Tokarev <=
- [Stable-8.2.1 05/38] include/ui/rect.h: fix qemu_rect_init() mis-assignment, Michael Tokarev, 2024/01/18
- [Stable-8.2.1 06/38] configure: use a native non-cross compiler for linux-user, Michael Tokarev, 2024/01/18
- [Stable-8.2.1 07/38] target/i386: the sgx_epc_get_section stub is reachable, Michael Tokarev, 2024/01/18
- [Stable-8.2.1 08/38] hw/net/can/sja1000: fix bug for single acceptance filter and standard frame, Michael Tokarev, 2024/01/18
- [Stable-8.2.1 09/38] target/riscv: Fix mcycle/minstret increment behavior, Michael Tokarev, 2024/01/18
- [Stable-8.2.1 10/38] chardev/char.c: fix "abstract device type" error message, Michael Tokarev, 2024/01/18
- [Stable-8.2.1 11/38] audio/audio.c: remove trailing newline in error_setg, Michael Tokarev, 2024/01/18
- [Stable-8.2.1 12/38] hw/net: cadence_gem: Fix MDIO_OP_xxx values, Michael Tokarev, 2024/01/18
- [Stable-8.2.1 13/38] edu: fix DMA range upper bound check, Michael Tokarev, 2024/01/18
- [Stable-8.2.1 14/38] vfio/container: Replace basename with g_path_get_basename, Michael Tokarev, 2024/01/18