md_monitor: fix uninitialized variable 'do_fail'

The compiler complained about an unitialized variable 'do_fail'.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Testcases: update activate_dasds()

Update activate_dasds() function to format and partition
DASDs as required. Also remove the need to specify the
disks to be activated with the individual testcases.

Signed-off-by: Hannes Reinecke <hare@suse.de>
testcases: Do not specify bitmap chunk size

The bitmap chunk size depends on the number of disks, so any
specified number might be too large. So remove the parameter
and let mdadm pick a size.

Signed-off-by: Hannes Reinecke <hare@suse.de>
monitor_testcase_1: Print logging message on array stop

When the array is stopped we should be printing out
a logging message and not just the error output from
md_monitor.

Signed-off-by: Hannes Reinecke <hare@suse.de>
monitor_testcase_3: Fixup for new layout

The list of device numbers is now dynamically generated,
so make sure it's exported.

Signed-off-by: Hannes Reinecke <hare@suse.de>
monitor_testcase_4: Update for more than 10 devices

The used regular expressions had a typo which prevented
them to work correctly with more than 10 devices.

Signed-off-by: Hannes Reinecke <hare@suse.de>
monitor_testcase_5: Rename to testcase 12

This is just an extension of an existing testcase, so rename it.

Signed-off-by: Hannes Reinecke <hare@suse.de>
md_monitor: Update man page

Some states for MirrorStatus were missing and not all CLI
commands had been documented. Plus some minor formatting
issues.

References: bnc#772163

Signed-off-by: Hannes Reinecke <hare@suse.de>
md_monitor: Document version in manual page

Include the most current md_monitor version number in the man page.

Signed-off-by: Hannes Reinecke <hare@suse.de>
md_monitor: Reshuffle pthread_attribute handling

Reshuffle pthread_attr_init et al to avoid memory leaks.

References: bnc#819725

Signed-off-by: Hannes Reinecke <hare@suse.de>
md_monitor: simplify reference counting

We should always decrease the reference. This allows us
to check for a possible use-after-free scenario.

References: bnc#819725

Signed-off-by: Hannes Reinecke <hare@suse.de>
md_monitor: use dasd_monitor_put() on shutdown

We need to use dasd_monitor_put() on shutdown, otherwise we'll
free up structures which are still in use.

References: bnc#819725

Signed-off-by: Hannes Reinecke <hare@suse.de>
md_monitor: remove udev device reference for dasd_monitor_thread()

The structure already took a reference, no need to keep them
twice.

Signed-off-by: Hannes Reinecke <hare@suse.de>