On 16/07/18 11:16, Roger Pau Monné wrote:
>
>> +
>> +    sysctl.cmd = XEN_SYSCTL_get_cpu_policy;
>> +    sysctl.u.cpu_policy.index = index;
>> +    sysctl.u.cpu_policy.nr_leaves = *nr_leaves;
>> +    set_xen_guest_handle(sysctl.u.cpu_policy.cpuid_policy, leaves);
>> +    sysctl.u.cpu_policy.nr_msrs = *nr_msrs;
>> +    set_xen_guest_handle(sysctl.u.cpu_policy.msr_policy, msrs);
> sysctl can be initialized at declaration time instead of zeroing it
> and then setting the fields:
>
> struct xen_sysctl sysctl = {
>     .cmd = XEN_SYSCTL_get_cpu_policy;
>     .u.cpu_policy.index = index;
>     .u.cpu_policy.nr_leaves = *nr_leaves;
>     ...
> };

This doesn't compile in a CentOS 6 era GCC.  It can't cope with
initialisers of anonymous unions, and is the reason why a lot of the
toolstack logic is in the form presented in this patch, rather than the
cleaner option you present.

~Andrew

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

Reply via email to