CP-6167: The xenbuilder chroot env has no /dev/tty

It seems that the xenbuilder chroot env doesn't have /dev/tty. So in
the build log, we saw "tee: /dev/tty: No such device or address"

This is strangely different from the local chroot testing env I
created using standard xenbuilder command "make sm-chroot" when
doing test.

This quick fix avoids using the "tee /dev/tty" trick and do it in
a plain/verbose way.

Signed-off-by: Zheng Li <zheng.li@eu.citrix.com>
Reviewed-by: Vineeth Thampi Raveendran <vineeth.thampi@citrix.com>
SCTX-1536: Don't trust the footer

Don't use the primary VHD footer for file-based VHD VDIs that are
attached in R/W mode because it has been erased. Use the back-up one
instead.

Signed-off-by: Thanos Makatos <thanos.makatos@citrix.com>
Reviewed-by: Keith Petley <keith.petley@citrix.com>

GitHub: closes #35 on xapi-project/sm
[CP-6333][CP-6334]: rm dm-multipath-dm-event, dm-multipath-disable-udev-rules

This patch is the counterpart of 2 patches removed in
dm-multipath (formerly dm-multipath in guest-packages.hg):
- dm-multipath-disable-udev-rules
- dm-multipath-dm-event

This patch basically does the following:
- ship and override multipath udev rules from sm RPM
- add rules to invoke mpathcount from udev

Note: for udev to catch the relevant events, the kernel must have
      DM_UEVENT enabled

Signed-off-by: Germano Percossi <germano.percossi@citrix.com>
Reviewed-by: Vineeth Thampi Raveendran <vineeth.thampi@citrix.com>

GitHub: closes #40 on xapi-project/sm
CA-111813: race condition setting "iscsi_sessions" in other_conf

This changeset basically reinstate previous code,
backing out "changeset:   1555:ac091775c8ea" in the Mercurial
repository.
To be safe, we remove the key before adding, just in case.

Signed-off-by: Germano Percossi <germano.percossi@citrix.com>
Reviewed-by: Vineeth Thampi Raveendran <vineeth.thampi@citrix.com>

GitHub: closes #41 on xapi-project/sm
CP-5050: Notify XAPI about critical coalesce errors

The rate XAPI is notified is throttled to avoid spamming (currently
defaults to one message per hour, per SR). This rate can be overridden
by setting the "coalesce-error-rate" key in an SR's other-config.

Signed-off-by: Thanos Makatos <thanos.makatos@citrix.com>
Suggested-by: Andrei Lifchits <andrei.lifchits@citrix.com>
Reviewed-by: Germano Percossi <germano.percossi@citrix.com>

GitHub: closes #38 on xapi-project/sm
CA-106886: Don't update vhd-blocks during SR.scan

Don't bother updating the vhd-blocks in the XAPI database as this is
owned by the GC and there's no synchronisation for this.

Signed-off-by: Thanos Makatos <thanos.makatos@citrix.com>
Reviewed-by: Vineeth Thampi Raveendran <vineeth.thampi@citrix.com>

GitHub: closes #37 on xapi-project/sm
CP-6335: Removal of dm-multipath-init patch

This functionality has stopped being a patch to upstream
multipath and it is shipped in its own startup script
provided by sm RPM

Signed-off-by: Germano Percossi <germano.percossi@citrix.com>
Reviewed-by: Vineeth Thampi Raveendran <vineeth.thampi@citrix.com>

GitHub: closes #42 on xapi-project/sm