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

Re: [PATCH v2 20/21] libs/{light,guest}: implement xc_cpuid_apply_policy in libxl


  • To: Roger Pau Monne <roger.pau@xxxxxxxxxx>
  • From: Anthony PERARD <anthony.perard@xxxxxxxxxx>
  • Date: Wed, 28 Apr 2021 17:19:50 +0100
  • Authentication-results: esa1.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Ian Jackson <iwj@xxxxxxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Wed, 28 Apr 2021 16:20:13 +0000
  • Ironport-hdrordr: A9a23:fFsx+6zAmPR9uzfeHmI8KrPw5b1zdoIgy1knxilNYDZSddGVkN 3roeQD2XbP+VQscVwphNzoAse9aFzG85od2+gsFJekGDLroW65aLxlhLGP/xTFOwnTstFQzr 1hda8WMrLNJHx3l9zz7gX9M/tI+rm62Zulj+vf0HthJDsCA8pdxjx0EwOKVnBxLTMtObMCCJ Ge6sBbzgDQGkg/U8LTPBQ4Y9Q=
  • Ironport-sdr: Ue+jQdC6130Paog5bfm6Im+/tDkchCcOnM8EUptCulEHyQ0NDeoRyyWA6qIYBjGROZX8oYkrGK 7rs9rPKKRkdgb433K45GA8URa6Q9A/09S1AhhwQY3Jm02F+mcRayEdmm5M95xHh28fg2fgc2FR 9mGw/HDzQ1cnsCdETkVM3xYgstR2EpVofRv8NMSU3Fpw56QTz+Y3h0Tavv2w6rbCf/3vrwDfwc rTbVrgq2njcXKUeenL7XE7G0Sz6zy250+GA/JjwQh1gMwJLElBrnlAed21PpXogaG8R6Fmu8wz XqQ=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Tue, Apr 13, 2021 at 04:01:38PM +0200, Roger Pau Monne wrote:
> diff --git a/tools/libs/light/libxl_cpuid.c b/tools/libs/light/libxl_cpuid.c
> index 539fc4869e6..cadc8b2a05e 100644
> --- a/tools/libs/light/libxl_cpuid.c
> +++ b/tools/libs/light/libxl_cpuid.c
> @@ -436,6 +438,42 @@ int libxl__cpuid_legacy(libxl_ctx *ctx, uint32_t domid, 
> bool restore,
>       */
>      bool nested_virt = info->nested_hvm.val > 0;
>  
> +    policy = xc_cpu_policy_init();
> +    if (!policy) {
> +        LOGE(ERROR, "Failed to init CPU policy");
> +        rc = ERROR_FAIL;
> +        goto out;
> +    }
> +
> +    rc = xc_cpu_policy_get_domain(ctx->xch, domid, policy);

libxc return values should be stored in 'r'.

> +    if (rc) {
> +        LOGE(ERROR, "Failed to fetch domain %u CPU policy", domid);

It's probably better to use LOGED(ERROR, domid, ...)  to log the domid.
libvirt might be able to use that domid information, but I'm not sure
about that. At least, using LOG*D macros would make logging the domid
consistent with the rest of libxl.

Also use the LOG*D variant for other LOG*, to record the domid
every time.

> +        rc = ERROR_FAIL;
> +        goto out;
> +    }
> +
> +    /*
> +     * Account for feature which have been disabled by default since Xen 
> 4.13,

Why the 's' from "features" has been removed? Also, if it must be
removed then I'm pretty sure that we should also change "have been"
to "has been".


Thanks,

-- 
Anthony PERARD



 


Rackspace

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