Improve assert_homogeneous_vswitch_configuration on pool join

This assert only blocked openvswitch hosts to join bridge pool,
and not the other way around. According to the original commit
message, that was not the intention.

Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
networkd: make bridge_create less destructive

Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
networkd: move types and defaults to interface file

Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
networkd: rename restore_config fuctions to make_config and add non-conservative mode

Thus far, the restore_config functions were used only when networkd starts up,
to restore the cache configuration. This was done "conservatively", leaving
alone interfaces and bridges that were already configured, as well as non-
persistent bridges and interfaces.

This patch adds a "non-conservative" mode, and exposes the functions through
the interface, so they can be used more generally (e.g. by xapi).

Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
networkd: remove IP address when destroying a bridge to stop dhclient (if running)

Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
Use make_config to configure interfaces and bridges in Nm

Nm used to make call to the low-level networkd functions to create
and configure bridges and interfaces when "bringing up" a PIF.

Now, Nm essentially transforms the relevant bit of the xapi database
into a networkd configuration structure, which is passed into
Bridge.make_config and Interface.make_config. These two networkd
functions take care of setting things up in the right order, using the
same code that is used when the hosts starts up.

Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
Move mtu and ethtool settings for management interface outside create_bridges

Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
Do not depend on backend type in Nm

Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
Combine Bridge.destroy calls

Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
Split infrastructure setup and management IP configuration

This split is necessary for a future move to network driver domains, where
the infrastructure setup (configuring bridges and physical interfaces
etc.) should happen in the driver domains, while the IP addresses should
be configured in the domain where xapi is running.

Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
networkd: properly log failures in startup thread

Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
networkd: also configure physical interface on first boot

Mainly to set the default ethtool parameters.

Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
networkd: also (re)configure interfaces that are already up on startup

Only configuring interfaces that are not yet up when networkd starts
(which was done to not mess up any interfaces that may have been configured
by some other tool) does not work, because networkd also creates and brings
up interfaces as part of the bridge creation process that runs slightly
earlier.

Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
Implement the reading of the metrics with Linux Bridge and OVS.
Fix an off by 1.
Implement the alarm for status change of a bond.
Add a "links_up" field in Bond object.
CA-75708: Remove the 16MB limit on DB RPC responses.

Check the content length of responses to requests made by the database
RPC client; if the content length is greater than the maximum string
length then read the response into a Bigbuffer instead.

Signed-off-by: John Else <john.else@citrix.com>
Minor clean-ups
Improve alert message.

Signed-off-by: Jerome Maloberti <jerome.maloberti@citrix.com>