On Thu, 4 May 2017 13:40:18 +0200
Andrew Jones <[email protected]> wrote:
[...]
> > +void machine_set_cpu_numa_node(MachineState *machine,
> > + CpuInstanceProperties *props, Error **errp)
> > +{
[...]
> > + }
> > +
> > + /* skip slots with explicit mismatch */
> > + if (props->has_thread_id && props->thread_id !=
> > slot->props.thread_id) {
> > + continue;
> > + }
> > +
> > + if (props->has_core_id && props->core_id != slot->props.core_id) {
> > + continue;
> > + }
> > +
> > + if (props->has_socket_id && props->socket_id !=
> > slot->props.socket_id) {
> > + continue;
> > + }
>
> nit: above 3 if-conditions could be condensed into 1 compound condition
this reduces number of lines but result is a bit ugly due to 80chr/line limit:
/* skip slots with explicit mismatch */
if ((props->has_thread_id &&
props->thread_id != slot->props.thread_id) ||
(props->has_core_id && props->core_id != slot->props.core_id) ||
(props->has_socket_id && props->socket_id != slot->props.socket_id)
) {
continue;
}
do you still want the change?