lnst-ctl: Rearranging Help

The help message was stuffed into a too small space. I made the lines
longer and also arranged the options in an alphabetical order.

Signed-off-by: Radek Pazdera <rpazdera@redhat.com>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
README: Renaming and Updating the Readme File

In order to parse them correctly, GitHub requires a *.md extension to
the readme file. I also updated some information in the README.

Signed-off-by: Radek Pazdera <rpazdera@redhat.com>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
man-pages: Updating CLI Options and Links

The URL's was changed from fedorahosted to GitHub in both pages. Apart
from that I updated CLI options description on the lnst-ctl page
(Issue #5) and also added a description of return values (Issue #24).

Signed-off-by: Radek Pazdera <rpazdera@redhat.com>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
SlavePool: fix copy-paste error

I forgot to change the parameters to a function call that I copied from
a different function. This commit fixes that.

Signed-off-by: Ondrej Lichtner <olichtne@redhat.com>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
Machine: ensure virt device cleanup

This commit ensures that virtual devices are cleaned up even when the
slave connection was lost. They won't be cleaned up when the deconfigure
parameter is set to false - this happens when lnst-ctl is run with
config_only.

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

This commit adds cleanup to some places that it makes sense and it
wasn't done previously. Mainly when there are errors during
configuration the already configured parts will be cleaned up.

Another case that didn't work properly was when lnst was interrupted
by Ctrl-C during configuration.

Signed-off-by: Ondrej Lichtner <olichtne@redhat.com>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
NetTestController: allow config_only for virtualized machines

This commit enables config_only functionality for virtualized machines.
This didn't work previously because the dynamically created devices
would be removed. This was needed because there was no way to store this
information between lnst-ctl runs.

Now the information is pickled and stored in a file /tmp/.lnst_virt_conf
this file is then detected on the next NetTestController object creation
(when the next recipe is being executed), and the configuration is
reversed removing interfaces, bridges, iptables rules and calling
machine_cleanup on slaves.

There are also a few helper get/set methods added in this commit.

Signed-off-by: Ondrej Lichtner <olichtne@redhat.com>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
Fix nested xinclude element bug

I found a bug where xinclude preprocessing works only for elements that
are direct children of lnstrecipe tag. If an xinclude is nested deeper
in the structure it won't be resolved. This patch adds one more
recursion to process xincludes in deeper levels.

Signed-off-by: Jan Tluka <jtluka@redhat.com>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>