On 2/18/21 6:48 AM, Roger Pau Monné wrote:
>
>> + /* Get the domain's default policy. */
>> + nr_leaves = 0;
>> + rc = xc_get_system_cpu_policy(xch, di.hvm ?
>> XEN_SYSCTL_cpu_policy_hvm_default
>> + :
>> XEN_SYSCTL_cpu_policy_pv_default,
>> + &nr_leaves, NULL, &nr_msrs, msrs);
>> + if ( rc )
>> + {
>> + PERROR("Failed to obtain %s default policy", di.hvm ? "hvm" : "pv");
>> + rc = -errno;
>> + goto out;
>> + }
> Why not use xc_get_domain_cpu_policy instead so that you can avoid the
> call to xc_domain_getinfo?
Yes, indeed.
-boris
>
> It would also seem safer, as you won't be discarding any adjustments
> made to the default policy by the hypervisor for this specific domain.
>
> Thanks, Roger.