Skip to contentSkip to conversation

scripts: Search the entire string for the correct accelerator

PATCH In review Sean Christopherson 2 participants 2 messages May 2, 2025 – May 3, 2025 KVM

lore
Share & tools
lore

Sean Christopherson

author reviewer
#0 lore raw

PATCH v2 1/1 scripts: Search the entire string for the correct accelerator

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)

---

v2: Require the accelerator string to match the start and end, with an
allowance for comma-seperate options. [Drew]

 scripts/runtime.bash | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/runtime.bash +1 -1
index 4b9c7d6b..ee229631 100644
@@ -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
         print_result "SKIP" $testname "" "$accel only, but ACCEL=$ACCEL"
         return 2
     elif [ -n "$ACCEL" ]; then

base-commit: abdc5d02a7796a55802509ac9bb704c721f2a5f6

Signature · 1 line
2.49.0.906.g1f30a19c02-goog
#1 lore raw
Quoted 29 lines · Sean Christopherson

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)

---

v2: Require the accelerator string to match the start and end, with an
allowance for comma-seperate options. [Drew]

 scripts/runtime.bash | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/runtime.bash +1 -1
index 4b9c7d6b..ee229631 100644
@@ -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
         print_result "SKIP" $testname "" "$accel only, but ACCEL=$ACCEL"
         return 2
     elif [ -n "$ACCEL" ]; then
Quoted 4 lines

base-commit: abdc5d02a7796a55802509ac9bb704c721f2a5f6

Signature · 1 line
2.49.0.906.g1f30a19c02-goog

Merged.

Thanks,
drew