From 04f503477ced16176f7db24f363e6378c2ac528b Mon Sep 17 00:00:00 2001 From: Stefano Stabellini Date: Fri, 30 Oct 2020 15:55:23 -0700 Subject: Add DOMU_MEM and DOMU_VCPUS Add two new config file parameters to configure the amount of memory and the number of vcpus of dom0less VMs. Signed-off-by: Stefano Stabellini Reviewed-by: Brian Woods --- scripts/uboot-script-gen | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/uboot-script-gen b/scripts/uboot-script-gen index f176e1a..ef26da1 100755 --- a/scripts/uboot-script-gen +++ b/scripts/uboot-script-gen @@ -86,8 +86,8 @@ function device_tree_editing() echo "fdt set /chosen/domU$i compatible \"xen,domain\"" >> $UBOOT_SOURCE echo "fdt set /chosen/domU$i \#address-cells <0x2>" >> $UBOOT_SOURCE echo "fdt set /chosen/domU$i \#size-cells <0x2>" >> $UBOOT_SOURCE - echo "fdt set /chosen/domU$i memory <0x0 0x40000>" >> $UBOOT_SOURCE - echo "fdt set /chosen/domU$i cpus <0x1>" >> $UBOOT_SOURCE + echo "fdt set /chosen/domU$i memory <0x0 "${DOMU_MEM[$i]}">" >> $UBOOT_SOURCE + echo "fdt set /chosen/domU$i cpus <"${DOMU_VCPUS[$i]}">" >> $UBOOT_SOURCE echo "fdt set /chosen/domU$i vpl011 <0x1>" >> $UBOOT_SOURCE add_device_tree_kernel "/chosen/domU$i" ${domU_kernel_addr[$i]} ${domU_kernel_size[$i]} if test "${domU_ramdisk_addr[$i]}" @@ -279,6 +279,20 @@ then DOM0_CMD="$DOM0_CMD root=/dev/sda2" fi fi +i=0 +while test $i -lt $NUM_DOMUS +do + if test -z "${DOMU_MEM[$i]}" + then + DOMU_MEM[$i]=512 + fi + DOMU_MEM[$i]=$((${DOMU_MEM[$i]} * 1024)) + if test -z "${DOMU_VCPUS[$i]}" + then + DOMU_VCPUS[$i]=1 + fi + i=$(( $i + 1 )) +done # the cd is needed so that the relative paths will match once we use # tftp or move the files to a partition -- cgit v1.2.3