All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH kvm-unit-tests] x86/run: Rearrange the valid binary and testdev support checks
@ 2015-04-10 14:57 Bandan Das
  2015-04-24 20:52 ` Bandan Das
  0 siblings, 1 reply; 2+ messages in thread
From: Bandan Das @ 2015-04-10 14:57 UTC (permalink / raw)
  To: kvm; +Cc: Paolo Bonzini


This extends the sanity checks done on known common Qemu binary
paths when the user supplies a QEMU= on the command line

Fixes: b895b967db94937d5b593c51b95eb32d2889a764

Signed-off-by: Bandan Das <bsd@redhat.com>
---
 x86/run | 43 +++++++++++++++++++------------------------
 1 file changed, 19 insertions(+), 24 deletions(-)

diff --git a/x86/run b/x86/run
index 219a93b..5281fca 100755
--- a/x86/run
+++ b/x86/run
@@ -2,33 +2,28 @@
 NOTFOUND=1
 TESTDEVNOTSUPP=2
 
-qemukvm="${QEMU:-qemu-kvm}"
-qemusystem="${QEMU:-qemu-system-x86_64}"
+qemubinarysearch="${QEMU:-qemu-kvm qemu-system-x86_64}"
 
-if      ! [ -z "${QEMU}" ]
-then
-	qemu="${QEMU}"
-else
-	for qemucmds in ${qemukvm} ${qemusystem}
-	do
-		unset QEMUFOUND
-		unset qemu
-		if ! [ -z "${QEMUFOUND=$(${qemucmds} --help 2>/dev/null | grep "QEMU")}" ] &&
-		       ${qemucmds} -device '?' 2>&1 | grep -F -e \"testdev\" -e \"pc-testdev\" > /dev/null;
-		then
-		    qemu="${qemucmds}"
-		    break
-		fi
-	done
-	if      [ -z "${QEMUFOUND}" ]
-	then
-		echo "A QEMU binary was not found, You can set a custom location by using the QEMU=<path> environment variable "
-		exit ${NOTFOUND}
-	elif    [ -z "${qemu}" ]
+for qemucmd in ${qemubinarysearch}
+do
+	unset QEMUFOUND
+	unset qemu
+	if ! [ -z "${QEMUFOUND=$(${qemucmd} --help 2>/dev/null | grep "QEMU")}" ] &&
+			${qemucmd} -device '?' 2>&1 | grep -F -e \"testdev\" -e \"pc-testdev\" > /dev/null;
 	then
-		echo "No Qemu test device support found"
-		exit ${TESTDEVNOTSUPP}
+		qemu="${qemucmd}"
+		break
 	fi
+done
+
+if      [ -z "${QEMUFOUND}" ]
+then
+	echo "A QEMU binary was not found, You can set a custom location by using the QEMU=<path> environment variable "
+	exit ${NOTFOUND}
+elif    [ -z "${qemu}" ]
+then
+	echo "No Qemu test device support found"
+	exit ${TESTDEVNOTSUPP}
 fi
 
 if
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH kvm-unit-tests] x86/run: Rearrange the valid binary and testdev support checks
  2015-04-10 14:57 [PATCH kvm-unit-tests] x86/run: Rearrange the valid binary and testdev support checks Bandan Das
@ 2015-04-24 20:52 ` Bandan Das
  0 siblings, 0 replies; 2+ messages in thread
From: Bandan Das @ 2015-04-24 20:52 UTC (permalink / raw)
  To: kvm; +Cc: Paolo Bonzini


Ping, Paolo, did this slip through the cracks ?

Bandan Das <bsd@redhat.com> writes:

> This extends the sanity checks done on known common Qemu binary
> paths when the user supplies a QEMU= on the command line
>
> Fixes: b895b967db94937d5b593c51b95eb32d2889a764
>
> Signed-off-by: Bandan Das <bsd@redhat.com>
> ---
>  x86/run | 43 +++++++++++++++++++------------------------
>  1 file changed, 19 insertions(+), 24 deletions(-)
>
> diff --git a/x86/run b/x86/run
> index 219a93b..5281fca 100755
> --- a/x86/run
> +++ b/x86/run
> @@ -2,33 +2,28 @@
>  NOTFOUND=1
>  TESTDEVNOTSUPP=2
>  
> -qemukvm="${QEMU:-qemu-kvm}"
> -qemusystem="${QEMU:-qemu-system-x86_64}"
> +qemubinarysearch="${QEMU:-qemu-kvm qemu-system-x86_64}"
>  
> -if      ! [ -z "${QEMU}" ]
> -then
> -	qemu="${QEMU}"
> -else
> -	for qemucmds in ${qemukvm} ${qemusystem}
> -	do
> -		unset QEMUFOUND
> -		unset qemu
> -		if ! [ -z "${QEMUFOUND=$(${qemucmds} --help 2>/dev/null | grep "QEMU")}" ] &&
> -		       ${qemucmds} -device '?' 2>&1 | grep -F -e \"testdev\" -e \"pc-testdev\" > /dev/null;
> -		then
> -		    qemu="${qemucmds}"
> -		    break
> -		fi
> -	done
> -	if      [ -z "${QEMUFOUND}" ]
> -	then
> -		echo "A QEMU binary was not found, You can set a custom location by using the QEMU=<path> environment variable "
> -		exit ${NOTFOUND}
> -	elif    [ -z "${qemu}" ]
> +for qemucmd in ${qemubinarysearch}
> +do
> +	unset QEMUFOUND
> +	unset qemu
> +	if ! [ -z "${QEMUFOUND=$(${qemucmd} --help 2>/dev/null | grep "QEMU")}" ] &&
> +			${qemucmd} -device '?' 2>&1 | grep -F -e \"testdev\" -e \"pc-testdev\" > /dev/null;
>  	then
> -		echo "No Qemu test device support found"
> -		exit ${TESTDEVNOTSUPP}
> +		qemu="${qemucmd}"
> +		break
>  	fi
> +done
> +
> +if      [ -z "${QEMUFOUND}" ]
> +then
> +	echo "A QEMU binary was not found, You can set a custom location by using the QEMU=<path> environment variable "
> +	exit ${NOTFOUND}
> +elif    [ -z "${qemu}" ]
> +then
> +	echo "No Qemu test device support found"
> +	exit ${TESTDEVNOTSUPP}
>  fi
>  
>  if

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-04-24 20:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-10 14:57 [PATCH kvm-unit-tests] x86/run: Rearrange the valid binary and testdev support checks Bandan Das
2015-04-24 20:52 ` Bandan Das

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.