kvmarm.lists.cs.columbia.edu archive mirror
 help / color / mirror / Atom feed
* [kvm-unit-tests PATCH v2 0/2] Clean up the arm/run script
@ 2023-03-03  4:10 Shaoqin Huang
  2023-03-03  4:10 ` [kvm-unit-tests PATCH v2 1/2] arm: Replace the obsolete qemu script Shaoqin Huang
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Shaoqin Huang @ 2023-03-03  4:10 UTC (permalink / raw)
  To: kvmarm; +Cc: Shaoqin Huang, Andrew Jones, kvm

Using more simple bash command to clean up the arm/run script.

Patch 1 replace the obsolete qemu script.

Patch 2 clean up the arm/run script to make the format consistent and simple.

Changelog:
----------
v2:
  - Add the oldest QEMU version for which -chardev ? work.
  - use grep -q replace the grep > /dev/null.
  - Add a new patch to clean up the arm/run.

v1: https://lore.kernel.org/all/20230301071737.43760-1-shahuang@redhat.com/

Shaoqin Huang (2):
  arm: Replace the obsolete qemu script
  arm: Clean up the run script

 arm/run | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

-- 
2.39.1


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

* [kvm-unit-tests PATCH v2 1/2] arm: Replace the obsolete qemu script
  2023-03-03  4:10 [kvm-unit-tests PATCH v2 0/2] Clean up the arm/run script Shaoqin Huang
@ 2023-03-03  4:10 ` Shaoqin Huang
  2023-03-03  4:10 ` [kvm-unit-tests PATCH v2 2/2] arm: Clean up the run script Shaoqin Huang
  2023-03-21 15:41 ` [kvm-unit-tests PATCH v2 0/2] Clean up the arm/run script Andrew Jones
  2 siblings, 0 replies; 4+ messages in thread
From: Shaoqin Huang @ 2023-03-03  4:10 UTC (permalink / raw)
  To: kvmarm; +Cc: Shaoqin Huang, Andrew Jones, kvm

The qemu script used to detect the testdev is obsoleted, replace it
with the modern way to detect if testdev exists which was first
introduced at QEMU v2.7.50 by:
517b3d4016 (chardev: Add 'help' option to print all available chardev backend types).

Signed-off-by: Shaoqin Huang <shahuang@redhat.com>
---
 arm/run | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arm/run b/arm/run
index 1284891..b918029 100755
--- a/arm/run
+++ b/arm/run
@@ -59,8 +59,7 @@ if ! $qemu $M -device '?' 2>&1 | grep virtconsole > /dev/null; then
 	exit 2
 fi
 
-if $qemu $M -chardev testdev,id=id -initrd . 2>&1 \
-		| grep backend > /dev/null; then
+if ! $qemu $M -chardev '?' | grep -q testdev; then
 	echo "$qemu doesn't support chr-testdev. Exiting."
 	exit 2
 fi
-- 
2.39.1


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

* [kvm-unit-tests PATCH v2 2/2] arm: Clean up the run script
  2023-03-03  4:10 [kvm-unit-tests PATCH v2 0/2] Clean up the arm/run script Shaoqin Huang
  2023-03-03  4:10 ` [kvm-unit-tests PATCH v2 1/2] arm: Replace the obsolete qemu script Shaoqin Huang
@ 2023-03-03  4:10 ` Shaoqin Huang
  2023-03-21 15:41 ` [kvm-unit-tests PATCH v2 0/2] Clean up the arm/run script Andrew Jones
  2 siblings, 0 replies; 4+ messages in thread
From: Shaoqin Huang @ 2023-03-03  4:10 UTC (permalink / raw)
  To: kvmarm; +Cc: Shaoqin Huang, Andrew Jones, kvm

Using more simple bash command to clean up the run script.

No functional change intended.

Signed-off-by: Shaoqin Huang <shahuang@redhat.com>
---
 arm/run | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/arm/run b/arm/run
index b918029..c6f25b8 100755
--- a/arm/run
+++ b/arm/run
@@ -28,7 +28,7 @@ fi
 
 ACCEL=$accel
 
-if ! $qemu -machine '?' 2>&1 | grep 'ARM Virtual Machine' > /dev/null; then
+if ! $qemu -machine '?' | grep -q 'ARM Virtual Machine'; then
 	echo "$qemu doesn't support mach-virt ('-machine virt'). Exiting."
 	exit 2
 fi
@@ -36,7 +36,7 @@ fi
 M='-machine virt'
 
 if [ "$ACCEL" = "kvm" ]; then
-	if $qemu $M,\? 2>&1 | grep gic-version > /dev/null; then
+	if $qemu $M,\? | grep -q gic-version; then
 		M+=',gic-version=host'
 	fi
 fi
@@ -54,7 +54,7 @@ if [ "$ARCH" = "arm" ]; then
 	M+=",highmem=off"
 fi
 
-if ! $qemu $M -device '?' 2>&1 | grep virtconsole > /dev/null; then
+if ! $qemu $M -device '?' | grep -q virtconsole; then
 	echo "$qemu doesn't support virtio-console for chr-testdev. Exiting."
 	exit 2
 fi
@@ -68,7 +68,7 @@ chr_testdev='-device virtio-serial-device'
 chr_testdev+=' -device virtconsole,chardev=ctd -chardev testdev,id=ctd'
 
 pci_testdev=
-if $qemu $M -device '?' 2>&1 | grep pci-testdev > /dev/null; then
+if $qemu $M -device '?' | grep -q pci-testdev; then
 	pci_testdev="-device pci-testdev"
 fi
 
-- 
2.39.1


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

* Re: [kvm-unit-tests PATCH v2 0/2] Clean up the arm/run script
  2023-03-03  4:10 [kvm-unit-tests PATCH v2 0/2] Clean up the arm/run script Shaoqin Huang
  2023-03-03  4:10 ` [kvm-unit-tests PATCH v2 1/2] arm: Replace the obsolete qemu script Shaoqin Huang
  2023-03-03  4:10 ` [kvm-unit-tests PATCH v2 2/2] arm: Clean up the run script Shaoqin Huang
@ 2023-03-21 15:41 ` Andrew Jones
  2 siblings, 0 replies; 4+ messages in thread
From: Andrew Jones @ 2023-03-21 15:41 UTC (permalink / raw)
  To: Shaoqin Huang, kvmarm; +Cc: kvm

On Thu, 2 Mar 2023 23:10:50 -0500, Shaoqin Huang wrote:
> Using more simple bash command to clean up the arm/run script.
> 
> Patch 1 replace the obsolete qemu script.
> 
> Patch 2 clean up the arm/run script to make the format consistent and simple.
> 
> Changelog:
> ----------
> v2:
>   - Add the oldest QEMU version for which -chardev ? work.
>   - use grep -q replace the grep > /dev/null.
>   - Add a new patch to clean up the arm/run.
> 
> [...]

Applied to arm/queue, thanks!

https://gitlab.com/jones-drew/kvm-unit-tests/-/commits/arm/queue

drew

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

end of thread, other threads:[~2023-03-21 15:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-03  4:10 [kvm-unit-tests PATCH v2 0/2] Clean up the arm/run script Shaoqin Huang
2023-03-03  4:10 ` [kvm-unit-tests PATCH v2 1/2] arm: Replace the obsolete qemu script Shaoqin Huang
2023-03-03  4:10 ` [kvm-unit-tests PATCH v2 2/2] arm: Clean up the run script Shaoqin Huang
2023-03-21 15:41 ` [kvm-unit-tests PATCH v2 0/2] Clean up the arm/run script Andrew Jones

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).