All of lore.kernel.org
 help / color / mirror / Atom feed
From: Luca Fancellu <Luca.Fancellu@arm.com>
To: Anthony PERARD <anthony.perard@citrix.com>
Cc: Xen developer discussion <xen-devel@lists.xenproject.org>,
	Bertrand Marquis <Bertrand.Marquis@arm.com>,
	Wei Chen <Wei.Chen@arm.com>, Wei Liu <wl@xen.org>,
	Juergen Gross <jgross@suse.com>
Subject: Re: [PATCH v5 1/6] tools/cpupools: Give a name to unnamed cpupools
Date: Thu, 7 Apr 2022 08:26:17 +0000	[thread overview]
Message-ID: <DC9DBD73-6E4F-487E-A9C4-F86202059ED1@arm.com> (raw)
In-Reply-To: <Yk2p73WCT5Gi85vK@perard.uk.xensource.com>



> Could you rework this loop so that "goto out" is always the right things
> to do in case of error? That is the function would always free()
> "pool_path" and "pool_name" regardless of their values, and we only need
> to make sure both are NULL when they are already free. This is to avoid
> having several path in case of error, as this could result in mistake
> later. If there's only one error path, there will be less likely to have
> mistakes. This loop, at the moment, is using three different error
> paths: "goto out", "goto out_err", and no goto followed by a standalone
> goto.

Hi Anthony,

Yes I will rework it and send v6. Thanks for your review.

Cheers,
Luca

> 
>> +            }
>> +            pool_id++;
>> +            if (!xs_write(xsh, XBT_NULL, pool_path, pool_name,
>> +                          strlen(pool_name))) {
>> +                fprintf(stderr, "cannot set pool name\n");
>> +                rc = 1;
>> +            }
>> +            free(pool_name);
>> +out_err:
>> +            free(pool_path);
>> +            if ( rc )
>> +                goto out;
>> +        }
>> +    } while(xcinfo != NULL);
> 
> Thanks,
> 
> -- 
> Anthony PERARD



  reply	other threads:[~2022-04-07  8:27 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-05  8:57 [PATCH v5 0/6] Boot time cpupools Luca Fancellu
2022-04-05  8:57 ` [PATCH v5 1/6] tools/cpupools: Give a name to unnamed cpupools Luca Fancellu
2022-04-06 14:55   ` Anthony PERARD
2022-04-07  8:26     ` Luca Fancellu [this message]
2022-04-05  8:57 ` [PATCH v5 2/6] xen/sched: create public function for cpupools creation Luca Fancellu
2022-04-07  6:07   ` Juergen Gross
2022-04-07  8:25     ` Luca Fancellu
2022-04-05  8:57 ` [PATCH v5 3/6] xen/sched: retrieve scheduler id by name Luca Fancellu
2022-04-05  8:57 ` [PATCH v5 4/6] xen/cpupool: Create different cpupools at boot time Luca Fancellu
2022-04-06 20:47   ` Stefano Stabellini
2022-04-07  6:15   ` Juergen Gross
2022-04-07  8:58   ` Julien Grall
2022-04-07  9:52     ` Luca Fancellu
2022-04-07 14:36       ` Julien Grall
2022-04-05  8:57 ` [PATCH v5 5/6] arm/dom0less: assign dom0less guests to cpupools Luca Fancellu
2022-04-05  8:57 ` [PATCH v5 6/6] xen/cpupool: Allow cpupool0 to use different scheduler Luca Fancellu
2022-04-07  6:45   ` Juergen Gross

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DC9DBD73-6E4F-487E-A9C4-F86202059ED1@arm.com \
    --to=luca.fancellu@arm.com \
    --cc=Bertrand.Marquis@arm.com \
    --cc=Wei.Chen@arm.com \
    --cc=anthony.perard@citrix.com \
    --cc=jgross@suse.com \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.