run_qemu.sh: Use 'pvmfw' instead of 'template'

Rename all variables using variations of 'template' to use the current
terminology ('pvmfw').

Change-Id: Ia7e72aa9614f18491c7a1b241703e90adfbe4ec4
diff --git a/aarch64/run_qemu.sh b/aarch64/run_qemu.sh
index ed99af3..88b0e6a 100755
--- a/aarch64/run_qemu.sh
+++ b/aarch64/run_qemu.sh
@@ -20,7 +20,7 @@
 default_var ROM_DIR		"${PREBUILTS_QEMU_ROM_DIR}"
 default_var KERNEL		"${LINUX_OUT_IMAGE}"
 default_var ROOTFS		"${PREBUILTS_KUT_ROOTFS}"
-default_var TEMPLATE		""
+default_var PVMFW		""
 default_var CPU			""
 default_var SMP			2
 default_var RAM			512
@@ -44,7 +44,7 @@
 	cat <<EOF
 
 Usage: $0 [-h] [-v] [-K]
-       [-e QEMU] [-L ROM_DIR] [-k KERNEL] [-r ROOTFS] [-R DRIVE] [-F TEMPLATE]
+       [-e QEMU] [-L ROM_DIR] [-k KERNEL] [-r ROOTFS] [-R DRIVE] [-F PVMFW]
        [-c CPU] [-s NUM_CPUS] [-m MEM] [-g GIC] [-M KVM_MODE] [-G]
        [-t TIMEOUT] [-a APPEND]
 
@@ -55,7 +55,7 @@
     -k    kernel image
     -r    root filesystem image
     -R    additional drive image(s) to mount as read-only
-    -F    VM template image
+    -F    pvmfw image
     -c    CPU model (defaults to "${DEFAULT_CPU}")
     -s    number of CPU cores (defaults to ${DEFAULT_SMP})
     -m    amount of memory in MB (defaults to ${DEFAULT_RAM})
@@ -89,7 +89,7 @@
 	printf "%${2-#}x\n" $1
 }
 
-function template_overlay() {
+function pvmfw_overlay() {
 	local in="$1"
 	local out="$2"
 	local tmp="$3"
@@ -99,7 +99,7 @@
 	# Convert input DTB back to source.
 	${DTC} -I dtb -O dts -o "${tmp}" "${in}"
 
-	# Append an overlay describing the template.
+	# Append an overlay describing the pvmfw.
 	cat <<EOF >> "${tmp}"
 &{/} {
 	pkvm_template@${addr} {
@@ -126,7 +126,7 @@
 	k)	KERNEL="${OPTARG}"		;;
 	r)	ROOTFS="${OPTARG}"		;;
 	R)	EXTRA_RO_MOUNTS+=("${OPTARG}")	;;
-	F)	TEMPLATE="${OPTARG}"		;;
+	F)	PVMFW="${OPTARG}"		;;
 	c)	CPU="${OPTARG}"			;;
 	s)	SMP="${OPTARG}"			;;
 	m)	RAM="${OPTARG}"			;;
@@ -212,7 +212,7 @@
 
 CMD+=(-append "${APPEND[*]}")
 
-if [ -n "${TEMPLATE}" ]; then
+if [ -n "${PVMFW}" ]; then
 	QEMU_DTB="$(mktemp)"
 	QEMU_PATCHED_DTB="$(mktemp)"
 	TMP_DTS="$(mktemp)"
@@ -224,23 +224,23 @@
 	"${CMD[@]}" -machine dumpdtb="${QEMU_DTB}" > /dev/null
 
 	# Compile the overlayed DTB with dummy values to determine its size.
-	template_overlay "${QEMU_DTB}" "${QEMU_PATCHED_DTB}" "${TMP_DTS}" 0x0 0x0
+	pvmfw_overlay "${QEMU_DTB}" "${QEMU_PATCHED_DTB}" "${TMP_DTS}" 0x0 0x0
 	TMP_DTB_SIZE=$(file_size "${QEMU_PATCHED_DTB}")
 
 	# From QEMU's hw/arm/boot.c:
 	# RAM always starts at 1GiB PA offset. The kernel is placed there.
 	# 128MiB (or RAM/2 if RAM<256MiB) is left to the kernel to decompress.
 	# This is followed by the ramdisk and then 2MiB-aligned DTB.
-	# We place the template at the following page (assume 64KiB page size).
-	TEMPLATE_ADDR=$(( 1*GiB + 128*MiB + TMP_DTB_SIZE ))
-	TEMPLATE_ADDR=$(hex $(align_up_pow2 $TEMPLATE_ADDR 64*KiB))
-	TEMPLATE_SIZE=$(hex $(file_size "${TEMPLATE}"))
+	# We place the pvmfw at the following page (assume 64KiB page size).
+	PVMFW_ADDR=$(( 1*GiB + 128*MiB + TMP_DTB_SIZE ))
+	PVMFW_ADDR=$(hex $(align_up_pow2 ${PVMFW_ADDR} 64*KiB))
+	PVMFW_SIZE=$(hex $(file_size "${PVMFW}"))
 
-	template_overlay "${QEMU_DTB}" "${QEMU_PATCHED_DTB}" "${TMP_DTS}" \
-			 "${TEMPLATE_ADDR}" "${TEMPLATE_SIZE}"
+	pvmfw_overlay "${QEMU_DTB}" "${QEMU_PATCHED_DTB}" "${TMP_DTS}" \
+			 "${PVMFW_ADDR}" "${PVMFW_SIZE}"
 
 	CMD+=(-dtb "${QEMU_PATCHED_DTB}")
-	CMD+=(-device loader,file="${TEMPLATE}",addr=${TEMPLATE_ADDR},force-raw=true)
+	CMD+=(-device loader,file="${PVMFW}",addr=${PVMFW_ADDR},force-raw=true)
 fi
 
 if [ "${VERBOSE}" -eq 1 ]; then