[pve-devel] [PATCH cluster v2 8/8] api: join/add: generalize and allow all knet links
Thomas Lamprecht
t.lamprecht at proxmox.com
Thu Jun 13 08:36:06 CEST 2019
On 6/12/19 4:35 PM, Fabian Grünbichler wrote:
>> - # FIXME: handle all links (0-7), they're all independent now
>> - $link0->{address} //= $name if exists($totem_cfg->{interface}->{0});
>> + for my $id (keys %{$totem_cfg->{interface}}) {
>> + die "corosync: totem interface with linknumber $id configured but 'link$id' parameter not defined!\n"
>> + if !defined($links->{id});
>> + }
>>
>> - die "corosync: using 'link1' parameter needs a interface with linknumber '1' configured!\n"
>> - if $link1 && !defined($totem_cfg->{interface}->{1});
>> -
>> - die "corosync: totem interface with linknumber 1 configured but 'link1' parameter not defined!\n"
>> - if defined($totem_cfg->{interface}->{1}) && !defined($link1);
>> + $links->{0}->{address} //= $name if exists($totem_cfg->{interface}->{0});
> this is very confusing in combination with the code above - maybe we
> should make address non-optional, and to get the behaviour of "just
> choose the local node's IP as link0" the user/caller passes no linkX at
> all? probably causes some churn in the other patches unfortunately, but
> to me it seems like having a link parameter but no address only makes
> sense in this one special case..
>
default keys in JSONSchema formats are _always_ non-optional,
making them optional does not make sense (I tried once quite a
while ago, besides that it really does not fully works, it also
makes no sense, if one looks at it closer).
But, the fallback needs to be moved higher up, before the check
which loops over the configured interfaces in the cluster to see
if all required links were specified, then that part should be OK.
More information about the pve-devel
mailing list