]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
target/ppc: Use glib2 instead of strcasecmp/strncasecmp
authorKostiantyn Kostiuk <kkostiuk@redhat.com>
Fri, 27 Mar 2026 13:43:54 +0000 (15:43 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 23 Apr 2026 10:27:27 +0000 (12:27 +0200)
This is a change in semantics. g_ascii_strcasecmp() doesn't honour
locale but strcasecmp() does. But this is OK for at least one reason:
 (1) QEMU always runs with the C locale so there's not an actual
     behaviour change here

Signed-off-by: Kostiantyn Kostiuk <kkostiuk@redhat.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Link: https://lore.kernel.org/r/20260327134401.270186-9-kkostiuk@redhat.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
target/ppc/kvm.c

index 41bd03ec2a2c43aa9263f521c905d90b8b0d6bd3..25c28ad089c61439607e64f7b41504a0cbc0e230 100644 (file)
@@ -2653,7 +2653,7 @@ static int kvm_ppc_register_host_cpu_type(void)
      */
     dc = DEVICE_CLASS(ppc_cpu_get_family_class(pvr_pcc));
     for (i = 0; ppc_cpu_aliases[i].alias != NULL; i++) {
-        if (strcasecmp(ppc_cpu_aliases[i].alias, dc->desc) == 0) {
+        if (g_ascii_strcasecmp(ppc_cpu_aliases[i].alias, dc->desc) == 0) {
             char *suffix;
 
             ppc_cpu_aliases[i].model = g_strdup(object_class_get_name(oc));