From fb59a2b966620e747ccc5a7d25b1cdcb4ceb981c Mon Sep 17 00:00:00 2001 From: Salvador Fuentes Date: Wed, 28 Mar 2018 16:06:26 -0600 Subject: [PATCH] qemu: does not use unsupported flags for qemu 2.11 Qemu 2.11 does not support --disable-static flag and --enable-strip flag, this patch adds a condition to only use it for qemu 2.7 or older. Fixes: #11. Signed-off-by: Salvador Fuentes --- scripts/configure-hypervisor.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/scripts/configure-hypervisor.sh b/scripts/configure-hypervisor.sh index ed11cc8d41..1556f22c7b 100755 --- a/scripts/configure-hypervisor.sh +++ b/scripts/configure-hypervisor.sh @@ -268,8 +268,11 @@ main() # Disable TCG support qemu_options+=(size:--disable-tcg) - # Don't build a static binary (lowers security) - qemu_options+=(security:--disable-static) + # SECURITY: Don't build a static binary (lowers security) + # needed if qemu version is less than 2.7 + if [ ${qemu_version_major} -eq 2 ] && [ ${qemu_version_minor} -lt 7 ]; then + qemu_options+=(--disable-static) + fi # Not required as "-uuid ..." is always passed to the qemu binary qemu_options+=(size:--disable-uuid) @@ -309,7 +312,10 @@ main() qemu_options+=(speed:--enable-vhost-net) # Always strip binaries - qemu_options+=(size:--enable-strip) + # needed if qemu version is less than 2.7 + if [ ${qemu_version_major} -eq 2 ] && [ ${qemu_version_minor} -lt 7 ]; then + qemu_options+=(--enable-strip) + fi # Support Ceph RADOS Block Device (RBD) qemu_options+=(functionality:--enable-rbd)