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

Re: [PATCH 5/7] tools: Modify single-domid callers of xc_domain_getinfolist


  • To: Alejandro Vallejo <alejandro.vallejo@xxxxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Thu, 27 Apr 2023 12:14:25 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.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=Du775kTpuiYYRdC1MCLtJ7Y1tKccXrPTqxmMH3KH9CI=; b=WRY5rJxaUeUxtxbB++p9obR5MN9u1jZgXBITCI3931YpAEQXPVJ9MpMqXLAcfBjwnPdIwI8SjQOzu13zV22qcGuZg7hmg7H+wa3NyWMKQIiB46v2LA81lKmxRIq9V6JdmmDgOr2gZSl++1zJg3LlrN0aQ6hdN+DA8M/2aQLGnxSd0TMrfSo2DGPvfZgKiP5Dqn7nsSJJ0uQP4uKRGm4Q9mkZgXeQXDC5qpsgLdFDGrfOMb9LwmKouZod5+xXVLPtFcLxJoc0DJ74c8zx8vVokA7W7gbnypUKU3ynkNzSrzd10/DJzM/ufhDOFLJtN4qE4IPTDnNedjYMcx9QC2a0Fg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=C+/auSI0ESX4LY7afQeG2xiH+7XxbVvN/YAYGD13JyNTpeWmXEpHYUxhld6/5ubsru7Ach3lF2JCZbr+OwuYFiUeYaKKKBgWUnF5YXatAtqeOg6L8u5I2kC0ZKjYr30LX/8j0iSCrEFlQgW4sNKUXzH+aBYwRQCwZQT4EmKwGuV7FwLXCB0O8BhBEKYBJL5Lhkj3ufmpl4A5mxeCHGOI+ox5M15ErvrbTX8/j7+o3XHO9OCek19cPzTxmXgojMvLe3dkKKcUk/GCgjoWmxFty437QKnXpIHsqRFn2imTFtVDO2LFgvJgPH1wIbzGInDI5w9rvh3xNfmtxvDHsZflhQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: Wei Liu <wl@xxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>
  • Delivery-date: Thu, 27 Apr 2023 11:14:56 +0000
  • Ironport-data: A9a23:Ojwpkq8Bf/rcoOpKQSS8DrUDQX+TJUtcMsCJ2f8bNWPcYEJGY0x3m mcdDTqBO6mKNjfxftF0bYq0oUsOvZ/Rz942SlA/rXw8E34SpcT7XtnIdU2Y0wF+jCHgZBk+s 5hBMImowOQcFCK0SsKFa+C5xZVE/fjUAOG6UKicYXoZqTZMEE8JkQhkl/MynrlmiN24BxLlk d7pqojUNUTNNwRcawr40Ire7kI+1BjOkGlA5AdmOaoU5AW2e0Q9V/rzG4ngdxMUfaEMdgKKb 76r5K20+Grf4yAsBruN+losWhRXKlJ6FVHmZkt+A8BOsDAbzsAB+v9T2M4nQVVWk120c+VZk 72hg3ASpTABZcUgkMxFO/VR/roX0aduoNcrKlDn2SCfItGvn9IBDJyCAWlvVbD09NqbDkl+9 t5EAywUUSmnoLqq272qWOdl3eQKeZyD0IM34hmMzBn/JNN/GdXmfP+P4tVVmjAtmspJAPDSI dIDbiZiZwjBZBsJPUoLDJU5n6GjgXyXnz9w8QrJ4/ZopTWOilUpidABM/KMEjCObexTklyVu STt+GPhDwtBHNee1SCE4jSngeqncSbTAdpPROfnqK426LGV7nALMBg5exj4m8eSt1PgV9FVL 24O1iV7+MDe82TuFLERRSaQqXqJvBcaV8BXVfMz7AWAyK386AKeG2RCRTlEAPQ2uclzSTE02 1uhm9LyGScpoLCTUWia9LqfsXW1Iyd9BXAGTT8JS00C+daLiIM8lBXUVf54DbW4yNbyHFnNL yuiqSE/g/AWkpQN3qDipVTf2Wv0/97OUxI/4RjRUiS99ARlaYW5Zouur1/G8fJHK4XfRV6E1 JQZp/WjACk1JcnlvESwrC8lRe3BCyqtWNEEvWNSIg==
  • Ironport-hdrordr: A9a23:j/AJrKOet01afcBcTtCjsMiBIKoaSvp037BL7S1MoHluGaalfq +V7ZcmPGDP+VQssR0b9+xoW5PtfZq/z/5ICOAqVN+ftWLd11dAQrsC0WLq+UyEJxHD
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 26/04/2023 3:59 pm, Alejandro Vallejo wrote:
> diff --git a/tools/libs/light/libxl_dom.c b/tools/libs/light/libxl_dom.c
> index 25fb716084..482e04b38c 100644
> --- a/tools/libs/light/libxl_dom.c
> +++ b/tools/libs/light/libxl_dom.c
> @@ -70,15 +70,10 @@ int libxl__domain_cpupool(libxl__gc *gc, uint32_t domid)
>      xc_domaininfo_t info;
>      int ret;
>  
> -    ret = xc_domain_getinfolist(CTX->xch, domid, 1, &info);
> -    if (ret != 1)
> +    ret = xc_domain_getinfo_single(CTX->xch, domid, &info);
> +    if (ret < 0)
>      {
> -        LOGE(ERROR, "getinfolist failed %d", ret);
> -        return ERROR_FAIL;
> -    }
> -    if (info.domain != domid)
> -    {
> -        LOGE(ERROR, "got info for dom%d, wanted dom%d\n", info.domain, 
> domid);
> +        LOGE(ERROR, "getinfo_single failed %d", ret);

These are vaguely for human consumption.  This one wants to be

LOGED(ERROR, domid, "get dominfo failed: %d", ret);

I think.  (This code quite possibly predates LOGED() being introduced.)

> diff --git a/tools/libs/light/libxl_domain.c b/tools/libs/light/libxl_domain.c
> index 7f0986c185..33ac8e9ce8 100644
> --- a/tools/libs/light/libxl_domain.c
> +++ b/tools/libs/light/libxl_domain.c
> @@ -349,16 +349,12 @@ int libxl_domain_info(libxl_ctx *ctx, libxl_dominfo 
> *info_r,
>      int ret;
>      GC_INIT(ctx);
>  
> -    ret = xc_domain_getinfolist(ctx->xch, domid, 1, &xcinfo);
> +    ret = xc_domain_getinfo_single(ctx->xch, domid, &xcinfo);
>      if (ret<0) {
> -        LOGED(ERROR, domid, "Getting domain info list");
> +        LOGED(ERROR, domid, "Getting domain info single");

Swapping list for single really isn't very helpful here.  "Getting
domain info" would be better than either of these, but all of these
ought to be updated to print ret, because right now I don't think
there's any qualifying information.

Interpreting -ESRCH is the important thing here, because that's the
common "your domain doesn't (/no longer) exists" case.

> diff --git a/tools/xenpaging/xenpaging.c b/tools/xenpaging/xenpaging.c
> index 6e5490315d..023f2bf295 100644
> --- a/tools/xenpaging/xenpaging.c
> +++ b/tools/xenpaging/xenpaging.c
> @@ -169,10 +169,10 @@ static int xenpaging_get_tot_pages(struct xenpaging 
> *paging)
>      xc_domaininfo_t domain_info;
>      int rc;
>  
> -    rc = xc_domain_getinfolist(xch, paging->vm_event.domain_id, 1, 
> &domain_info);
> -    if ( rc != 1 )
> +    rc = xc_domain_getinfo_single(xch, paging->vm_event.domain_id, 
> &domain_info);
> +    if ( rc < 0 )
>      {
> -        PERROR("Error getting domain info");
> +        PERROR("Error getting domain info single");

These messages I'd just be tempted to leave as-are.  xenpaging hasn't
left experimental status...

~Andrew



 


Rackspace

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