[Top][All Lists]

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

Re: [PATCH v12 16/16] machine: Make smp_parse return a boolean

From: Paolo Bonzini
Subject: Re: [PATCH v12 16/16] machine: Make smp_parse return a boolean
Date: Thu, 7 Oct 2021 10:30:17 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.1.0

On 07/10/21 05:44, wangyanan (Y) wrote:

I notice that with Paolo's fix applied first and then Patch15 removing
the sanity checks out, machine_set_smp() at last simply becomes:

static void machine_set_smp(Object *obj, Visitor *v, const char *name,
                             void *opaque, Error **errp)
     MachineState *ms = MACHINE(obj);
     g_autoptr(SMPConfiguration) config = NULL;

     if (!visit_type_SMPConfiguration(v, name, &config, errp)) {

     smp_parse(ms, config, errp);

It looks good currently, neither the returned boolean nor the errp needs to
be checked here now, and smp_parse is only called here. So in this case,
we may avoid the boolean until we need to use it and honor the rule. :)

Even inlining smp_parse is a possibility now.


reply via email to

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