[libvirt PATCH] qemu: fix recording of CPU deprecations

Michal Prívozník mprivozn at redhat.com
Fri Mar 18 10:45:40 UTC 2022


On 3/17/22 18:53, Daniel P. Berrangé wrote:
> The code parsing thue query-cpu-definitions response will short-circuit
> the for loop in the case where usable=yes, resulting in us failing to
> parse the CPU deprecation flag.
> 
> IOW, we only reported deprecations in domain capabilities for CPU models
> which were not runnable on the host.
> 
> Signed-off-by: Daniel P. Berrangé <berrange at redhat.com>
> ---
>  src/qemu/qemu_monitor_json.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
> index 27c5e1c992..d5622bd6d9 100644
> --- a/src/qemu/qemu_monitor_json.c
> +++ b/src/qemu/qemu_monitor_json.c
> @@ -5309,10 +5309,9 @@ qemuMonitorJSONGetCPUDefinitions(qemuMonitor *mon,
>              if (g_strv_length(cpu->blockers) == 0) {
>                  cpu->usable = VIR_DOMCAPS_CPU_USABLE_YES;
>                  g_clear_pointer(&cpu->blockers, g_strfreev);
> -                continue;
> +            } else {
> +                cpu->usable = VIR_DOMCAPS_CPU_USABLE_NO;
>              }
> -
> -            cpu->usable = VIR_DOMCAPS_CPU_USABLE_NO;
>          }
>  
>          if (virJSONValueObjectHasKey(child, "deprecated") &&

Reviewed-by: Michal Privoznik <mprivozn at redhat.com>

Michal



More information about the libvir-list mailing list