On Thu, 29 Oct 2026 at 09:23, Eric Auger <[email protected]> wrote:
>
> This allows to report a precise error message if any error occurs.
>
> Signed-off-by: Eric Auger <[email protected]>
> @@ -371,7 +377,8 @@ static void
> kvm_arm_get_host_cpu_features(ARMHostCPUFeatures *ahcf)
> features |= 1ULL << ARM_FEATURE_PMU;
> }
>
> - if (!kvm_arm_create_scratch_host_vcpu(fdarray, &init)) {
> + if (!kvm_arm_create_scratch_host_vcpu(fdarray, &init, &local_err)) {
> + error_report_err(local_err);
> return;
> }
This isn't supposed to report an error here. The caller of
this function is kvm_arm_set_cpu_features_from_host(), which
sets cpu->host_cpu_probe_failed for any failures. That is
later checked by arm_cpu_realizefn(), which reports either
that you didn't use an accelerator type you should have or else
the rather vague "Failed to retrieve host CPU features".
If you want to make that more specific, I think you need to save
that more specific error information instead of the plain
boolean host_cpu_probe_failed, so you have it in arm_cpu_realizefn
where you can report it up.
> @@ -2653,8 +2660,10 @@ void arm_cpu_kvm_set_irq(void *arm_cpu, int irq, int
> level)
> void arm_gic_cap_kvm_probe(GICCapability *v2, GICCapability *v3)
> {
> int fdarray[3];
> + Error *local_err = NULL;
>
> - if (!kvm_arm_create_scratch_host_vcpu(fdarray, NULL)) {
> + if (!kvm_arm_create_scratch_host_vcpu(fdarray, NULL, &local_err)) {
> + error_report_err(local_err);
> return;
> }
The only caller of arm_gic_cap_kvm_probe() is qmp_query_gic_capabilities(),
which has an Error parameter. So here we should be passing the error
up to it to report, not reporting it locally.
thanks
-- PMM