[PATCH] cpu: Do not call g_strv_contains on NULL list

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 src/cpu/cpu_x86.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c
index 67c88ae3b7..32aa01bc14 100644
--- a/src/cpu/cpu_x86.c
+++ b/src/cpu/cpu_x86.c
@@ -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;
 
-- 
2.48.1




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux