Skip to content

Commit 37b8667

Browse files
ncopastephanosio
authored andcommitted
target/riscv/kvm: do not use non-portable strerrorname_np()
strerrorname_np is non-portable and breaks building with musl libc. Use strerror(errno) instead, like we do other places. Upstream-Status: Submitted [https://mail.gnu.org/archive/html/qemu-stable/2023-12/msg00069.html] Cc: [email protected] Fixes: commit 082e9e4 (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 <[email protected]>
1 parent 590e64f commit 37b8667

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

target/riscv/kvm/kvm-cpu.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1968,8 +1968,7 @@ static bool kvm_cpu_realize(CPUState *cs, Error **errp)
19681968
if (riscv_has_ext(&cpu->env, RVV)) {
19691969
ret = prctl(PR_RISCV_V_SET_CONTROL, PR_RISCV_V_VSTATE_CTRL_ON);
19701970
if (ret) {
1971-
error_setg(errp, "Error in prctl PR_RISCV_V_SET_CONTROL, code: %s",
1972-
strerrorname_np(errno));
1971+
error_setg(errp, "Error in prctl PR_RISCV_V_SET_CONTROL, error %d", errno);
19731972
return false;
19741973
}
19751974
}

0 commit comments

Comments
 (0)