[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v5 1/6] tools/cpupools: Give a name to unnamed cpupools
- To: Anthony PERARD <anthony.perard@xxxxxxxxxx>
- From: Luca Fancellu <Luca.Fancellu@xxxxxxx>
- Date: Thu, 7 Apr 2022 08:26:17 +0000
- Accept-language: en-GB, en-US
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=gAf35f9MNqHW/6RMCK1wmqGwGM3tG+Fuo6ex+MaKSD4=; b=MGTLkhXR7kbxvPDPmvuI3hnE9Q/kgzV+Btp4WvvaLT6Y4iHhwoMHiNQ2VLnq1e6DsSjBSfE0zXhirRZ7ojEGBDU+T0u7E7bQ94MMIz3SJWnOcxJyQwZAzUNJlV1UPs7RI50BaQWE7bcE1jQdz/70hGvJqin1Z9PsWI2hYOaAKH7zCseDVXIk/WgJWL8MzW7fAwnsi0HFtC6+bzHYhYN9UF3aOViXIV3YwMPVGHLXqKE4U7zM253XokD9sgZR+baIW++yYt2Xhu0N/3Wa4EV18rdOoon8GboEvDxCHHQ/7itNEx8Dr4nJTxxQudC664DZPv3XW5MyZ7g1JR6b/M069A==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=miD2w7UPezTtTBxu47NXPTwDfZh2QRTbA1p5Ma3Gu+yWS0DOjPfxgc2fOVCIFbdqNq2FqEDKEa58892N9bNeO8jAMuaywgpmwBIftShX+LEOit07hRVKygOlrt/Tam8e7uUe7g0YbGNp24TCv8MQxT1FIzhNg8ufeaNvhSA6kVaPepobOoGjXL8WLZqprvWSYRwO2yjOQDEVQgKOj+EG2+ITCjWPjYxU1j4N9mmq2ZTDEj0l4RQWKwiAe+6QSBY9VZHgFooKXmZXohVB14DRXfc0XN1MdDJnVAN9jtEG32Alxi+wl97hKi4XVcdZZ6TiUYlb0FkRq/KA8H3wyE6mNA==
- Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
- Cc: Xen developer discussion <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Wei Chen <Wei.Chen@xxxxxxx>, Wei Liu <wl@xxxxxxx>, Juergen Gross <jgross@xxxxxxxx>
- Delivery-date: Thu, 07 Apr 2022 08:26:48 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Nodisclaimer: true
- Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
- Thread-index: AQHYSMtXyn8LVgjvo0+6iWYmcNxLBKzi+zCAgAElhoA=
- Thread-topic: [PATCH v5 1/6] tools/cpupools: Give a name to unnamed cpupools
> 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
|