From 341e5ca58e1098be36b8b5755d0123a52acabf76 Mon Sep 17 00:00:00 2001 From: Hyounggyu Choi Date: Fri, 13 Dec 2024 14:39:03 +0100 Subject: [PATCH] vfio-ap: Assign default string "0" for empty APID and APQI MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The current script logic assigns an empty string to APID and APQI when APQN consists entirely of zeros (e.g., "00.0000"). However, this behavior is incorrect, as "00" and "0000" are valid values and should be represented as "0". This commit ensures that the script assigns the default string “0” to APID and APQI if their computed values are empty. Signed-off-by: Hyounggyu Choi --- tests/functional/vfio-ap/run.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/functional/vfio-ap/run.sh b/tests/functional/vfio-ap/run.sh index d445c7c240..c3bd41eff1 100755 --- a/tests/functional/vfio-ap/run.sh +++ b/tests/functional/vfio-ap/run.sh @@ -156,7 +156,9 @@ create_mediated_device() { _APID=${APQN//.*} _APQI=${APQN#*.} APID=$(echo ${_APID} | sed 's/^0*//') + APID=${APID:-0} APQI=$(echo ${_APQI} | sed 's/^0*//') + APQI=${APQI:-0} # Release the device from the host pushd ${sys_bus_base}