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

Re: [RFC PATCH 2/2] tools/cpupools: Give a name to unnamed cpupools


  • To: Juergen Gross <jgross@xxxxxxxx>
  • From: Luca Fancellu <luca.fancellu@xxxxxxx>
  • Date: Wed, 17 Nov 2021 11:52:01 +0000
  • 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=Vo1+fdYgImCVH9Dbo/jFZe8vPebZIbtirwi6vieZFIY=; b=dpAILSMVYEtWXw+t8uLNIwe6HNvDiJEAyIwwxg5Yr+T7Zmla5k1pxPSCj/0+ib6t9C2QFpv4XdAlchnLPZ/L/BvmW2abySfivCtl4wm+0992FcnOjgGqhLJMeeWJPscmVAyC94T17PcAQFH4FPQf5xB/Gy57aj8wpHRxlWjYP4xoefBrUWg0zFyv1qs4wo8N5yn/VaIcgRwzbEf9mATuGz8G3dwjTz/BTCMbGvPVRBZ7fyHCinPcptLTi9rgTGSJHd1g9zUcbisIonhAuhpxus5b2HDduhE+RRqP5M0oI0A5nhM1TPlGabu1/p1J/Ztyjf43IWAq23zfq5NGcyLm6g==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aE+iS34bY9TagNQFM3UB+E/f7CTfIpeJwr1vIATP2S22Tao4m4vewGI9N+YRDL8kKTlMyowh5VgzXjFG5KE+1Qy90gGDCxBOAuPpO6rXGo/EJHbzUDaEfamt3ubbdEIWkqA55unSEex3Ba+31UZPFRLh/bgOOQMT0hpMhIjAehORxx1sqwZMsbSQdCH258aRZ9oX9ZQ/yPkgNoByXFHDUTU2r4nJLOvq1RVvVHI+ogjo4/rZteE7C6uk1Bm580w32YhGVDBCO3qJeIvlDOZz8+80TfE8zW+WSwFGX+ck45q2vwm/ioqFX5pVsdW3D2I3Z+N7lf51DloBbeUSqsD1xA==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, wei.chen@xxxxxxx, Ian Jackson <iwj@xxxxxxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>
  • Delivery-date: Wed, 17 Nov 2021 11:52:41 +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;


> On 17 Nov 2021, at 11:10, Juergen Gross <jgross@xxxxxxxx> wrote:
> 
> On 17.11.21 10:57, Luca Fancellu wrote:
>> With the introduction of boot time cpupools, Xen can
>> create at boot time many cpupools different from the
>> cpupool with id 0.
>> Since these newly created cpupools can't have an
>> entry in Xenstore, name them with the same convention
>> used for the cpupool 0: Pool-<cpupool id>.
>> Signed-off-by: Luca Fancellu <luca.fancellu@xxxxxxx>
>> ---
>>  tools/libs/light/libxl_utils.c | 13 ++++++++-----
>>  1 file changed, 8 insertions(+), 5 deletions(-)
>> diff --git a/tools/libs/light/libxl_utils.c b/tools/libs/light/libxl_utils.c
>> index 4699c4a0a3..d97d91ca98 100644
>> --- a/tools/libs/light/libxl_utils.c
>> +++ b/tools/libs/light/libxl_utils.c
>> @@ -147,13 +147,16 @@ int libxl_cpupool_qualifier_to_cpupoolid(libxl_ctx 
>> *ctx, const char *p,
>>  char *libxl_cpupoolid_to_name(libxl_ctx *ctx, uint32_t poolid)
>>  {
>>      unsigned int len;
>> -    char path[strlen("/local/pool") + 12];
>> +    char buffer[strlen("/local/pool") + 12];
>>      char *s;
>>  -    snprintf(path, sizeof(path), "/local/pool/%d/name", poolid);
>> -    s = xs_read(ctx->xsh, XBT_NULL, path, &len);
>> -    if (!s && (poolid == 0))
>> -        return strdup("Pool-0");
>> +    snprintf(buffer, sizeof(buffer), "/local/pool/%d/name", poolid);
>> +    s = xs_read(ctx->xsh, XBT_NULL, buffer, &len);
>> +    if (!s)
>> +    {
>> +        snprintf(buffer, sizeof(buffer), "Pool-%d", poolid);
>> +        return strdup(buffer);
>> +    }
>>      return s;
>>  }
>>  
> 
> This breaks libxl_cpupoolid_is_valid(), as it will now return always
> true, regardless whether the poolid is existing or not.

Hi Juergen,

Yes right, do you think I can use safely xc_cpupool_getinfo(…) when there is no 
entry
in xenstore?
I would check that the returned cpupool id is the same and if it isn’t or if I 
get a null
result, then I will return NULL to ensure libxl_cpupoolid_is_valid(…) works 
again.

Cheers,
Luca

> 
> 
> Juergen
> <OpenPGP_0xB0DE9DD628BF132F.asc>




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.