From: Sean Christopherson <seanjc@google.com>
To: Andrew Jones <ajones@ventanamicro.com>
Cc: Thomas Huth <thuth@redhat.com>,
Andrew Jones <andrew.jones@linux.dev>,
kvm@vger.kernel.org
Subject: Re: [kvm-unit-tests PATCH] scripts: Search the entire string for the correct accelerator
Date: Fri, 2 May 2025 06:54:51 -0700 [thread overview]
Message-ID: <aBTOq5qkpeIdl0G7@google.com> (raw)
In-Reply-To: <20250502-6ff7655f7f51e12791535815@orel>
On Fri, May 02, 2025, Andrew Jones wrote:
> On Thu, May 01, 2025 at 03:35:08PM -0700, Sean Christopherson wrote:
> > On Sat, Apr 26, 2025, Andrew Jones wrote:
> > > On Fri, Apr 25, 2025 at 03:05:57PM -0700, Sean Christopherson wrote:
> > > > Search the entire ACCEL string for the required accelerator as searching
> > > > for an exact match incorrectly rejects ACCEL when additional accelerator
> > > > specific options are provided, e.g.
> > > >
> > > > SKIP pmu (kvm only, but ACCEL=kvm,kernel_irqchip=on)
> > > >
> > > > Signed-off-by: Sean Christopherson <seanjc@google.com>
> > > > ---
> > > > scripts/runtime.bash | 2 +-
> > > > 1 file changed, 1 insertion(+), 1 deletion(-)
> > > >
> > > > diff --git a/scripts/runtime.bash b/scripts/runtime.bash
> > > > index 4b9c7d6b..59d1727c 100644
> > > > --- a/scripts/runtime.bash
> > > > +++ b/scripts/runtime.bash
> > > > @@ -126,7 +126,7 @@ function run()
> > > > machine="$MACHINE"
> > > > fi
> > > >
> > > > - if [ -n "$accel" ] && [ -n "$ACCEL" ] && [ "$accel" != "$ACCEL" ]; then
> > > > + if [ -n "$accel" ] && [ -n "$ACCEL" ] && [[ ! "$ACCEL" =~ $accel ]]; then
> > >
> > > Let's use
> > >
> > > [[ ! $ACCEL =~ ^$accel(,.*|$) ]]
> > >
> > > to be a bit more precise.
> >
> > Sadist. :-)
>
> Hehe
>
> >
> > Why the ".*"? Isn't that the same as:
> >
> > [[ ! "$ACCEL" =~ ^$accel(,|$) ]]
> >
> > Or are my regex skills worse than I realize (and I fully realize they're really,
> > really bad)?
>
> Oops, that ".*" should have been a ".+" since the intention was to avoid
> accepting 'kvm,', but, of course you're right, that .* still allows it,
> making it equivalent to nothing at all.
>
> We can either just drop the .* and accept 'kvm,' (because why not) or
> change that * to +.
I'll drop the .*, as QEMU accepts "kvm,", i.e. it actually works.
prev parent reply other threads:[~2025-05-02 13:54 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-25 22:05 [kvm-unit-tests PATCH] scripts: Search the entire string for the correct accelerator Sean Christopherson
2025-04-26 12:00 ` Andrew Jones
2025-05-01 22:35 ` Sean Christopherson
2025-05-02 9:25 ` Andrew Jones
2025-05-02 13:54 ` Sean Christopherson [this message]
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=aBTOq5qkpeIdl0G7@google.com \
--to=seanjc@google.com \
--cc=ajones@ventanamicro.com \
--cc=andrew.jones@linux.dev \
--cc=kvm@vger.kernel.org \
--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