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

Re: [Xen-devel] [PATCH v2 12/13] x86/sysctl: Implement XEN_SYSCTL_get_cpu_policy



>>> On 16.07.18 at 12:58, <andrew.cooper3@xxxxxxxxxx> wrote:
> 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.

But where's the anonymous union here? Such shouldn't be used in the
public headers anyway.

Jan


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

 


Rackspace

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