This adds three methods to hardware fencing related functions:
* read_fence_config
* fencing_mode
* exec_fence_agent
'read_fence_config' allows to create a common code base between the
real world and the test/sim world regarding fencing a bit easier.
In PVE2 it parses the config from /etc/pve/ha/fence.cfg and in
the Sim method it parses the config from testdir/status/fence.cfg.
The 'fencing_mode' method checks respective to the callee's
environment if hardware fencing is enabled and returns the wanted
mode:
* PVE2: if the datacenter.cfg key 'fencing' is set then it will be
used, else we use 'watchdog' as default.
* Sim: if the cfg exist and at least one device is configured we use
'hardware' fencing, else we default to 'watchdog'.
For the simulator we should make also a option to turn HW fencing
off and on independent if devices are configured when we implement
HW fencing for it, but that is not really needed for now.
'exec_fence_agent' executes, as the name suggests, environment
specific a fence agent.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>