On Mon, 2023-02-20 at 14:29 +0000, Paul Durrant wrote:
> [snip]
> >    static bool kvm_xen_hcall_vcpu_op(struct kvm_xen_exit *exit, X86CPU *cpu,
> >                                      int cmd, int vcpu_id, uint64_t arg)
> >    {
> > -    CPUState *dest = qemu_get_cpu(vcpu_id);
> >        CPUState *cs = CPU(cpu);
> > +    CPUState *dest = cs->cpu_index == vcpu_id ? cs : qemu_get_cpu(vcpu_id);
> >        int err;
> >    
> > +    if (!dest) {
> > +        return -ENOENT;
> > +    }
> > +
> 
> I thought the patch format was catching me out somehow but I don't think 
> so...
> 
> The function declaration says 'static bool kvm_xen_hcall_vcpu_op(...)' 
> but that return value doesn't look very boolean to me. I think you also 
> have the same issue...

Ah, good catch. Thanks! Those additional checks were added later.

But why in $DEITY's name did the compiler not catch that? That almost
makes me reconsider my life choices in having that as the function
API... but this is basically never going to need to change so I think
it's OK. I'll fix it and move on. There are plenty of other choices
I've made in my life which are far more worthy of second-guessing...

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to