public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Claudio Imbrenda <imbrenda@linux.ibm.com>
To: "Nico Boehr" <nrb@linux.ibm.com>
Cc: "Thomas Huth" <thuth@redhat.com>, <kvm@vger.kernel.org>,
	"Andrew Jones" <andrew.jones@linux.dev>,
	"Janosch Frank" <frankja@linux.ibm.com>
Subject: Re: [kvm-unit-tests PATCH v2] scripts/arch-run.bash: Drop the dependency on "jq"
Date: Wed, 10 Sep 2025 11:00:45 +0200	[thread overview]
Message-ID: <20250910110007.26fa1643@p-imbrenda> (raw)
In-Reply-To: <DCOYKSEY6V79.3HE423J6WWXTT@linux.ibm.com>

On Wed, 10 Sep 2025 09:57:17 +0200
"Nico Boehr" <nrb@linux.ibm.com> wrote:

> 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?

I think it's just a matter of trying to avoid too many dependencies,
especially for something this trivial

> 
> > 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.

in that case we have other issues

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

I don't have a strong opinion on this, but in general I like the idea
of having fewer dependencies

  reply	other threads:[~2025-09-10  9:01 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-09  4:58 [kvm-unit-tests PATCH v2] scripts/arch-run.bash: Drop the dependency on "jq" Thomas Huth
2025-09-09 13:49 ` Claudio Imbrenda
2025-09-09 16:05 ` Andrew Jones
2025-09-10  7:57 ` Nico Boehr
2025-09-10  9:00   ` Claudio Imbrenda [this message]
2025-09-10  9:06     ` Thomas Huth
2025-09-10 11:36       ` Nico Boehr
  -- strict thread matches above, loose matches on Subject: below --
2025-07-31 11:05 Thomas Huth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250910110007.26fa1643@p-imbrenda \
    --to=imbrenda@linux.ibm.com \
    --cc=andrew.jones@linux.dev \
    --cc=frankja@linux.ibm.com \
    --cc=kvm@vger.kernel.org \
    --cc=nrb@linux.ibm.com \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox