Re: [kvm-unit-tests PATCH v2] scripts/arch-run.bash: Drop the dependency on "jq"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue Sep 9, 2025 at 6:58 AM CEST, Thomas Huth wrote:
> For checking whether a panic event occurred, a simple "grep"
> for the related text in the output is enough - it's very unlikely
> that the output of QEMU will change. This way we can drop the
> dependency on the program "jq" which might not be installed on
> some systems.

Trying to understand which problem you're trying to solve here.

Is there any major distribution which doesn't have jq in its repos? Or any
reason why you wouldn't install it?

> diff --git a/scripts/arch-run.bash b/scripts/arch-run.bash
> index 36222355..16417a1e 100644
> --- a/scripts/arch-run.bash
> +++ b/scripts/arch-run.bash
> @@ -296,11 +296,6 @@ do_migration ()
>  
>  run_panic ()
>  {
[...]
> -	panic_event_count=$(jq -c 'select(.event == "GUEST_PANICKED")' < ${qmp}.out | wc -l)
> -	if [ "$panic_event_count" -lt 1 ]; then
> +	if ! grep -E -q '"event"[[:blank:]]*:[[:blank:]]*"GUEST_PANICKED"' ${qmp}.out ; then

This changes behaviour.

Now "event" can be arbitrarily deep nested in the JSON. It could even be
completely invalid JSON.

Not saying we shouldn't do this, it just comes with a cost and we need to see if
it's worth paying that.





[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux