From 1429996890aa20d5d9c62f0cacfc95209ea142d5 Mon Sep 17 00:00:00 2001 From: ged Date: Fri, 21 Jun 2019 14:29:30 -0400 Subject: [PATCH] [TOOLS] Dynamically replace machine type with highest supported QEMU version. --- make.sh | 3 ++- tools/template.xml.in | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/make.sh b/make.sh index e036acc..11eec8f 100755 --- a/make.sh +++ b/make.sh @@ -4,6 +4,7 @@ # by Foxlet VMDIR=$PWD +MACHINE=$(qemu-system-x86_64 --machine help | grep q35 | cut -d" " -f1 | egrep -oe ".*-[0-9.]+" | sort -rV | head -1) OUT="template.xml" print_usage() { @@ -20,7 +21,7 @@ error() { } generate(){ - sed -e "s|VMDIR|$VMDIR|g" tools/template.xml.in > $OUT + sed -e "s|VMDIR|$VMDIR|g" -e "s|MACHINE|$MACHINE|g" tools/template.xml.in > $OUT echo "$OUT has been generated in $VMDIR" } diff --git a/tools/template.xml.in b/tools/template.xml.in index ac36489..321552f 100644 --- a/tools/template.xml.in +++ b/tools/template.xml.in @@ -5,7 +5,7 @@ 2097152 4 - hvm + hvm VMDIR/firmware/OVMF_CODE.fd VMDIR/firmware/OVMF_VARS-1024x768.fd