target/ppc/kvm: Fix const violation when trimming CPU alias suffix
GCC 16 tightens diagnostics around const correctness and now correctly rejects attempts to modify strings referenced through const-qualified pointers. In kvm_ppc_register_host_cpu_type(), ppc_cpu_aliases[i].model is defined as const char *, but the code was using strstr() on it and then modifying the returned pointer in-place to strip POWERPC_CPU_TYPE_SUFFIX. This results in a write through a pointer derived from const data, triggering a build failure with GCC 16: error: assignment discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers] suffix = strstr(ppc_cpu_aliases[i].model, POWERPC_CPU_TYPE_SUFFIX); ^ Fix this by changing suffix to 'const gchar *' and using g_strstr_len() to locate the suffix, then allocating a new string with g_strndup() (to copy only the prefix) or g_strdup() (to copy the entire name if no suffix exists). This maintains const correctness throughout while preserving the original functionality. No functional change intended. Signed-off-by: Vaibhav Jain <vaibhav@linux.ibm.com> Signed-off-by: Amit Machhiwal <amachhiw@linux.ibm.com> Tested-by: Anushree Mathur <anushree.mathur@linux.ibm.com> Reviewed-by: Aditya Gupta <adityag@linux.ibm.com> Link: https://lore.kernel.org/qemu-devel/20260518172517.12466-2-amachhiw@linux.ibm.com Signed-off-by: Harsh Prateek Bora <harshpb@linux.ibm.com>