Enforce function declaration format in bash8

Check that function calls look like ^function foo {$ in bash8, and fix
all existing failures of that check.  Add a note to HACKING.rst

Change-Id: Ic19eecb39e0b20273d1bcd551a42fe400d54e938
diff --git a/tools/xen/build_xva.sh b/tools/xen/build_xva.sh
index fbbfd6f..cc3cbe1 100755
--- a/tools/xen/build_xva.sh
+++ b/tools/xen/build_xva.sh
@@ -42,7 +42,7 @@
 #
 GUEST_NAME="$1"
 
-function _print_interface_config() {
+function _print_interface_config {
     local device_nr
     local ip_address
     local netmask
@@ -68,7 +68,7 @@
     echo "  post-up ethtool -K $device tx off"
 }
 
-function print_interfaces_config() {
+function print_interfaces_config {
     echo "auto lo"
     echo "iface lo inet loopback"
 
diff --git a/tools/xen/install_os_domU.sh b/tools/xen/install_os_domU.sh
index 7b59bae..a4b3e06 100755
--- a/tools/xen/install_os_domU.sh
+++ b/tools/xen/install_os_domU.sh
@@ -166,7 +166,7 @@
 SNAME_TEMPLATE="jeos_snapshot_for_devstack"
 SNAME_FIRST_BOOT="before_first_boot"
 
-function wait_for_VM_to_halt() {
+function wait_for_VM_to_halt {
     set +x
     echo "Waiting for the VM to halt.  Progress in-VM can be checked with vncviewer:"
     mgmt_ip=$(echo $XENAPI_CONNECTION_URL | tr -d -c '1234567890.')
@@ -318,7 +318,7 @@
 #
 xe vm-start vm="$GUEST_NAME"
 
-function ssh_no_check() {
+function ssh_no_check {
     ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no "$@"
 }
 
@@ -349,7 +349,7 @@
 xenstore-write /local/domain/$DOMID/authorized_keys/$DOMZERO_USER "$(cat /root/dom0key.pub)"
 xenstore-chmod -u /local/domain/$DOMID/authorized_keys/$DOMZERO_USER r$DOMID
 
-function run_on_appliance() {
+function run_on_appliance {
     ssh \
         -i /root/dom0key \
         -o UserKnownHostsFile=/dev/null \
diff --git a/tools/xen/prepare_guest.sh b/tools/xen/prepare_guest.sh
index 0946126..440774e 100755
--- a/tools/xen/prepare_guest.sh
+++ b/tools/xen/prepare_guest.sh
@@ -21,7 +21,7 @@
 DOMZERO_USER="$4"
 
 
-function setup_domzero_user() {
+function setup_domzero_user {
     local username
 
     username="$1"