1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-03-20 06:50:22 +03:00

cpu: Do not call g_strv_contains on NULL list

When virCPUx86UpdateLive checks whether a feature was added to a CPU
model after the model was already released (vmx-* features in most Intel
models), the following assert could be logged by glib:

    g_strv_contains: assertion 'strv != NULL' failed

While most of our CPU models have a non-empty list of added feature, new
models added in 2024 and versioned variants of older models have
addedFeatures == NULL.

Fixes: e622970c8785ec1f7e142d72f792d89f870e07d0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Jiri Denemark 2025-02-24 11:24:27 +01:00
parent d36c91ae14
commit 5c78395bad

View File

@ -3212,6 +3212,7 @@ virCPUx86UpdateLive(virCPUDef *cpu,
* behaved before the features were added.
*/
if (!explicit &&
model->addedFeatures &&
g_strv_contains((const char **) model->addedFeatures, feature->name))
ignore = true;