qemu-s390x
[Top][All Lists]
Advanced

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

Re: [PATCH 3/6] target/s390x/cpu_models: Make kvm_s390_get_host_cpu_mode


From: Zhao Liu
Subject: Re: [PATCH 3/6] target/s390x/cpu_models: Make kvm_s390_get_host_cpu_model() return boolean
Date: Fri, 19 Apr 2024 15:18:22 +0800

> > diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c
> > index 052540a866ac..a0e4acb707d7 100644
> > --- a/target/s390x/cpu_models.c
> > +++ b/target/s390x/cpu_models.c
> > @@ -560,16 +560,15 @@ S390CPUModel *get_max_cpu_model(Error **errp)
> >       }
> >       if (kvm_enabled()) {
> 
> Nitpicking, we could move @err declaration here:
> 
>           Error *err = NULL;

Yeah! Next patch removes this variable completely, so I think it's OK
not to move. ;-)

Thanks,
Zhao

> > -        kvm_s390_get_host_cpu_model(&max_model, &err);
> > +        if (!kvm_s390_get_host_cpu_model(&max_model, &err)) {
> > +            error_propagate(errp, err);
> > +            return NULL;
> > +        }
> >       } else {
> >           max_model.def = s390_find_cpu_def(QEMU_MAX_CPU_TYPE, 
> > QEMU_MAX_CPU_GEN,
> >                                             QEMU_MAX_CPU_EC_GA, NULL);
> >           bitmap_copy(max_model.features, qemu_max_cpu_feat, S390_FEAT_MAX);
> >       }
> > -    if (err) {
> > -        error_propagate(errp, err);
> > -        return NULL;
> > -    }
> >       cached = true;
> >       return &max_model;
> >   }
> 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]