InterfaceManager: deconfigure masters before slaves

The device class now reads the IFLA_MASTER attribute (recieved through
netlink) of the device. This is later used to deconfigure masters before
deconfiguring slaves.

Signed-off-by: Ondrej Lichtner <olichtne@redhat.com>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
NetTestController: cleanup of saved configuration waits for results

When cleaning up a saved configuration the controller will wait for a
result message from the slave when calling the "machine_cleanup" method.
Without this the controller would sometimes remove the virtual devices
before the slave had the time to deconfigure them which will cause an
exception on the slave.

Signed-off-by: Ondrej Lichtner <olichtne@redhat.com>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
Machine: fix static interface mapping

When reimplementing the slave configuration I changed the way how static
interfaces are initialized on the controller. This would work fine, but
I also removed a helpful error report. This commit fixes that.

Signed-off-by: Ondrej Lichtner <olichtne@redhat.com>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
NetTestSlave: fix cleanup

This commit removes the state variable _ctl_clean_exit. The original
idea was to use this variable to differentiate between the config_only
controller run from a controller crash/disconnection. However this posed
more problems than it solved so now the slave will simply do a complete
machine cleanup every time the "hello" method is called or when the
slave is terminated.

Signed-off-by: Ondrej Lichtner <olichtne@redhat.com>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
NetTestSlave: rescan devices on hello

There seems to be a bug on older kernels (2.6.32 in RHEL6.5) that
results in the RTM_NEWLINK netlink message being sent after the
RTM_DELLINK message when a device is removed. This causes the slave to
first delete the device from the database and subsequently add it again
even though it doesn't exist in the kernel anymore. Newer kernels don't
have this problem.

This commit fixes the behaviour by adding a call of the rescan_devices
method to the "hello" method. I also made the rescan_devices method
public.

Signed-off-by: Ondrej Lichtner <olichtne@redhat.com>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>