From patchwork Sat Apr 6 12:38:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 13619796 Received: from mail-pj1-f44.google.com (mail-pj1-f44.google.com [209.85.216.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 171892D05E; Sat, 6 Apr 2024 12:39:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712407143; cv=none; b=JscMUdPrnVrB0rmyV6NXJI8/bAYZQEw77bPyxrGqwsq8MMmmyOA8hFDABZUJy4u5wk03x3bOem9fBkwzihbip/RkiXBvaT/ZcEM1YnFUG6wKqdlcVKCz4EwU6EfPyiwXX9ly35TOC8uH4BX04vSPHRCksTfYgylNmfITtHjeVoE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712407143; c=relaxed/simple; bh=fQCsq+sZAe6QlgWYF8/YRGqIoB5/+pyiNJbHQETHeX0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=pRhXt8MoEJFgBS2fgCjcv0+RdVh5q+a9obe2MG2g/iUVRxQz+8sebu0nQ8IIlS4SMHwHH2mxEIvcE3lz/zTn25hc6fuCAdYzEMPueCz//eM2KvhLa/NEdBDiIwBl1YRVKSDw+IervNwMdrkXBSE/edUBrIrG44ube1L/qWvFJUY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=f4MKjmSe; arc=none smtp.client-ip=209.85.216.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="f4MKjmSe" Received: by mail-pj1-f44.google.com with SMTP id 98e67ed59e1d1-2a2c028b8a6so2043613a91.1; Sat, 06 Apr 2024 05:39:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712407140; x=1713011940; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=IbXS3mPbclefehTNkJZ/z/tUSWiPiMKoUzf34+kT7OI=; b=f4MKjmSegwu6HOdwUYAbrlINzRPvIjBErFWk8EUBp8nn8TIQ0GP/2nTrts7xWGHSUl +zMeZK2gyUdsk+uo972Ss2x0Rl9DpZN5H+vm6CPlKu/uKiZU2PKgELtO6P8A0ZEFnM+w YQreNjMpD9kO2z5FelH9fCuPZJFo9urSzrUfmfjnHB9ouhY8Ve4TCoADuFi37w2vdDs3 7Ul3perjciFwC6udsz/GgbuzFm+PJ3WID2UxR1v0AaZGV56X2S/p6Kq8I6jhnq4VQCo9 U7gTBARfJV9bJzEVk+vqP9Sc6D88C8LmJXNo89DoREvn/QMTgG+1NkrGfK7ZHdlwYt0x VNrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712407140; x=1713011940; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=IbXS3mPbclefehTNkJZ/z/tUSWiPiMKoUzf34+kT7OI=; b=GiA0EUAyG8h0zNWphtS9K/G7RIx9ZWrGkBQuZvVyx/LzhBjke454EFCVMDNCkyZIhZ u8J9AqPh+2FxMX+Yewjwmc/Nl5d+BTvra4LSHpaSw1GmB7DuGfSta/Qk8kf2N1OLizKQ boOVMfROPmKSddeVmhV3WjF89pBn9H/o+Y6SZBMPBOh4+NIvTzw7J+bcY5qvkibshWgn X+DLkDUBeLSZCzOq0OR5FWUstoT3ZhX4c+nvy1rgYrIzLrJKrlECKJyHRth6Bol9K9q4 JH3/E/q+B9gjrCU9C3caZZWJboN0GDzuL03mK/QIYo3XjuW7INA112NlbnoLXaRc/+yR +WKw== X-Forwarded-Encrypted: i=1; AJvYcCVo8/oMqMjprCZOtUiS0+yfIAjNawYwTJtYSjiCSIiZRk1xvpeNRH+HjkoHCfzsaQOAs1g2uzQoAt2FQIE29IIlrlzvua1jFfbGDfYZawE/pHC9IDgH5qv0M4+b/6hstA== X-Gm-Message-State: AOJu0Yz6AqKujm6iIH+1AVacpuP1Num6S0kHZeC4FWpJ02jgbIY1JyUg uvQTopeMP21bzu9LFkLlcBBQ2JZmcYLv+VP7dpz8St8Y4E+r76lQ X-Google-Smtp-Source: AGHT+IGZuRmyUSURkYq7nO4hW7JRTEzJugpaiD6OSQX4jAsuLRrinwKGCqQjaKwfezP4e8hM/R6shA== X-Received: by 2002:a17:90b:3795:b0:2a2:53ee:bd08 with SMTP id mz21-20020a17090b379500b002a253eebd08mr3514004pjb.8.1712407140290; Sat, 06 Apr 2024 05:39:00 -0700 (PDT) Received: from wheely.local0.net (124-169-104-130.tpgi.com.au. [124.169.104.130]) by smtp.gmail.com with ESMTPSA id nt5-20020a17090b248500b002a279a86e7asm5050576pjb.7.2024.04.06.05.38.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 06 Apr 2024 05:38:59 -0700 (PDT) From: Nicholas Piggin To: Andrew Jones Cc: Nicholas Piggin , Paolo Bonzini , Thomas Huth , Alexandru Elisei , Eric Auger , Janosch Frank , Claudio Imbrenda , =?utf-8?q?Nico_B=C3=B6hr?= , David Hildenbrand , Shaoqin Huang , Nikos Nikoleris , David Woodhouse , Ricardo Koller , rminmin , Gavin Shan , Nina Schoetterl-Glausch , Sean Christopherson , kvm@vger.kernel.org, kvmarm@lists.linux.dev, kvm-riscv@lists.infradead.org, linux-s390@vger.kernel.org Subject: [RFC kvm-unit-tests PATCH v2 01/14] Add initial shellcheck checking Date: Sat, 6 Apr 2024 22:38:10 +1000 Message-ID: <20240406123833.406488-2-npiggin@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240406123833.406488-1-npiggin@gmail.com> References: <20240406123833.406488-1-npiggin@gmail.com> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 This adds a basic shellcheck sytle file, some directives to help find scripts, and a make shellcheck target. When changes settle down this could be made part of the standard build / CI flow. Suggested-by: Andrew Jones Reviewed-by: Andrew Jones Signed-off-by: Nicholas Piggin --- .shellcheckrc | 30 ++++++++++++++++++++++++++++++ Makefile | 4 ++++ README.md | 3 +++ scripts/common.bash | 5 ++++- 4 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 .shellcheckrc diff --git a/.shellcheckrc b/.shellcheckrc new file mode 100644 index 000000000..491af18bd --- /dev/null +++ b/.shellcheckrc @@ -0,0 +1,30 @@ +# shellcheck configuration file +external-sources=true + +# Optional extras -- https://www.shellcheck.net/wiki/Optional +# Possibilities, e.g., - +# quote‐safe‐variables +# require-double-brackets +# require-variable-braces +# add-default-case + +# Disable SC2004 style? I.e., +# In run_tests.sh line 67: +# if (( $unittest_run_queues <= 0 )); then +# ^------------------^ SC2004 (style): $/${} is unnecessary on arithmetic variables. +disable=SC2004 + +# Disable SC2086 for now, double quote to prevent globbing and word +# splitting. There are lots of places that use it for word splitting +# (e.g., invoking commands with arguments) that break. Should have a +# more consistent approach for this (perhaps use arrays for such cases) +# but for now disable. +# SC2086 (info): Double quote to prevent globbing and word splitting. +disable=SC2086 + +# Disable SC2235. Most developers are used to seeing expressions +# like a || (b && c), not a || { b && c ; }. The subshell overhead in +# kvm-unit-tests is negligible as it's not shell-heavy in the first +# place (time is dominated by qemu startup/shutdown and test execution) +# SC2235 (style): Use { ..; } instead of (..) to avoid subshell overhead. +disable=SC2235 diff --git a/Makefile b/Makefile index 4e0f54543..4863cfdc6 100644 --- a/Makefile +++ b/Makefile @@ -141,6 +141,10 @@ cscope: -name '*.[chsS]' -exec realpath --relative-base=$(CURDIR) {} \; | sort -u > ./cscope.files cscope -bk +.PHONY: shellcheck +shellcheck: + shellcheck -a run_tests.sh */run */efi/run scripts/mkstandalone.sh + .PHONY: tags tags: ctags -R diff --git a/README.md b/README.md index 6e82dc225..03ff5994e 100644 --- a/README.md +++ b/README.md @@ -193,3 +193,6 @@ with `git config diff.orderFile scripts/git.difforder` enables it. We strive to follow the Linux kernels coding style so it's recommended to run the kernel's ./scripts/checkpatch.pl on new patches. + +Also run make shellcheck before submitting a patch which touches bash +scripts. diff --git a/scripts/common.bash b/scripts/common.bash index ee1dd8659..3aa557c8c 100644 --- a/scripts/common.bash +++ b/scripts/common.bash @@ -82,8 +82,11 @@ function arch_cmd() } # The current file has to be the only file sourcing the arch helper -# file +# file. Shellcheck can't follow this so help it out. There doesn't appear to be a +# way to specify multiple alternatives, so we will have to rethink this if things +# get more complicated. ARCH_FUNC=scripts/${ARCH}/func.bash if [ -f "${ARCH_FUNC}" ]; then +# shellcheck source=scripts/s390x/func.bash source "${ARCH_FUNC}" fi From patchwork Sat Apr 6 12:38:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 13619797 Received: from mail-pj1-f41.google.com (mail-pj1-f41.google.com [209.85.216.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D859CBA55; Sat, 6 Apr 2024 12:39:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712407151; cv=none; b=RofETbf9WPE+ZMXX+PzJEhgdkjYSTDIbAxZ4qhnW4Pv7Td7FUpO0MVGbpDJpa1Bq7Xb+j+YN4rhtopOs2kBzP1z1eqz6OcJsduuTDkuCPteN0qUeKuWVPCK/2JfW7n6AOpHwtgFscvMPzyOmLVyWj01eQvvumqN/+42DdmTlB8Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712407151; c=relaxed/simple; bh=ynVkD9kpyp73EWy70emPQEfa+B2E+GzlRMJPQM8F8zw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=FK3I9J9RKCjlc0h9kqm/pKBDmcXcGctYb7UQodc2baHFfroeb3hbSpSWlo9jTSzdLKHm9uqy/WNvEoCYrDOazSggFRExLtCO34S06F59HVjfdF9ak722SWJ2ZiTdvDGjFzFUEvyjYyfjBWI4+Mh90ZP82nD21FwSBlJtRcyMh58= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=e3XdhkVh; arc=none smtp.client-ip=209.85.216.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="e3XdhkVh" Received: by mail-pj1-f41.google.com with SMTP id 98e67ed59e1d1-2a074187a42so2203484a91.0; Sat, 06 Apr 2024 05:39:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712407149; x=1713011949; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=n6Ak2eXV9+uxmKDVMVAvdf5h+W+GwHpU0A4GvgnXZ/Y=; b=e3XdhkVho12vwtYWGCQZW6/XbOWnbRCQFOG1AneBxpdzMpQaS8yfuvV8sXOFv5nPc6 tt7mV5hOIQw+GTL2IGffpTvbVOdfcnn5SfTXoPExAsfAU6rGiC9toXXjEcPyd9UWBGLM CVnLOkgrVtMNeN1dP1T6n/b2YPb9qaqsKNcUjllyflj2XN8NPMUHEAeg6F9oESrTmJjs N5VAtBtP/YhoOocW1Iz66YxgU1v/10Z5qFkF1wLnwSbkneVRBq/72msvg+zPwkvjhjIK Ya3xSmlOMJ4pH8S1spVWMkEj9/7SvufgiTM1QAagymrsXPXg7xpQZ0pHBerLRZhYq8AN t+Bg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712407149; x=1713011949; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=n6Ak2eXV9+uxmKDVMVAvdf5h+W+GwHpU0A4GvgnXZ/Y=; b=MFiT5DSuK6V5p6VDRkXuElk6W7lUSm3gmU6wsQ+yLlbzghd8hrbes+eSu61Dzo6MGV o0F+BzWwtFl9L8le/vGW0x/33APxG8FbTu+eXDU0iSiJIYYVuKwSY/axVuwYYIwx0QA7 oVhyhqyprn3Z3oLpJvOs1URmr3p1E4XYekeiL3/SW8KqekHw5V3jmKQcgHq8QsaLhs2N je+RqaI1mMRowjtuKucu7tJVsNFeJVHwcjQMLjYStxLJRRaI1sgkdYWOR6hXTLW0A43E oIWr4DIe/h6skOAd5pQjRKOlvXa0Of5IdUitLVl+aodNBT1VZVfBejwsipMXyMVDcRY5 hItg== X-Forwarded-Encrypted: i=1; AJvYcCVpa7fIPyOO/GKGCOH2GxiifQa6JhKUlgCaxigYQI1o4s+6jHBM3Cr43yqT86Iu1Icyq9AbsI8k4prYoVlTxx1YlpcwR5AodyNlxbc83WAe5LYB9Hkd7OK6riZyyAYjVQ== X-Gm-Message-State: AOJu0YzG7SjYkObcwB3sp6BkaFNC35XrBdTB32Qi9pwcr30y7iSpvSmi qatLqZtDmJnzhPH/FcnoI4iB16+ODe4Fx01YCxPiqjTJxNdNwxQzzmtJcJV6 X-Google-Smtp-Source: AGHT+IEYhDuK2nSdoxNUh6rlvyThWG0NnDzHTSnNytiX2YBBGS47j7JwgJow8VWW5Xms5PawMFdZFg== X-Received: by 2002:a17:90a:f413:b0:2a2:8250:b5d5 with SMTP id ch19-20020a17090af41300b002a28250b5d5mr3527170pjb.18.1712407149116; Sat, 06 Apr 2024 05:39:09 -0700 (PDT) Received: from wheely.local0.net (124-169-104-130.tpgi.com.au. [124.169.104.130]) by smtp.gmail.com with ESMTPSA id nt5-20020a17090b248500b002a279a86e7asm5050576pjb.7.2024.04.06.05.39.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 06 Apr 2024 05:39:08 -0700 (PDT) From: Nicholas Piggin To: Andrew Jones Cc: Nicholas Piggin , Paolo Bonzini , Thomas Huth , Alexandru Elisei , Eric Auger , Janosch Frank , Claudio Imbrenda , =?utf-8?q?Nico_B=C3=B6hr?= , David Hildenbrand , Shaoqin Huang , Nikos Nikoleris , David Woodhouse , Ricardo Koller , rminmin , Gavin Shan , Nina Schoetterl-Glausch , Sean Christopherson , kvm@vger.kernel.org, kvmarm@lists.linux.dev, kvm-riscv@lists.infradead.org, linux-s390@vger.kernel.org Subject: [RFC kvm-unit-tests PATCH v2 02/14] shellcheck: Fix SC2223 Date: Sat, 6 Apr 2024 22:38:11 +1000 Message-ID: <20240406123833.406488-3-npiggin@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240406123833.406488-1-npiggin@gmail.com> References: <20240406123833.406488-1-npiggin@gmail.com> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 SC2223 (info): This default assignment may cause DoS due to globbing. Quote it. Reviewed-by: Andrew Jones Signed-off-by: Nicholas Piggin --- run_tests.sh | 4 ++-- scripts/runtime.bash | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/run_tests.sh b/run_tests.sh index bb3024ff9..9067e529e 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -158,8 +158,8 @@ function run_task() fi } -: ${unittest_log_dir:=logs} -: ${unittest_run_queues:=1} +: "${unittest_log_dir:=logs}" +: "${unittest_run_queues:=1}" config=$TEST_DIR/unittests.cfg print_testname() diff --git a/scripts/runtime.bash b/scripts/runtime.bash index e4ad1962f..2d7ff5baa 100644 --- a/scripts/runtime.bash +++ b/scripts/runtime.bash @@ -1,6 +1,6 @@ : "${RUNTIME_arch_run?}" -: ${MAX_SMP:=$(getconf _NPROCESSORS_ONLN)} -: ${TIMEOUT:=90s} +: "${MAX_SMP:=$(getconf _NPROCESSORS_ONLN)}" +: "${TIMEOUT:=90s}" PASS() { echo -ne "\e[32mPASS\e[0m"; } SKIP() { echo -ne "\e[33mSKIP\e[0m"; } From patchwork Sat Apr 6 12:38:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 13619798 Received: from mail-pf1-f172.google.com (mail-pf1-f172.google.com [209.85.210.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B3B60BA55; Sat, 6 Apr 2024 12:39:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712407160; cv=none; b=YQUeV2eUy+3POHCZdQl3nWl8PEgZe7RZvVGXC8h067C8o+UlsnOiIu32ksoAbQtPpK2boMkXx4V4PB55M0OKMAxVtwvfhSFWOQeZBooFPtQCKcnOmSY9jUa3v0LPLhhs9DNKLttHOZdAm3d/E/4IKB/8y4a11b2W98AHyqDTRvM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712407160; c=relaxed/simple; bh=9OMbAsnU+2GHeCnIyNL2D/RSvQn0Or13ZlM7FSCcym8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=IlG9nj+TgdOiVq3yG3nuTBZ0QN+IgyJ/ABNc4qBqzh/y7qtuPDxDl6PTWYq7mrskL1OAyDIAzDnXqFXox6FPoqqlI+3eXvkOm0fbwe0pnLmqYpPEsKQOleIGU2kWoZOu+TyUaDNWf9QUTuy+jKw60ssBlY49O84q/pmncFGyI0Y= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=at+YPAZz; arc=none smtp.client-ip=209.85.210.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="at+YPAZz" Received: by mail-pf1-f172.google.com with SMTP id d2e1a72fcca58-6ecee1f325bso2540674b3a.2; Sat, 06 Apr 2024 05:39:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712407158; x=1713011958; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=4JXiqEZUiNUnXuxmqi+ca5TsUVImKZg5r/shld6kwl0=; b=at+YPAZzGRrj4D79Mzc28zLQnxCDp1nRYhxX2Mvt8aGTNVjiuXB8E8tqkVdNblOyRG xQFiBLidB1dm0wcurFWfujzZv/2L2HVO/PYAaV9WV5n/6+3VgTMXtAcJat3G+yMdYLM7 ga+YcatO0hUO5HGLjk4nwB75c/erzUf9FORzjCP8IMQwcqU5okqKQ1E/P7UegCiTdB4A 6c7u0drjrzTvCtslEvcGqn0wy30fSh+GDboTo9iuH5pbPBfZoksYKF9ZVhoiCaAu+FYJ NmNpXCJVoikppExAqIxc/YmcLM7xCu1b/g38RI9uURd8TbgEhKQ+JA/6AERVtnpDmoKk +BoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712407158; x=1713011958; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4JXiqEZUiNUnXuxmqi+ca5TsUVImKZg5r/shld6kwl0=; b=fqRkqDtEDo69oIMJqlZ5/qh5w/99K8kZaW7QxrtxnBrqmZfF/J895IOQQIUFpAMHrb vpqVq9r5xZdMRbigL0n7/JEFEN+cLTD9D1XEqH7zT+RWV+AxGVHXcovQAlOUq6YZG2sD oDYQaehdUd3pip+M0CNIaJrH0nPQXYluZpdAzeeY7awqD14CZahBVDgHk+MaqSY3mBKS 3rFFm2A5SnWfFF502iBRWKtZ8C4d31+jM1O/Bads2cejxX1aMPzkAV6qWAQKiXb5OSnt X0LI9B4TD2V/dZq4Q3wUzV7erY2+WQPtuSgdZIJqzBEzxpiyrGZwmZg7QK7LfRRbHSm3 ATAw== X-Forwarded-Encrypted: i=1; AJvYcCVodDpayhRIG/xGnOqYQXZ0un2ydAjRhZM+BNMOgf4UrRD1wMnPta4YuF6MMgACpXM76j6XdwMeaSj6KupO0GkSNbc1RVnksWl9YuRiJWQcn+g7ylsf263gAK9+6iEvDg== X-Gm-Message-State: AOJu0YyIXpzycKFsMGIzNoa0Xw5jUesspT4ycUyd5zDZhvGGSHcf7ALH 2wmcHpPukS0IehqF9BeRGjSwH5Y5r4eQ3RC4Yruw6YlfqrjwUNNY X-Google-Smtp-Source: AGHT+IG333LDkbX9VhVWof9DtloUszYhWmLouAuBT0iCtpIluUHJkcW3r50xGy82vnO7oaHc8GPVug== X-Received: by 2002:a05:6a21:7889:b0:1a7:5509:a603 with SMTP id bf9-20020a056a21788900b001a75509a603mr591062pzc.27.1712407158090; Sat, 06 Apr 2024 05:39:18 -0700 (PDT) Received: from wheely.local0.net (124-169-104-130.tpgi.com.au. [124.169.104.130]) by smtp.gmail.com with ESMTPSA id nt5-20020a17090b248500b002a279a86e7asm5050576pjb.7.2024.04.06.05.39.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 06 Apr 2024 05:39:17 -0700 (PDT) From: Nicholas Piggin To: Andrew Jones Cc: Nicholas Piggin , Paolo Bonzini , Thomas Huth , Alexandru Elisei , Eric Auger , Janosch Frank , Claudio Imbrenda , =?utf-8?q?Nico_B=C3=B6hr?= , David Hildenbrand , Shaoqin Huang , Nikos Nikoleris , David Woodhouse , Ricardo Koller , rminmin , Gavin Shan , Nina Schoetterl-Glausch , Sean Christopherson , kvm@vger.kernel.org, kvmarm@lists.linux.dev, kvm-riscv@lists.infradead.org, linux-s390@vger.kernel.org Subject: [RFC kvm-unit-tests PATCH v2 03/14] shellcheck: Fix SC2295 Date: Sat, 6 Apr 2024 22:38:12 +1000 Message-ID: <20240406123833.406488-4-npiggin@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240406123833.406488-1-npiggin@gmail.com> References: <20240406123833.406488-1-npiggin@gmail.com> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 SC2295 (info): Expansions inside ${..} need to be quoted separately, otherwise they match as patterns. Doesn't appear to be a bug since the match string does not include patterns. Reviewed-by: Andrew Jones Signed-off-by: Nicholas Piggin --- run_tests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/run_tests.sh b/run_tests.sh index 9067e529e..116188e92 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -99,7 +99,7 @@ else local testname="$1" CR=$'\r' while read -r line; do - line="${line%$CR}" + line="${line%"$CR"}" case "${line:0:4}" in PASS) echo "ok TEST_NUMBER - ${testname}: ${line#??????}" >&3 From patchwork Sat Apr 6 12:38:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 13619799 Received: from mail-pj1-f42.google.com (mail-pj1-f42.google.com [209.85.216.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 99F3A2AD02; Sat, 6 Apr 2024 12:39:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712407168; cv=none; b=uIKv+H8+3C0LhXpubKo82yBxUYQqoWP4psAWEXbDxIzT0e1thCXY0V9JXEPcHPca/h4NsNL1sJv5nvBlTtMnX3USxHTfRqzG5Juhc7sHMDEJQLxN/mwtQCnT1Eqq/qNkv/mXhR9SEyOdhCOgrZLa6sy+E0JJHocOm+mkgev+fOY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712407168; c=relaxed/simple; bh=f797ca6qmLUHud4LT+RvBvCcJQO+xBNS9IZWMtZ/PRI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=VQNMh7Bh1OVtiLKbK69qhiA2hMp7u+ofht52KZw9YcMJbIqrzXXR38vNZQxOH1xJw38awv9cwoBbhkBwudOyNInU3wFl2/pNAHuhQSmIU0a+U0ZiR7M7ufoMCe8u/PLA8Cbhs734jtjHfM3ZLzf8R0XcMGXqHXpckwl18BjTSh0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=ZwRTw6rg; arc=none smtp.client-ip=209.85.216.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ZwRTw6rg" Received: by mail-pj1-f42.google.com with SMTP id 98e67ed59e1d1-29ddfada0d0so2184241a91.3; Sat, 06 Apr 2024 05:39:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712407167; x=1713011967; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=sB3ENgv8+Bm1tRLghaKazWKQeuX0gBEHcWKY2qfgh1Q=; b=ZwRTw6rgHQSCalaQkOgIVJBaOwaDkJ/omrQmWfDWY4w51uYTVWwdtBsZoqmXT+EWiX 9Askl+gjSx4L/F0bZ+eMUSyCx0MwiRL/eB4l8xiS3XjA+718CkzJLnlq00G7Cg71EqXO unU5WQZbSzAaRPeg+DuO/G2AckebEJ1/TgsSzIym2mAkaUq4Lh7xHvjDRM6NKzGOmORp 4/pwJ1tdlXJQL5qafg+fQIZO/VMnW3J9/k73xEYFbWElSznd0XsGp8VTgZuOjE6M9fTd VYp05FyhqBNXobvv0IEdcxQ65tAW4SuS7MjqGU78/yyQD6FRMXIK1JcEIB1lqmaOGlZ8 hdSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712407167; x=1713011967; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=sB3ENgv8+Bm1tRLghaKazWKQeuX0gBEHcWKY2qfgh1Q=; b=w+py6tiugN8esPZbIdt71CyQPJF5Iy4hflPJoSZD/SOuOXYeHNnfMblnJfW0bCiG4D SSy3NKkI+qM8RhVM8ApsWiXWIoXNNAay9m7mH/IX1QZd5HjDR1zdg26oDhpTrIj6YvQb HmQVvTK/YOS3ez/xbkEZnl5LENHfombkYa882X4oKZaziSz6ETl7f4ZeVSCMcWwGGMc1 5j/8aT2mFEIG5Yk88BPwpYQ4B6i1cNDELuQykaDmIkcGoqcSArd2nr7K8ZvuW0yRX6zh i4rRkAce2hKMMvz9P25j0P3bT2AnXnKsHDwHKfIAxw40iL2Bzeiho9WbGg/L6IMckhPD vwYg== X-Forwarded-Encrypted: i=1; AJvYcCWblGhOsiefCXqfkd4IEaWLnrQzJK/pb0IfkrZYgegKNc+MXJij9S1T3dji15KvUHx+5Akq1ZC8ttzE1b1VimYKWRINollwQCyQ15djI9maIXqVXkMMtAxDHK2l/aL1KQ== X-Gm-Message-State: AOJu0YxmsGo7g9mrSakshxnGCXJc0s8gq4smTQYDOkbvjoeqTntsRJAC LnHJfUL2vC6jilwUnmbx6iaoqZtG+pFs1Xhpkp6dhvXrHg+oMWoW X-Google-Smtp-Source: AGHT+IFsGkW61gbRnUwX+F4+qiUlZL7gQ1ZtjFZ3/rMtUrfy5XWV8+BO9FE9c5M3Fd0JMQ+twYXJKQ== X-Received: by 2002:a17:90a:1fc9:b0:2a2:1900:493 with SMTP id z9-20020a17090a1fc900b002a219000493mr3185800pjz.40.1712407167008; Sat, 06 Apr 2024 05:39:27 -0700 (PDT) Received: from wheely.local0.net (124-169-104-130.tpgi.com.au. [124.169.104.130]) by smtp.gmail.com with ESMTPSA id nt5-20020a17090b248500b002a279a86e7asm5050576pjb.7.2024.04.06.05.39.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 06 Apr 2024 05:39:26 -0700 (PDT) From: Nicholas Piggin To: Andrew Jones Cc: Nicholas Piggin , Paolo Bonzini , Thomas Huth , Alexandru Elisei , Eric Auger , Janosch Frank , Claudio Imbrenda , =?utf-8?q?Nico_B=C3=B6hr?= , David Hildenbrand , Shaoqin Huang , Nikos Nikoleris , David Woodhouse , Ricardo Koller , rminmin , Gavin Shan , Nina Schoetterl-Glausch , Sean Christopherson , kvm@vger.kernel.org, kvmarm@lists.linux.dev, kvm-riscv@lists.infradead.org, linux-s390@vger.kernel.org Subject: [RFC kvm-unit-tests PATCH v2 04/14] shellcheck: Fix SC2094 Date: Sat, 6 Apr 2024 22:38:13 +1000 Message-ID: <20240406123833.406488-5-npiggin@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240406123833.406488-1-npiggin@gmail.com> References: <20240406123833.406488-1-npiggin@gmail.com> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 SC2094 (info): Make sure not to read and write the same file in the same pipeline. This is not as clearly bad as overwriting an input file with >, but could appended characters possibly be read in from the input redirection? Reviewed-by: Andrew Jones Signed-off-by: Nicholas Piggin --- scripts/arch-run.bash | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/arch-run.bash b/scripts/arch-run.bash index 1901a929f..472c31b08 100644 --- a/scripts/arch-run.bash +++ b/scripts/arch-run.bash @@ -492,6 +492,8 @@ env_file () env_errata () { + local new_env + if [ "$ACCEL" = "tcg" ]; then export "ERRATA_FORCE=y" elif [ "$ERRATATXT" ] && [ ! -f "$ERRATATXT" ]; then @@ -500,7 +502,8 @@ env_errata () elif [ "$ERRATATXT" ]; then env_generate_errata fi - sort <(env | grep '^ERRATA_') <(grep '^ERRATA_' $KVM_UNIT_TESTS_ENV) | uniq -u >>$KVM_UNIT_TESTS_ENV + new_env=$(sort <(env | grep '^ERRATA_') <(grep '^ERRATA_' $KVM_UNIT_TESTS_ENV) | uniq -u) + echo "$new_env" >>$KVM_UNIT_TESTS_ENV } env_generate_errata () From patchwork Sat Apr 6 12:38:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 13619800 Received: from mail-pj1-f48.google.com (mail-pj1-f48.google.com [209.85.216.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6AAF52CCA0; Sat, 6 Apr 2024 12:39:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712407177; cv=none; b=pMRrKKnEXtLhEAXZFKNBP7GbNgrmDsAnKEo7VwBPusyDv6QyZUHud1SYIIgcXBPTPsk+/gNCfwJlgPzM2OkU6k+BvW6Czjure5zcxZhLYz7mTp6zmYNeCBbzfZR4IpDupRMCVddqbQUB+MhUJ1KFHEwkBlKtpkjxZBbuVtHf4JQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712407177; c=relaxed/simple; bh=U34po4updKQxQ4IZ87lCoa6hfZpy0R9FdoTvDox5LYE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=OqRjrAhDvQTJFBD8q03d1Ae+GrEWPvZeE196dRVNbzg4DfynZxn1ddUgBYD9s+B9Om7jH3TPw5MHvKqMu0jfqLP7W8KIEkhRU/6EQOs/Gt/IakYhykP5UsHabslWN4xbuq7Fg6TcO9BlKG1rwUce0rR64iuqQ4NLVHEd2N3F1QU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=FO/3bm5c; arc=none smtp.client-ip=209.85.216.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="FO/3bm5c" Received: by mail-pj1-f48.google.com with SMTP id 98e67ed59e1d1-2a2d0ca3c92so1953750a91.0; Sat, 06 Apr 2024 05:39:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712407176; x=1713011976; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ctDYQgLStioQbOFeEtouOSGyQc9IUR3PlFjjsp3HZ2Q=; b=FO/3bm5cPkuK/E6zTkpusOFcK2M4afGynmm5iQwFvZFYUi0SGondG5JeR0MqOrMi8e Mi0190QWllAf6e9At5vuch0SmhdnoiXoO/eBy2ZeNglwvUYaSfxrIjevlZJv5lF+hLp7 BOpn/8NBNRyOeIIHvuPD9fKCH4dqi7K055aERXamRUszg7Ys/ztsvwdWiaDMxtcxa/0O QtkOlMzEIjLveV5gGpEanzRBSYnjtlpjsuCU+77W8z9Pf99gYCP1/muNhWCxdlVCP1PT E85wxUIHNbXZOrOXvd8lPCIcgH/6wHvL4tcad2Dv0w/gAxH6lKhS3rwEdsAixHL3ajbu dzOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712407176; x=1713011976; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ctDYQgLStioQbOFeEtouOSGyQc9IUR3PlFjjsp3HZ2Q=; b=TVDKIFwwMwsxo7z0+XeifrTwE3GvnvVUwugcpf4koKIGuNT2C7AHF/2xVGVS0ODxat bKcrlBp2ywJtr+oXeIq0N6S4lVw1F8Z3xqxo7G4LuDDd8uPw3DcXt5kXuLiSF3NXvrMU NkDMKWwa03G/KUlxl4EjlLi1mYKnslTn/iP5lGWXc+GptAKDfl6sC3JY4aTId9THapOZ wJ21YlXLq/IpSi47f4UbNrlLAsLMr7x4+Ot7KwTvz9HXAsD61evA1bSYd/b6s77ZkT3W m4lDukN4Vx51Qc9qe9pP4B4rN95q7/Ei9SM/1YNA+Tqyo8wb+cfn7prvCEgbjiFbiyQr jQXA== X-Forwarded-Encrypted: i=1; AJvYcCXy5N9vtQiowFS5Y0xoTWIOMPOx0+U/MLYcDQIqg62yA+oc35uepaXKWb0xIv92E6eaxGDA68jRWvtLWhABWNdEVMyqC09zCUjvZjTD2JOTVndjfevJCmqTWMxjzizXtg== X-Gm-Message-State: AOJu0YxA6pebu5Dd6UVafGnGcNmGAU+EmAJQA2hnc950PJCD9o2+TN5c 8IDepTP3sdWiR10EEsUGdqXTb+4twvB2uzBpeBy+63ceIwbwd9U4 X-Google-Smtp-Source: AGHT+IFubLHuw+tn9P2k0qkE0L7n1y54S4hs/qXXktspKqdJ/DtIjqspW0ZznPjBc8pACbaNSoegBA== X-Received: by 2002:a17:90a:1109:b0:2a3:846:6a45 with SMTP id d9-20020a17090a110900b002a308466a45mr6611290pja.5.1712407175820; Sat, 06 Apr 2024 05:39:35 -0700 (PDT) Received: from wheely.local0.net (124-169-104-130.tpgi.com.au. [124.169.104.130]) by smtp.gmail.com with ESMTPSA id nt5-20020a17090b248500b002a279a86e7asm5050576pjb.7.2024.04.06.05.39.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 06 Apr 2024 05:39:35 -0700 (PDT) From: Nicholas Piggin To: Andrew Jones Cc: Nicholas Piggin , Paolo Bonzini , Thomas Huth , Alexandru Elisei , Eric Auger , Janosch Frank , Claudio Imbrenda , =?utf-8?q?Nico_B=C3=B6hr?= , David Hildenbrand , Shaoqin Huang , Nikos Nikoleris , David Woodhouse , Ricardo Koller , rminmin , Gavin Shan , Nina Schoetterl-Glausch , Sean Christopherson , kvm@vger.kernel.org, kvmarm@lists.linux.dev, kvm-riscv@lists.infradead.org, linux-s390@vger.kernel.org Subject: [RFC kvm-unit-tests PATCH v2 05/14] shellcheck: Fix SC2006 Date: Sat, 6 Apr 2024 22:38:14 +1000 Message-ID: <20240406123833.406488-6-npiggin@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240406123833.406488-1-npiggin@gmail.com> References: <20240406123833.406488-1-npiggin@gmail.com> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 SC2006 (style): Use $(...) notation instead of legacy backticks `...`. No bug identified. Reviewed-by: Andrew Jones Signed-off-by: Nicholas Piggin --- scripts/arch-run.bash | 6 +++--- scripts/runtime.bash | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/arch-run.bash b/scripts/arch-run.bash index 472c31b08..f9d1fade9 100644 --- a/scripts/arch-run.bash +++ b/scripts/arch-run.bash @@ -271,16 +271,16 @@ do_migration () qmp ${src_qmp} '"migrate", "arguments": { "uri": "unix:'${dst_incoming}'" }' > ${src_qmpout} # Wait for the migration to complete - migstatus=`qmp ${src_qmp} '"query-migrate"' | grep return` + migstatus=$(qmp ${src_qmp} '"query-migrate"' | grep return) while ! grep -q '"completed"' <<<"$migstatus" ; do sleep 0.1 - if ! migstatus=`qmp ${src_qmp} '"query-migrate"'`; then + if ! migstatus=$(qmp ${src_qmp} '"query-migrate"'); then echo "ERROR: Querying migration state failed." >&2 echo > ${dst_infifo} qmp ${dst_qmp} '"quit"'> ${dst_qmpout} 2>/dev/null return 2 fi - migstatus=`grep return <<<"$migstatus"` + migstatus=$(grep return <<<"$migstatus") if grep -q '"failed"' <<<"$migstatus"; then echo "ERROR: Migration failed." >&2 echo > ${dst_infifo} diff --git a/scripts/runtime.bash b/scripts/runtime.bash index 2d7ff5baa..f79c4e281 100644 --- a/scripts/runtime.bash +++ b/scripts/runtime.bash @@ -61,9 +61,9 @@ function print_result() local reason="$4" if [ -z "$reason" ]; then - echo "`$status` $testname $summary" + echo "$($status) $testname $summary" else - echo "`$status` $testname ($reason)" + echo "$($status) $testname ($reason)" fi } From patchwork Sat Apr 6 12:38:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 13619801 Received: from mail-pg1-f171.google.com (mail-pg1-f171.google.com [209.85.215.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7C9D62AD02; Sat, 6 Apr 2024 12:39:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712407186; cv=none; b=ns/HC5f3MnPqDihd19CDYe0Ah6aTBk3J2K2DlxpEfsO2O8GPh/acktrLloAKWOqV0T7YkSL5scESAFHqgKegSsg4r1XqcLscwyiTh7Z+QascrnCV6vR6yb7motVpD0olFA7gYR6CmymBc+uVZzE07C76fc4Bk2K+RG2o2LevN1k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712407186; c=relaxed/simple; bh=E9V+D1WzxVx771XD8ctKhzgHjEAQ4Z6qQre3e4eGKLU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DdtS2zl9MszCwvPkkN2SC5uNaZRKfaGAKPytyfGrGUKvKjaEKxCPkbVHiKubehNW7vauk2GZT8mZHPfKGQkdLRWKsVZiJ0nD5N+fkiPBiNTj5WCUPhiR9DBjYUVgCwklU5Ct4dJ2gYPP/JZpS9oU7ArlJQaxsTFbiWeRqWR5h+0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Wdr/Lauz; arc=none smtp.client-ip=209.85.215.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Wdr/Lauz" Received: by mail-pg1-f171.google.com with SMTP id 41be03b00d2f7-5cddc5455aeso2240576a12.1; Sat, 06 Apr 2024 05:39:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712407185; x=1713011985; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Qaba2L6x2dAj5DcBCo5KTsqOGBkhqsWqRrfdlHR5ju4=; b=Wdr/LauzUz3o25qo0ztHHQKCLaa9Pd4jj7CgiAF26oYRr95GlQSede9TpXi5g7NvTP DjFs6OTMKNhacgprG0Shq8Zzc/hfQZFBiZoKxGyVfzm2atFIMReJqHh9/j//gojvqqLe o2FJrS4BYqu59wl+6yyZnTFThBDv4w3cc0Odq2PB8EdAmz2B0SzWIJm14mlCRylh4l4j oH95Hp8RecqkNzSOY34EdsJ5Xqm2ry67FQRstK7EoClZ5PjRggwGxYTirC34O8I6jFIG 7CjF5BjYUDrdQGMlq2Qofwzf20khI9OHlsXy3oanhbog6A0M56wLBNpIFL1J7lpa/n2Y 3YdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712407185; x=1713011985; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Qaba2L6x2dAj5DcBCo5KTsqOGBkhqsWqRrfdlHR5ju4=; b=mxdQGIK43qv6Uu2BPw1CNXGCTqrrpgrg9B7Tixw7TUog2sz4tBeX6HZSvA0fFUjzLk lJv8g2s/oh+tI/kvHorquc/xtXKyHkjGMxFLk3BvtkmroTbNyO/T2UUWCgxnKWxuN/zj pfGGow55TpfNrgaUlY5kFvudPe59ZzdGyMxlJM5L8Dux24UYf3CfuoFXRfzTbgtddNNi 8xOkNiHoznIhJ+lI7f1gNTl4efOh6bnfqxy9tZSKUk4XSNCDKe0GCxv/sIkL5aeBVFQK MW9Akh37iZpbei2wjT5L5cXoboS6kXmK6ND4i2zHOcB8cBtGYt0EY+ISt9/Oz0JTxLTb CqQg== X-Forwarded-Encrypted: i=1; AJvYcCV/E5M4SE2H+nNvHoaF4BUti2W2wLmQGHJYLGqBl8a1k20gagwyA9IxLsoXXuSNKN+lWWfrfFRDvZJQs5oYF1e7UjtXSwo+H+HoI8DTiQnB3shVvx+NKsE5D8YiSDTV0Q== X-Gm-Message-State: AOJu0Yy1tNcldByueXim5ti9M0o+gxSw4K6C27mIwqU8Vmsog1GftcC0 7eCvaUEsdhLYFXH9mBPqmSy74JnMILDVgtLtKPepT+Eckd6TzBnU X-Google-Smtp-Source: AGHT+IHtQqbCWjek/Kw7U/EWKBnTW/ETkzN7lWi05EYkEgh8HEshJ8MsbtIGm3+uuLIyM0NGEw3xzQ== X-Received: by 2002:a17:90b:1254:b0:2a2:d4bd:d5db with SMTP id gx20-20020a17090b125400b002a2d4bdd5dbmr2957629pjb.49.1712407184811; Sat, 06 Apr 2024 05:39:44 -0700 (PDT) Received: from wheely.local0.net (124-169-104-130.tpgi.com.au. [124.169.104.130]) by smtp.gmail.com with ESMTPSA id nt5-20020a17090b248500b002a279a86e7asm5050576pjb.7.2024.04.06.05.39.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 06 Apr 2024 05:39:44 -0700 (PDT) From: Nicholas Piggin To: Andrew Jones Cc: Nicholas Piggin , Paolo Bonzini , Thomas Huth , Alexandru Elisei , Eric Auger , Janosch Frank , Claudio Imbrenda , =?utf-8?q?Nico_B=C3=B6hr?= , David Hildenbrand , Shaoqin Huang , Nikos Nikoleris , David Woodhouse , Ricardo Koller , rminmin , Gavin Shan , Nina Schoetterl-Glausch , Sean Christopherson , kvm@vger.kernel.org, kvmarm@lists.linux.dev, kvm-riscv@lists.infradead.org, linux-s390@vger.kernel.org Subject: [RFC kvm-unit-tests PATCH v2 06/14] shellcheck: Fix SC2155 Date: Sat, 6 Apr 2024 22:38:15 +1000 Message-ID: <20240406123833.406488-7-npiggin@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240406123833.406488-1-npiggin@gmail.com> References: <20240406123833.406488-1-npiggin@gmail.com> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 SC2155 (warning): Declare and assign separately to avoid masking return values. No bug identified. Reviewed-by: Andrew Jones Signed-off-by: Nicholas Piggin --- scripts/arch-run.bash | 10 +++++++--- scripts/runtime.bash | 4 +++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/scripts/arch-run.bash b/scripts/arch-run.bash index f9d1fade9..ae4b06679 100644 --- a/scripts/arch-run.bash +++ b/scripts/arch-run.bash @@ -411,7 +411,8 @@ initrd_cleanup () { rm -f $KVM_UNIT_TESTS_ENV if [ "$KVM_UNIT_TESTS_ENV_OLD" ]; then - export KVM_UNIT_TESTS_ENV="$KVM_UNIT_TESTS_ENV_OLD" + export KVM_UNIT_TESTS_ENV + KVM_UNIT_TESTS_ENV="$KVM_UNIT_TESTS_ENV_OLD" else unset KVM_UNIT_TESTS_ENV fi @@ -423,7 +424,8 @@ initrd_create () if [ "$ENVIRON_DEFAULT" = "yes" ]; then trap_exit_push 'initrd_cleanup' [ -f "$KVM_UNIT_TESTS_ENV" ] && export KVM_UNIT_TESTS_ENV_OLD="$KVM_UNIT_TESTS_ENV" - export KVM_UNIT_TESTS_ENV=$(mktemp) + export KVM_UNIT_TESTS_ENV + KVM_UNIT_TESTS_ENV=$(mktemp) env_params env_file env_errata || return $? @@ -566,7 +568,9 @@ env_generate_errata () trap_exit_push () { - local old_exit=$(trap -p EXIT | sed "s/^[^']*'//;s/'[^']*$//") + local old_exit + + old_exit=$(trap -p EXIT | sed "s/^[^']*'//;s/'[^']*$//") trap -- "$1; $old_exit" EXIT } diff --git a/scripts/runtime.bash b/scripts/runtime.bash index f79c4e281..3b76aec9e 100644 --- a/scripts/runtime.bash +++ b/scripts/runtime.bash @@ -15,7 +15,9 @@ extract_summary() # We assume that QEMU is going to work if it tried to load the kernel premature_failure() { - local log="$(eval "$(get_cmdline _NO_FILE_4Uhere_)" 2>&1)" + local log + + log="$(eval "$(get_cmdline _NO_FILE_4Uhere_)" 2>&1)" echo "$log" | grep "_NO_FILE_4Uhere_" | grep -q -e "[Cc]ould not \(load\|open\) kernel" \ From patchwork Sat Apr 6 12:38:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 13619802 Received: from mail-pf1-f178.google.com (mail-pf1-f178.google.com [209.85.210.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9A9B12869B; Sat, 6 Apr 2024 12:39:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.178 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712407195; cv=none; b=DJbFLBdYgA9V7mFMrJx3BIY7NoxcqyspXRBbIUWRJK9xEH4eaEqSfSPcvC3siIEJ9o4GsS9eTV7/duypYmEA+eHyEmRke1a4Ocj1Bpx3uCP6ft1dTjMWJ0nwzgUsxQ7u7K9A77SZJbjJSjCLj7ZnVY0V23jipYGmJrck5vyJQJQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712407195; c=relaxed/simple; bh=67jvvc1FuFkl4RrldOCyNHxO0KEc+8WgPwVH/pFMsu4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=jnsRLr6vOaY4U5sG6sDdmsLdY0PPqtWQV9wuerON10ww7SJEtpmjl6UDgrDObepf8nlDDnN6lZOPyka2PAZY7zYyy4zQA91xbc5c5pGAPMh8tuAipWeyR98uEKoisMRcOYkZzEbzWLmgkY+HQ2w1dJi0AFuIMFxHw5OvoWUTARg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=El25NFkq; arc=none smtp.client-ip=209.85.210.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="El25NFkq" Received: by mail-pf1-f178.google.com with SMTP id d2e1a72fcca58-6ea9a60f7f5so2625080b3a.3; Sat, 06 Apr 2024 05:39:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712407194; x=1713011994; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=8Amd09WCoNGafmrfuk2tT2hw4+gKyq5hmdDwUgtaokg=; b=El25NFkqx2wAK4Asz7Y6yS1et/w/43SBRdWMN1GgvbSIY8Wr5o0w9GX2J0T2hx38di 2H0cfpXr6trHBtzTerrYmjAtjHMHVfEdN45BDajqDrYVoYEIClLdMNXqua4CXFHYI8Gv 4ctk8FCFsuZf1eXgxBJOSdTQ7iTLocLR+XAFL9ezhKrKZah/in6QOPmOcpk+NF0Mm/eR jIn7tDmoqAikQZ2igdasmyN12lrZcDICgprF/nYR3kNb9gXDaLvT3gF28tFrLf0qMIOs NvewHlEB31STaE2Fe+ojrj7cdKxrIiKy208RwGt37qGoj5lXSuvNJ8b1AOzqEUlDLbk7 BUvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712407194; x=1713011994; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8Amd09WCoNGafmrfuk2tT2hw4+gKyq5hmdDwUgtaokg=; b=nTp8xMW29Itxthxzo29C0cLp70qhR17zDdpr4VLYre7KndDdLrLOjoj3ziQ3tuxbG/ 0NXN13gte9Nk5oYta7bCtHB9YcX8Gq0pNXVp+z6BL9U/hN05aEPX2/4FXSauPj1Wqego Zkw/AqGeuTTcT05YMrZxU+roebBoF6a3UAb5SAfDvH56unSTwNxyHSF20d4J76KT4G0f c67OHDoJvjfmO6iWbiKyfvE8KXBvVr1+b2/wIQaGKxwh7Ii3OT0tJ3j5zakTXU+wb98k Qd0EFYnJY1JiKuDgHbQW/mmOpnHo+H05//zGYzqCANT8Jli2ic/0W/nqgqHjNLaDe2rI LvbQ== X-Forwarded-Encrypted: i=1; AJvYcCXinZf1MIDB3raMitaIY5yOC9ah+Qm35UHIaIIdghs7yCjuYDqE5Cfzuht9LdNg91FupcyqFe0VdwvwNxXNUc23v4/rWc66GY5DvvGa4U9WFeLH2shndqkQrFYldHjhmQ== X-Gm-Message-State: AOJu0YzeOTvzIX8F9PTGWnij+DNjGHMP4HiubERub8AVx1OSQjul6KUC kTMdm/P9vs2vOdAcg0yy8kJsvDq8/fe2O5Oev8EGhLVTgl9kwf5V X-Google-Smtp-Source: AGHT+IGZi4czmCZZqDl75or3p6dCfsMOJaFJfy8Q9bSre2VzGKWSZ+VsWeTYQuMIiFbE4hVRMt9PTQ== X-Received: by 2002:a05:6a20:c90c:b0:1a3:ae18:f1e4 with SMTP id gx12-20020a056a20c90c00b001a3ae18f1e4mr3511345pzb.34.1712407193831; Sat, 06 Apr 2024 05:39:53 -0700 (PDT) Received: from wheely.local0.net (124-169-104-130.tpgi.com.au. [124.169.104.130]) by smtp.gmail.com with ESMTPSA id nt5-20020a17090b248500b002a279a86e7asm5050576pjb.7.2024.04.06.05.39.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 06 Apr 2024 05:39:53 -0700 (PDT) From: Nicholas Piggin To: Andrew Jones Cc: Nicholas Piggin , Paolo Bonzini , Thomas Huth , Alexandru Elisei , Eric Auger , Janosch Frank , Claudio Imbrenda , =?utf-8?q?Nico_B=C3=B6hr?= , David Hildenbrand , Shaoqin Huang , Nikos Nikoleris , David Woodhouse , Ricardo Koller , rminmin , Gavin Shan , Nina Schoetterl-Glausch , Sean Christopherson , kvm@vger.kernel.org, kvmarm@lists.linux.dev, kvm-riscv@lists.infradead.org, linux-s390@vger.kernel.org Subject: [RFC kvm-unit-tests PATCH v2 07/14] shellcheck: Fix SC2143 Date: Sat, 6 Apr 2024 22:38:16 +1000 Message-ID: <20240406123833.406488-8-npiggin@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240406123833.406488-1-npiggin@gmail.com> References: <20240406123833.406488-1-npiggin@gmail.com> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 SC2143 (style): Use ! grep -q instead of comparing output with [ -z .. ]. Not a bug. Reviewed-by: Andrew Jones Signed-off-by: Nicholas Piggin --- scripts/arch-run.bash | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/arch-run.bash b/scripts/arch-run.bash index ae4b06679..cd75405c8 100644 --- a/scripts/arch-run.bash +++ b/scripts/arch-run.bash @@ -61,7 +61,11 @@ run_qemu () # Even when ret==1 (unittest success) if we also got stderr # logs, then we assume a QEMU failure. Otherwise we translate # status of 1 to 0 (SUCCESS) - if [ -z "$(echo "$errors" | grep -vi warning)" ]; then + if [ "$errors" ]; then + if ! grep -qvi warning <<<"$errors" ; then + ret=0 + fi + else ret=0 fi fi From patchwork Sat Apr 6 12:38:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 13619803 Received: from mail-pf1-f173.google.com (mail-pf1-f173.google.com [209.85.210.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CE5172869B; Sat, 6 Apr 2024 12:40:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.173 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712407204; cv=none; b=bmYd/1jFKlzjYBxRo4fgnli17O22b2BsdDt9y8sH/Cjp/Jxgd8d3NK5OM1MvdeJ6ib211yJIqc1HZ5fR4kB9dPT1hSSkLClHbd3YXQl36ZXZhXjUQdxFiTzoEtGpBNiGmewNTU5GcXEosy0BruAJVjHlDXV4MnpKy3EoL+9e9+Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712407204; c=relaxed/simple; bh=C9hhWnwCALdwqG5WyS4H7F9rVkRx8HCoDY3R0fruCbQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=niNJbG9aa+dE9APtX/Cw1LQVDu3yldzkC1mc8vE4SG56R5rXH/Uz2CBdVWacHYrwS6r1V8++MT1ECyVSxa4zVAzX0teI8Pqh0xHFJAoR0Gsu9TJq8balvDg8cxEqtcQzDD/3onxe+OfJlVYUSq1GSPmFoUnP4fW/aMfZB1QnyC0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=kgGF8njm; arc=none smtp.client-ip=209.85.210.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="kgGF8njm" Received: by mail-pf1-f173.google.com with SMTP id d2e1a72fcca58-6e74aa08d15so2359976b3a.1; Sat, 06 Apr 2024 05:40:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712407202; x=1713012002; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=jc9Ns5Gs4d6EQrXAeFAipEGyYWBXJXNznus1Vgd5gEY=; b=kgGF8njm8BeaipAg+eCxdDOPU8APvq8pZqhnFfOKpIPlbUozoZbf9zAoYg4Lj4Sfwo rd6aUmtPb5xT2vH+/vjQNkmkmanurwr4NcBWposp2gLPaHZsJ1Haduq8x0dkVScuyoGb nEEXLDvY4vKSYMfcvyDAy3Y22s/5h/ysPhrB/9R8jehpKBBqlxIBUqz8WtAjyvVZ4mLY SuvIjHS0gPqzcLgWG8VLUlh4OnZlZEK7yFNIeZMYDvnhwdr7f00gzgKi1hfY4a3HPhLU 0xep0Gvb2v697r0yoEwYO/hCSJLrTOVU6sIiysQgggNeOXIpzQU5TTP0xsJDP469RETS gXjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712407202; x=1713012002; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=jc9Ns5Gs4d6EQrXAeFAipEGyYWBXJXNznus1Vgd5gEY=; b=Skgk5rNPQxlo1c1IaCi5d0vBSc2AZmaWVGLnNKtc62iANAP4a9p1vb/gyTUGO8avMK JRyHdh8+nZzTt3Ru35JdXT+RiFbbY5LibpQvq6qhqM2mNWTDCwsug/u4L/boI/dxBHSo 2BDEe3TDo2jgMLY9oT82+yxDygwjzzxuQdowTHkIVAbw4lGRTMaDmumb7WalR7s+j484 qdWDWrgZTtcv6xwaK1RTLURJYCGYygJbyTHrdDAgWWabsJg+dDpL3ipGPa/8VzLwjFbB qXhlLNzLUVINtf+rMqxZ4dk7g0zKUsyWtWr4fDIOKTw/ufLuj96S6wXEQA0pXJCM4bdt aHng== X-Forwarded-Encrypted: i=1; AJvYcCVR33alOGCmjjn3CZ0GS0SYF4aGZmr9jeU9eljUGRL2JVjwfB5ghwa+ezKYZ/CFcVkKI6xJ5YtmOo22YfYb6dClAWY4RS1Y/Ju5LVx9nJ0hDCLh7IvtoNs+Ev5ueFav2Q== X-Gm-Message-State: AOJu0YxWfp0ts/l4XkEP5iyFGApAdLuce/4XgkqRXN55GEhMVCtR/VnO SEhBXK6P1oU5VS24ApbTi5HfU4LhdJRRnuMhI5iFLy91bIpunHBL X-Google-Smtp-Source: AGHT+IGFqwzSPVPQ9YT3jplB+7wqnHfvH8TCbOoaXrxURWMaPygGn8PVC/qsnNpJzSZ+kKAlRUuDBA== X-Received: by 2002:a05:6a20:12ca:b0:1a7:c63:add2 with SMTP id v10-20020a056a2012ca00b001a70c63add2mr5190444pzg.10.1712407202215; Sat, 06 Apr 2024 05:40:02 -0700 (PDT) Received: from wheely.local0.net (124-169-104-130.tpgi.com.au. [124.169.104.130]) by smtp.gmail.com with ESMTPSA id nt5-20020a17090b248500b002a279a86e7asm5050576pjb.7.2024.04.06.05.39.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 06 Apr 2024 05:40:01 -0700 (PDT) From: Nicholas Piggin To: Andrew Jones Cc: Nicholas Piggin , Paolo Bonzini , Thomas Huth , Alexandru Elisei , Eric Auger , Janosch Frank , Claudio Imbrenda , =?utf-8?q?Nico_B=C3=B6hr?= , David Hildenbrand , Shaoqin Huang , Nikos Nikoleris , David Woodhouse , Ricardo Koller , rminmin , Gavin Shan , Nina Schoetterl-Glausch , Sean Christopherson , kvm@vger.kernel.org, kvmarm@lists.linux.dev, kvm-riscv@lists.infradead.org, linux-s390@vger.kernel.org Subject: [RFC kvm-unit-tests PATCH v2 08/14] shellcheck: Fix SC2013 Date: Sat, 6 Apr 2024 22:38:17 +1000 Message-ID: <20240406123833.406488-9-npiggin@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240406123833.406488-1-npiggin@gmail.com> References: <20240406123833.406488-1-npiggin@gmail.com> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 SC2013 (info): To read lines rather than words, pipe/redirect to a 'while read' loop. Not a bug. Signed-off-by: Nicholas Piggin Reviewed-by: Andrew Jones --- scripts/arch-run.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/arch-run.bash b/scripts/arch-run.bash index cd75405c8..45ec8f57d 100644 --- a/scripts/arch-run.bash +++ b/scripts/arch-run.bash @@ -487,7 +487,7 @@ env_file () [ ! -f "$KVM_UNIT_TESTS_ENV_OLD" ] && return - for line in $(grep -E '^[[:blank:]]*[[:alpha:]_][[:alnum:]_]*=' "$KVM_UNIT_TESTS_ENV_OLD"); do + grep -E '^[[:blank:]]*[[:alpha:]_][[:alnum:]_]*=' "$KVM_UNIT_TESTS_ENV_OLD" | while IFS= read -r line ; do var=${line%%=*} if ! grep -q "^$var=" $KVM_UNIT_TESTS_ENV; then eval export "$line" From patchwork Sat Apr 6 12:38:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 13619804 Received: from mail-pf1-f174.google.com (mail-pf1-f174.google.com [209.85.210.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6C4502869B; Sat, 6 Apr 2024 12:40:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712407212; cv=none; b=g/egYebXljoPXH4ihs2lXf1gnBDbw9DEF+wyeJ/ku/A3XwEP1a+JQVvz13lnDzFPcGiYlHe4F0Xgmdl0YKUSpdhdp8x52VIIEgADy4icYix5u1uX+bAAuMooJUOojXm/VPCe7Ub4KCkWPzmSIGM+1Pv7+JUYrmB7n+TXF5NvTr4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712407212; c=relaxed/simple; bh=BtK71PP95PMC4Hzbtxe4zhZtffb72GLFVB/PQAL00a0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ubG6KI9JruQD0J6ejg8zJeki/pPb/LOX8N1W229HTTGX/JliDsqe1h11X50saOdjwh76F9ipKbWbp3eMstvCfcJhcHB8mm1Mg5pXHLijkCyYZwk95I3lyXKfFiYx4NkyEb6GBp7/F80WWKnkJ25JjAH+93/hSJwI9YEA8ZgSUHM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Nre7uVSv; arc=none smtp.client-ip=209.85.210.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Nre7uVSv" Received: by mail-pf1-f174.google.com with SMTP id d2e1a72fcca58-6e6b22af648so2980169b3a.0; Sat, 06 Apr 2024 05:40:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712407211; x=1713012011; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=+DuXv8jLymFAc3dj84mPa+u6v5joW+GUy7CVoN0Mom8=; b=Nre7uVSvbwMtjIOmmWfgrPZvr25qmWqwmRCVA9P7GD0aRaucpm3How4Tr1HzAI0G6G irA9Pd7gjK6Nk35sdHgiW1nRwY4axeLWOknNpOLz35sXYXt2vr/MuliCjSjf8yOb+cSg mq0yd3SzfmbJZpeuf5llLJpWfn0VmnbWTSIf2fcLkdaWUytja4s7LAER5vXTaolq8qZ6 yHvCdg7hyN8LxtXo4OZVhQncGXXs/2nXuLnu//s3WvO/yh+3pJsZm+GSqUFlHIOb+OUH WcIrv6/xMLcXmfO/DB9dbD/PAPZfXRV5amSxQVKYz4eaJJ3It6AmZRisa9RAjCJEAnDv nvSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712407211; x=1713012011; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+DuXv8jLymFAc3dj84mPa+u6v5joW+GUy7CVoN0Mom8=; b=U2ebr1ZEYdroeBs917nFJTEHzxUKKNO51L0hDSLEaLCsriZwj6A5ExMSBSvsN5sQpt UBFhmfUf8b8DNfMEzmG10R/qwluybhlNvNzNY7tZb5+ZzgC263sK832n4aydnrGlq8MS A9QldYwQyAUKCrXDfixbC6bLkwEC1aay2ei2gVR+AG4B6YBKUf97TzAiR3s7AIKZRpWv PMcGHvpGyvQQn5Z/uxcJEoWlAy7u9giD794B8xipjWKNPo8IPthdR/vc99/zdY5s/AtY QdYKP43e9SQ53L/BWY9FUOWdIKXiTdnaWKxG+lQk0C0MvTr2qz2s/OrhRbOcYYTqZk07 7usQ== X-Forwarded-Encrypted: i=1; AJvYcCW6wzgmsnHYmUjzuUJ6iHLsX/Eh3Ecohel3aXO8m9Xe7ko1e/LJGjF7hPM5LiNZXwSBM2Kx0H1a7eFfWtz3T5nup5h5z6k4QSUkJE++KXBjy2W097id5gcu/8U9Aj5IxQ== X-Gm-Message-State: AOJu0YzoGXr+uP+H82f8oq2/7jILOMC8TPW/dBDbAFbZA5tK6wKIjx4t GLHgc1JzfSpXsnf3tq5UPBEHOK2nXqaYtgR/+HsHUymtI42pD2RH X-Google-Smtp-Source: AGHT+IEG5DwuJ6rWhrJoMat7kd4rj//Ns4BzAmacd0b/2q33I7gOlOkW3W7COJMdw+lJbq3lxrimmg== X-Received: by 2002:a17:90b:1b04:b0:2a0:4a82:5b05 with SMTP id nu4-20020a17090b1b0400b002a04a825b05mr7263902pjb.19.1712407210832; Sat, 06 Apr 2024 05:40:10 -0700 (PDT) Received: from wheely.local0.net (124-169-104-130.tpgi.com.au. [124.169.104.130]) by smtp.gmail.com with ESMTPSA id nt5-20020a17090b248500b002a279a86e7asm5050576pjb.7.2024.04.06.05.40.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 06 Apr 2024 05:40:10 -0700 (PDT) From: Nicholas Piggin To: Andrew Jones Cc: Nicholas Piggin , Paolo Bonzini , Thomas Huth , Alexandru Elisei , Eric Auger , Janosch Frank , Claudio Imbrenda , =?utf-8?q?Nico_B=C3=B6hr?= , David Hildenbrand , Shaoqin Huang , Nikos Nikoleris , David Woodhouse , Ricardo Koller , rminmin , Gavin Shan , Nina Schoetterl-Glausch , Sean Christopherson , kvm@vger.kernel.org, kvmarm@lists.linux.dev, kvm-riscv@lists.infradead.org, linux-s390@vger.kernel.org Subject: [RFC kvm-unit-tests PATCH v2 09/14] shellcheck: Fix SC2145 Date: Sat, 6 Apr 2024 22:38:18 +1000 Message-ID: <20240406123833.406488-10-npiggin@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240406123833.406488-1-npiggin@gmail.com> References: <20240406123833.406488-1-npiggin@gmail.com> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 SC2145 (error): Argument mixes string and array. Use * or separate argument. Shouldn't be a bug, since the preceding string ends with a space and there aren't any succeeding strings. Reviewed-by: Andrew Jones Signed-off-by: Nicholas Piggin --- arm/efi/run | 2 +- riscv/efi/run | 2 +- scripts/mkstandalone.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arm/efi/run b/arm/efi/run index f07a6e55c..cf6d34b0b 100755 --- a/arm/efi/run +++ b/arm/efi/run @@ -87,7 +87,7 @@ uefi_shell_run() if [ "$EFI_DIRECT" = "y" ]; then $TEST_DIR/run \ $KERNEL_NAME \ - -append "$(basename $KERNEL_NAME) ${cmd_args[@]}" \ + -append "$(basename $KERNEL_NAME) ${cmd_args[*]}" \ -bios "$EFI_UEFI" \ "${qemu_args[@]}" else diff --git a/riscv/efi/run b/riscv/efi/run index 982b8b9c4..cce068694 100755 --- a/riscv/efi/run +++ b/riscv/efi/run @@ -97,7 +97,7 @@ if [ "$EFI_DIRECT" = "y" ]; then fi $TEST_DIR/run \ $KERNEL_NAME \ - -append "$(basename $KERNEL_NAME) ${cmd_args[@]}" \ + -append "$(basename $KERNEL_NAME) ${cmd_args[*]}" \ -machine pflash0=pflash0 \ -blockdev node-name=pflash0,driver=file,read-only=on,filename="$EFI_UEFI" \ "${qemu_args[@]}" diff --git a/scripts/mkstandalone.sh b/scripts/mkstandalone.sh index 86c7e5498..756647f29 100755 --- a/scripts/mkstandalone.sh +++ b/scripts/mkstandalone.sh @@ -76,7 +76,7 @@ generate_test () cat scripts/runtime.bash - echo "run ${args[@]}" + echo "run ${args[*]}" } function mkstandalone() From patchwork Sat Apr 6 12:38:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 13619805 Received: from mail-pj1-f44.google.com (mail-pj1-f44.google.com [209.85.216.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7A5BBBA55; Sat, 6 Apr 2024 12:40:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712407221; cv=none; b=QSxywEYNfpJnsV/znhnz38pyWho66cyUVSa3vM1ZTBNaic1HkALaSI6fBTWBM+A5ByJ1qxV8j68Py4XaO7qkly/H6TiRMc1Vtdlkc6Us8qe2Arcvhr2U86JUvIkWG8wgG8G+8Pdx3Y3EyU37qFyH5bTMtU6DhkYuRb56lsurlec= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712407221; c=relaxed/simple; bh=SBC9goY0qyeWaqVZEk5sqx6PBhg4VTZbRSRTA2YHwJw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=qL0h9thPiZLSdw0rdlne0JNpMHM1UgLY0KXZjMDCrhTNClEPM6t2I7y4lk9oopk1+6dszQDaDHcDy6VwGLIVH41/df1veu1DOTdFeX3zF3W9aqTr/9bFdm0kt37aNsqkZKAtifki8G+wTntmwXpaBptBInjW8/aHgkfRFZtaG8s= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Trq5zL+K; arc=none smtp.client-ip=209.85.216.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Trq5zL+K" Received: by mail-pj1-f44.google.com with SMTP id 98e67ed59e1d1-2a07b092c4fso2314257a91.0; Sat, 06 Apr 2024 05:40:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712407220; x=1713012020; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=CWoWbY1l8dnEVRR/nSiK5WHJ8+U9imW08rrrMnGNnqQ=; b=Trq5zL+KcSGYQmfaIemIEMcueBpAHIONUNlF9NEy7nC3H7mABxE3jshfkd4gp8svOA qlJ9Nu4ocrwZioM+FP7cpxTSFOvXbEqV2MstvCAjFP3+JOf4btEdvpGjvbUSuVzW5rek 8vxb6lQecYawrwZ1pfiCfMZpHpROCqAbzRNtzDqjubj7nMen2Hwz+/jWSmDiMsxUBRyQ j/3T+9K1fAGg1pCsrCI4Ass6kAVJGmvQP1FwQ9KYY9t3QU2CNjsXvgISJtXh1whfRedx J/aU1B8ThstawAC7f28YYSjfi6PR3nFkFpeTx7gP21Ru7lcKuCrZHZgz1+1071A3I7r7 0DwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712407220; x=1713012020; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=CWoWbY1l8dnEVRR/nSiK5WHJ8+U9imW08rrrMnGNnqQ=; b=tt2lLLGG3GomUmK0MtnGKlwZ7n+et6MImqLxBrcwxVIUhYqLy/F40fI/JDEXgyIasq BZjhBBp+MYSlxmc7FNzMQY23En7fRHuzX62HIVx4QWcToNvHUOiVzzvLtV/awfx/IEX6 nOsnMW6W67pgvpr3DGZa2U1nZX51+qPY/t4lEmL3trtcVicKJlpPixnufIzPsE79rb24 Pe1izMJIANsrCGiOS48Q+oSJtsCbn4QXUj1RhQ8HveBm1hGEPprr5jRymIH8vNJZk9pv vu+e+dsx/rWN4gNpZGXdZ87xk33j7aRU8GeY//JoflSFbVeiCIXmdO71ll6zh3OJtyW9 8Dyg== X-Forwarded-Encrypted: i=1; AJvYcCU49AWoz/Rq5t5jUWLHuaGXZ/FWXN5k4LChEAu1KyPNV2ng+hAAs1KRUMZ5Ghw802IRAHIXFrZXj/hy59LDN3slI6bYRSo0r5ql5befSastm5RKG38Gv0ZrZUowbiXICg== X-Gm-Message-State: AOJu0YzPkbhlrxfxLSh8rnRcul4VYaE8NsIXap3ELkqehOAs1XMnPsol 9Cdyj0wYPeygkPNkbO4dohEpc0hRcbiEXcvLCyFpD3WVwKsMnX2E X-Google-Smtp-Source: AGHT+IFHZE4Fp2p4OLXDHn3qLZhQ0/SVNeTRqByuHLNxp4zQxBJuEy3e052DXS99usoJooGncv3JtA== X-Received: by 2002:a17:90a:c797:b0:29c:761e:3955 with SMTP id gn23-20020a17090ac79700b0029c761e3955mr3301807pjb.17.1712407219870; Sat, 06 Apr 2024 05:40:19 -0700 (PDT) Received: from wheely.local0.net (124-169-104-130.tpgi.com.au. [124.169.104.130]) by smtp.gmail.com with ESMTPSA id nt5-20020a17090b248500b002a279a86e7asm5050576pjb.7.2024.04.06.05.40.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 06 Apr 2024 05:40:19 -0700 (PDT) From: Nicholas Piggin To: Andrew Jones Cc: Nicholas Piggin , Paolo Bonzini , Thomas Huth , Alexandru Elisei , Eric Auger , Janosch Frank , Claudio Imbrenda , =?utf-8?q?Nico_B=C3=B6hr?= , David Hildenbrand , Shaoqin Huang , Nikos Nikoleris , David Woodhouse , Ricardo Koller , rminmin , Gavin Shan , Nina Schoetterl-Glausch , Sean Christopherson , kvm@vger.kernel.org, kvmarm@lists.linux.dev, kvm-riscv@lists.infradead.org, linux-s390@vger.kernel.org Subject: [RFC kvm-unit-tests PATCH v2 10/14] shellcheck: Fix SC2124 Date: Sat, 6 Apr 2024 22:38:19 +1000 Message-ID: <20240406123833.406488-11-npiggin@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240406123833.406488-1-npiggin@gmail.com> References: <20240406123833.406488-1-npiggin@gmail.com> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 SC2124 (warning): Assigning an array to a string! Assign as array, or use * instead of @ to concatenate. Shouldn't be a bug since bash concatenates with space and eval is used on the result. Reviewed-by: Andrew Jones Signed-off-by: Nicholas Piggin --- scripts/arch-run.bash | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/arch-run.bash b/scripts/arch-run.bash index 45ec8f57d..95b6fa64d 100644 --- a/scripts/arch-run.bash +++ b/scripts/arch-run.bash @@ -150,7 +150,7 @@ run_migration () return 77 fi - migcmdline=$@ + migcmdline=("$@") trap 'trap - TERM ; kill 0 ; exit 2' INT TERM trap 'rm -f ${src_out} ${dst_out} ${src_outfifo} ${dst_outfifo} ${dst_incoming} ${src_qmp} ${dst_qmp} ${src_infifo} ${dst_infifo}' RETURN EXIT @@ -179,7 +179,7 @@ run_migration () exec {src_infifo_fd}<>${src_infifo} exec {dst_infifo_fd}<>${dst_infifo} - eval "$migcmdline" \ + eval "${migcmdline[@]}" \ -chardev socket,id=mon,path=${src_qmp},server=on,wait=off \ -mon chardev=mon,mode=control \ < ${src_infifo} > ${src_outfifo} & @@ -219,7 +219,7 @@ run_migration () do_migration () { - eval "$migcmdline" \ + eval "${migcmdline[@]}" \ -chardev socket,id=mon,path=${dst_qmp},server=on,wait=off \ -mon chardev=mon,mode=control -incoming unix:${dst_incoming} \ < ${dst_infifo} > ${dst_outfifo} & From patchwork Sat Apr 6 12:38:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 13619806 Received: from mail-pj1-f46.google.com (mail-pj1-f46.google.com [209.85.216.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EADB04C84; Sat, 6 Apr 2024 12:40:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712407230; cv=none; b=bvISg0e2jRngDMDkEbJu7jGsRc6YuhR6An5dOxKW998eMBYU7J+26zyTAXXkPynruQQm4x4sGZPmD2SWLNQJXTeDuE1ebquW/ctgPHTvsiXnT4GaxW0ImTsYJcj/SJ3MToUkXXcUGhwg1+6J6q88XHrfqKYSFPQDVK9LVkTfDVQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712407230; c=relaxed/simple; bh=FFft7ygHb4sNew26D/dJgFST62xDvyHht1DMBSvtx6w=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=qiiyn+CdW8+qDZTRzvO8PJpXKaWIBjCjIWKcowIzwVs+qIytzkTpO89S7CuQZVxf0goyeYhn2fhult6VoD+JWvldo3DJbfVLf/nNri76xLFAJA1obRZXC4qKGFr3T3WmBpeyXr4FrUId4MgmfXqCOXuvw4PRlEEA731HWafcIQU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=ESjwq3m6; arc=none smtp.client-ip=209.85.216.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ESjwq3m6" Received: by mail-pj1-f46.google.com with SMTP id 98e67ed59e1d1-2a2e5d86254so1731584a91.1; Sat, 06 Apr 2024 05:40:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712407228; x=1713012028; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=DtN3qRr/BJ5ghrfuBVmkjt4OGFVHY6H/GotGGIKP5Pw=; b=ESjwq3m6RGKkkfq4a/ddZX7IvMzSFEeywSpJXdmGS+OAgzA06GW/8mlGWyDPDkoSfO I1adyOH+qp5VYdFvnC0FUb5LcrIirDYrVDZ5cuYCR7DMlaRkLNGmvSa/AcmXdv3Dw/jG YyfFFVSDY/dRIr48YuQHm5Kxh7s+5E+Pr31vPyKEjHjqhy2IUrIj9pfFghVWTq6o5cOd mzsvetsXeYg/TAblGMdz24/gugd92GQD6jmw1HFWmoqsWJrRG1S7w/zFQDxVqPS8QMox OxfW3zH7KsVBMjOREO8wA+/NwUMhWYgEupuSq/kqSsCfBD4ks8URgHA6JKmqD/tx9Trx mNUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712407228; x=1713012028; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=DtN3qRr/BJ5ghrfuBVmkjt4OGFVHY6H/GotGGIKP5Pw=; b=eaM5tngs2Nz9SkljKk/a/Nl2YZNTSFMheGe1Kayxntj1a8wryg2g6DK4/q8gae61fW 1oipeFzLQOm9iUZHxXI1IK6XHfNODDyqZYYjsunST+wO0/LvA4P6BlciYO1jqjICAFoI DP86J4HCam5NmJyW+wY5626suGYjq8pLjVkLCOTqK1/TfwyhF7KWtZqqAawitCo0Tn0P 5K6g1TIG94JDmMxBvB5okQ5RbeDgmCtCj8pLOS3xTnsIOkUy7DZeb+B/Bj4KdpkoqKwN YiYs95tJ1DQ9akNxPBH55XI8U29osBA4M0oArOSigkPIEV88PjyoGlyJsmNAsoVwjUHL /fnQ== X-Forwarded-Encrypted: i=1; AJvYcCWJ+Vf+IY2UG4jM9LcojM08bPlY0oG8EH1eFKUX80J3OIlk6Gqi3pAMmX0P1Ph2V4VlVYD4SwfutNj2E13DY4H9dC7RGu0Dqq7Zu+wRgAe3qr2ZbC3snJepM92VUs+NdQ== X-Gm-Message-State: AOJu0YymxdbRe+LdsMFTKzP96v3Hszh5VMXjJc1DGluzscY80xl9+fuy 2+1cLN7luwRTgi6iDeyFvI6QCcFB5+dx11sunNmLHbcW2IezkEVE X-Google-Smtp-Source: AGHT+IE7xfGD09MIaUCfQ0PlF2nHZILjJWkZ4PfKwm4uXDYYCAtdwhtHcBBozUYIc7FVTGi7mIF6mw== X-Received: by 2002:a17:90a:4e06:b0:2a2:c812:9648 with SMTP id n6-20020a17090a4e0600b002a2c8129648mr6948766pjh.9.1712407228261; Sat, 06 Apr 2024 05:40:28 -0700 (PDT) Received: from wheely.local0.net (124-169-104-130.tpgi.com.au. [124.169.104.130]) by smtp.gmail.com with ESMTPSA id nt5-20020a17090b248500b002a279a86e7asm5050576pjb.7.2024.04.06.05.40.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 06 Apr 2024 05:40:28 -0700 (PDT) From: Nicholas Piggin To: Andrew Jones Cc: Nicholas Piggin , Paolo Bonzini , Thomas Huth , Alexandru Elisei , Eric Auger , Janosch Frank , Claudio Imbrenda , =?utf-8?q?Nico_B=C3=B6hr?= , David Hildenbrand , Shaoqin Huang , Nikos Nikoleris , David Woodhouse , Ricardo Koller , rminmin , Gavin Shan , Nina Schoetterl-Glausch , Sean Christopherson , kvm@vger.kernel.org, kvmarm@lists.linux.dev, kvm-riscv@lists.infradead.org, linux-s390@vger.kernel.org Subject: [RFC kvm-unit-tests PATCH v2 11/14] shellcheck: Fix SC2294 Date: Sat, 6 Apr 2024 22:38:20 +1000 Message-ID: <20240406123833.406488-12-npiggin@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240406123833.406488-1-npiggin@gmail.com> References: <20240406123833.406488-1-npiggin@gmail.com> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 SC2294 (warning): eval negates the benefit of arrays. Drop eval to preserve whitespace/symbols (or eval as string). No bug identified. Reviewed-by: Andrew Jones Signed-off-by: Nicholas Piggin --- scripts/arch-run.bash | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/arch-run.bash b/scripts/arch-run.bash index 95b6fa64d..98d29b671 100644 --- a/scripts/arch-run.bash +++ b/scripts/arch-run.bash @@ -179,7 +179,7 @@ run_migration () exec {src_infifo_fd}<>${src_infifo} exec {dst_infifo_fd}<>${dst_infifo} - eval "${migcmdline[@]}" \ + "${migcmdline[@]}" \ -chardev socket,id=mon,path=${src_qmp},server=on,wait=off \ -mon chardev=mon,mode=control \ < ${src_infifo} > ${src_outfifo} & @@ -219,7 +219,7 @@ run_migration () do_migration () { - eval "${migcmdline[@]}" \ + "${migcmdline[@]}" \ -chardev socket,id=mon,path=${dst_qmp},server=on,wait=off \ -mon chardev=mon,mode=control -incoming unix:${dst_incoming} \ < ${dst_infifo} > ${dst_outfifo} & @@ -357,7 +357,7 @@ run_panic () qmp=$(mktemp -u -t panic-qmp.XXXXXXXXXX) # start VM stopped so we don't miss any events - eval "$@" -chardev socket,id=mon,path=${qmp},server=on,wait=off \ + "$@" -chardev socket,id=mon,path=${qmp},server=on,wait=off \ -mon chardev=mon,mode=control -S & panic_event_count=$(qmp_events ${qmp} | jq -c 'select(.event == "GUEST_PANICKED")' | wc -l) From patchwork Sat Apr 6 12:38:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 13619807 Received: from mail-pg1-f172.google.com (mail-pg1-f172.google.com [209.85.215.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 610E72869B; Sat, 6 Apr 2024 12:40:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712407240; cv=none; b=NPE7W3OrOV7KaRaQYvK7Y/RnjZiibU4v9WjEDDJt8ZdrDztkan2dnVrd0Fzx80SchMXBqg2GTyCpPFSK74aINNzPyelAHUp+uk5XQxQBPXlOq/7MQuCedcVfX/IG/5T8kSJezhfPouDZ3xhCoJWlIKFTG8oy1+bG+lCQvxTDE/M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712407240; c=relaxed/simple; bh=gGUa3K9zILUvgF5PKH8SMZ/qnhdZyUnL8GXR2wj6lXM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=bijAuF0ujk4Ooukj6IG8pnocn92LC/xdWL6U3AIIp/s/MX70mCmoF3P3rU9JCvIt2mTrkRWXNU6TmjPhUYL+uMuT8YJQRxZ8IuVJHA7CPmoic0vbPgx3jCq/p1xkR8nM6rUwlx2bYsB/MS6VTNjK15Qw2/15jM6qZKl54STk0Xs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=m+4qc/Kv; arc=none smtp.client-ip=209.85.215.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="m+4qc/Kv" Received: by mail-pg1-f172.google.com with SMTP id 41be03b00d2f7-5e4613f2b56so2685907a12.1; Sat, 06 Apr 2024 05:40:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712407238; x=1713012038; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=2eRtFguiVvn3b4AxH0QU+OXVRgeLtifhqAQZ/pJYpnQ=; b=m+4qc/Kv76lMdfngJiY86fUd/6PtHbxCQYZfc0ADkF28vXC8XoeyqBjlm2E9VWvFxb 4b/urcvC3hQ/oDTLFrR/ooBaKLQD9PgFGjS8JsPl9GmzXtJGv/a2NlBXd5PM/1u6IVgW G9yQnciTHw9mWqpEu0TkbDOf2zP7W8+ZiKGQzskVh8oNOCOyRjzhKI8RE0CZ8Wsd3UK0 SKu+YDiwA5PJ0XB3yqzf8fXLTzDkjPjDGr1CaL5vtPI0Ox5v0nOiTdmOPxUjKtLd7UcQ ia79JbxCtksxEdltvziXH81IDB+8fn9c3j3qHjf7HZQ7RTCEDx6UAFXf0bbP/qjm3G/u 8rjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712407238; x=1713012038; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2eRtFguiVvn3b4AxH0QU+OXVRgeLtifhqAQZ/pJYpnQ=; b=nVR3zsDOECsEco6IS4drxk1PJDaJd1cKoaPtWCGXraZONQniTMQbhDgiqj9Jj9xpgS rj2E/UNeOOCqGmDUtCAZPwDIJXnKRPi2LPfCKdIwbJOuSOVjtqX3IXnw0+huzO9dgZxd D+N8gk07WVGsQAYCdUjQlZpFm9baUBeSxnx5PDJt3mQDLsElFz+Uk6dPp440+3DLSSVQ cMo9MeVgFekg8+O9EeCgOixaTEmD8qPBukq2Z0vnKZb3lUYk79eHhF29LzRfGQ9xTCnk uBfarDzOQEPbBF9B8AaH9XB2pM2zTBWKHtVKWi0kCJaj63sEpXP8Eh9I0zgZmP/5xbT2 vN6w== X-Forwarded-Encrypted: i=1; AJvYcCUh6GVXR3Cfc62warXhiGlaKt+sKe+0cZxiXVm7J4S5GMECKhtvhkeKP0/plo1m27F/+2sJWpE2E3aMfz+iEtlCFSz1Jk87KmYCuYwXL60BQEnAl1z6uITlx+p1rn0YFg== X-Gm-Message-State: AOJu0Yz9mBr+Gg+LIA8HmpD/VATf5iLdS/d4ECjmxmg1ZiTq7i8tn+yE kU4tbX8IsXOACWXAH1Pe9zD9jD2fIFjTiH2+CHc6lF8AJdPRMQQ+ X-Google-Smtp-Source: AGHT+IFRwkbTF8lHFVWUWdHITKOoyi+cM/zQNImgd0YNfpYQL2AebNpOitSBxxkyLMi56+NDz70TCQ== X-Received: by 2002:a05:6a20:1587:b0:1a3:9fa6:74f6 with SMTP id h7-20020a056a20158700b001a39fa674f6mr4468400pzj.58.1712407237671; Sat, 06 Apr 2024 05:40:37 -0700 (PDT) Received: from wheely.local0.net (124-169-104-130.tpgi.com.au. [124.169.104.130]) by smtp.gmail.com with ESMTPSA id nt5-20020a17090b248500b002a279a86e7asm5050576pjb.7.2024.04.06.05.40.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 06 Apr 2024 05:40:37 -0700 (PDT) From: Nicholas Piggin To: Andrew Jones Cc: Nicholas Piggin , Paolo Bonzini , Thomas Huth , Alexandru Elisei , Eric Auger , Janosch Frank , Claudio Imbrenda , =?utf-8?q?Nico_B=C3=B6hr?= , David Hildenbrand , Shaoqin Huang , Nikos Nikoleris , David Woodhouse , Ricardo Koller , rminmin , Gavin Shan , Nina Schoetterl-Glausch , Sean Christopherson , kvm@vger.kernel.org, kvmarm@lists.linux.dev, kvm-riscv@lists.infradead.org, linux-s390@vger.kernel.org Subject: [RFC kvm-unit-tests PATCH v2 12/14] shellcheck: Fix SC2178 Date: Sat, 6 Apr 2024 22:38:21 +1000 Message-ID: <20240406123833.406488-13-npiggin@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240406123833.406488-1-npiggin@gmail.com> References: <20240406123833.406488-1-npiggin@gmail.com> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 SC2178 (warning): Variable was used as an array but is now assigned a string. No bug identified. Reviewed-by: Andrew Jones Signed-off-by: Nicholas Piggin --- arm/efi/run | 2 +- riscv/efi/run | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arm/efi/run b/arm/efi/run index cf6d34b0b..8f41fc02d 100755 --- a/arm/efi/run +++ b/arm/efi/run @@ -44,7 +44,7 @@ qemu_args=() cmd_args=() while (( "$#" )); do if [ "$1" = "-append" ]; then - cmd_args=$2 + cmd_args=("$2") shift 2 else qemu_args+=("$1") diff --git a/riscv/efi/run b/riscv/efi/run index cce068694..5a72683a6 100755 --- a/riscv/efi/run +++ b/riscv/efi/run @@ -47,7 +47,7 @@ qemu_args=() cmd_args=() while (( "$#" )); do if [ "$1" = "-append" ]; then - cmd_args=$2 + cmd_args=("$2") shift 2 else qemu_args+=("$1") From patchwork Sat Apr 6 12:38:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 13619808 Received: from mail-pj1-f44.google.com (mail-pj1-f44.google.com [209.85.216.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EB809208D0; Sat, 6 Apr 2024 12:40:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712407248; cv=none; b=bnk3X5/kKmkZPNNCYiQDD4HDF0XMEVweOrgafN0zSuxB4mfbHFRaVwoWWJwxhmQMeJp1Y+l//gM7Dzgn1gQXrWOK2xU61DzC3IRzmTulKeVGjXhr4afRzLPYCl1aHFgNC6A4+MqrThQqQsuZ3AnJMaZtnwwOO8H6XkeB91iUMlE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712407248; c=relaxed/simple; bh=od27buX75qlekTIQxkP3UT5fuV09JndQX6FYD2vHQr8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=PkN25EpYyKHJF2DKfDKXkbk5SA40iPfF2WlD2GvMXwegNSHgb+9yxIsWI4FKwgvJ5Qr0CF+cLZTh1OG3e+pf1POHXix+nLGtwfkzKwDXWhvicvEiqMmijTMVvWSMhgDu45Qb26dzuqKF50CVHNjoOmCFUxIRmWF0lofyzDd7knc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=T5BVMllI; arc=none smtp.client-ip=209.85.216.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="T5BVMllI" Received: by mail-pj1-f44.google.com with SMTP id 98e67ed59e1d1-29e0229d6b5so2425746a91.3; Sat, 06 Apr 2024 05:40:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712407246; x=1713012046; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=74FZsPss0kwxe9NqMeWaPReIQrTUACvwkEx+kD2VIoc=; b=T5BVMllIxM4BYjflRB6a2BOZ6VkXne1vvkzc7QW0jwefGBrL0stkZ8O/iCYX3+vy0h as7Dk4R6CxLtrsUdYt0mnUPZmf9ietsJjSpq1/grbZSS6Z8VqPyWZnk2Ls48tIqjg9Ci XEm2m8DCxPMoLslal/YNTfKR65aBAPPaPni9RXG7PReTafBlK1yzq7Mf6/hfbETygZ+6 qkKRR41hnc7tNSQV03aRpDRTfiSk0OWGYQTum29MuXGcGRCYgfnPfotFlcx5Z2P91oER JdQsIY1D1rdze9uMjW3jA0j8wocVYr6L+B3fEKx08v8nb0zFiy8tah9wLJEX2KVZDn+x FN+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712407246; x=1713012046; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=74FZsPss0kwxe9NqMeWaPReIQrTUACvwkEx+kD2VIoc=; b=fxh/F0ExJfqw+Jt8cUjUqjMsaQfM1e1noi0TAjptEkYHKWz630wuCUDSGdPRRcu5TF +qlVXdiLBqexNjbNzhdku4Wve1K1LXnC4I8N13MeFZsWL+MPHE9e70+RgZ03zrrlJ6nj jWXV1bjDCXN0VUV/DMs92ZGW9o5XeG5rt12i9JhJjzIIN+A+z/nTvb/pbQfu5nSK/mnh mXkfzaUWEWjB/BEmvgykoizzcU4kYXcMfWNNW1+kxrLfTtuGae7A89waXS9DF8Ea1HGq 83MJ8re2j5GJuczYDVPGDiXYJAXkxJB0ZUysuizW72cvNkRKyOSEiLUkNtvnIvG2IYFx tCdA== X-Forwarded-Encrypted: i=1; AJvYcCUm50enerGpQglDy9DuWZNma4/vLI7EVGkG0Dqa9GRO9WoHfJWFig1ijToO2Ptii00jYB5CahHIkQpA5H/IWUUmTOU55ymFNCSMx057IpDuG1uiQ13eVcD0kxN55tZo6A== X-Gm-Message-State: AOJu0YwuYE7oqZzDp7Up6oqJXjZlLIULkq5O8R3ltGRgp6yTI3jXQpvn CB+2WPjqi1fkAbZyT1nZDbNMD54gwhFjzsJVpf2QqPaCNrDbenof X-Google-Smtp-Source: AGHT+IFgZyVM/wV4gHHTUtKzy2GaH8FYxLa20w79AVDB9o0mSig7OeFOhEaU4CW5c0EVv67nDh4oMA== X-Received: by 2002:a17:90a:eb0f:b0:2a2:53a5:7559 with SMTP id j15-20020a17090aeb0f00b002a253a57559mr3815747pjz.38.1712407246165; Sat, 06 Apr 2024 05:40:46 -0700 (PDT) Received: from wheely.local0.net (124-169-104-130.tpgi.com.au. [124.169.104.130]) by smtp.gmail.com with ESMTPSA id nt5-20020a17090b248500b002a279a86e7asm5050576pjb.7.2024.04.06.05.40.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 06 Apr 2024 05:40:45 -0700 (PDT) From: Nicholas Piggin To: Andrew Jones Cc: Nicholas Piggin , Paolo Bonzini , Thomas Huth , Alexandru Elisei , Eric Auger , Janosch Frank , Claudio Imbrenda , =?utf-8?q?Nico_B=C3=B6hr?= , David Hildenbrand , Shaoqin Huang , Nikos Nikoleris , David Woodhouse , Ricardo Koller , rminmin , Gavin Shan , Nina Schoetterl-Glausch , Sean Christopherson , kvm@vger.kernel.org, kvmarm@lists.linux.dev, kvm-riscv@lists.infradead.org, linux-s390@vger.kernel.org Subject: [RFC kvm-unit-tests PATCH v2 13/14] shellcheck: Fix SC2048 Date: Sat, 6 Apr 2024 22:38:22 +1000 Message-ID: <20240406123833.406488-14-npiggin@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240406123833.406488-1-npiggin@gmail.com> References: <20240406123833.406488-1-npiggin@gmail.com> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 SC2048 (warning): Use "$@" (with quotes) to prevent whitespace problems. No bug identified. Reviewed-by: Andrew Jones Signed-off-by: Nicholas Piggin --- run_tests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/run_tests.sh b/run_tests.sh index 116188e92..938bb8edf 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -44,7 +44,7 @@ fi only_tests="" list_tests="" -args=$(getopt -u -o ag:htj:vl -l all,group:,help,tap13,parallel:,verbose,list,probe-maxsmp -- $*) +args=$(getopt -u -o ag:htj:vl -l all,group:,help,tap13,parallel:,verbose,list,probe-maxsmp -- "$@") [ $? -ne 0 ] && exit 2; set -- $args; while [ $# -gt 0 ]; do From patchwork Sat Apr 6 12:38:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 13619809 Received: from mail-pg1-f170.google.com (mail-pg1-f170.google.com [209.85.215.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6EC151BF40; Sat, 6 Apr 2024 12:40:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712407256; cv=none; b=QN1lrm/vwhqaZsbBRGzYfhIlWPKtuxlwtXZrHxKWTWP8yTQ8IxXofBDxFX3GxIx2LvnPot3g6yiYSJte/ygEwzHP4zOg5wMXe2n2qZLcq0gdb12KYN9Xp0RnvY4lIjx14HhWXgPWlTmkmKKGyG5lri9vDHAT6qWIiRel+4Er+2w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712407256; c=relaxed/simple; bh=jEImH+rp2QfqaInI9V+ckUXsXCCEKUKIWMgodp+ePuQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=cThqVepC7R21qIU4CI3njhOpzA/REYakPgeICvTrflCkSrWX3J54U7VNn5foaY37x023u7kO4G0p5UkcQFITcifspsl9DvKlwB8SKadnHHYe5R80tqXZLzU7wqpQOn1W1qEWR43S09E32JEuYVXUfLwSbuDcB6xbf7oKir/Dd0Y= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=i4qAYBi4; arc=none smtp.client-ip=209.85.215.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="i4qAYBi4" Received: by mail-pg1-f170.google.com with SMTP id 41be03b00d2f7-5ce2aada130so2223954a12.1; Sat, 06 Apr 2024 05:40:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712407255; x=1713012055; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=TKbzy8znHr26CvO7hMQVAmzLED6LumWRP6wamBTxOWo=; b=i4qAYBi45CskVMPpAUqVYSbVx2sFfTzN0zDa+ycfLBW6AAX4KkPeG7/crDTsN04+m2 RQQklLF9q07xB5GyftSJu4g6uXwPF+IKjpnPeGosODh1wfJ631aQat58aPidjkaAXyxL lX1TryhQCi+6+MNMfyj7coqN1MBBI/Ezd+JsxaYKRc+AWgLq236QxaipB4Kwg/tuvMaJ l3oOao4Ce0WuR914ADjEsRk2IuXSj9SdxvqCK35Y0ritdTbvwOke08UOjfjmw6Yw8dm1 4RtLX2OqKNUiWzKoqfEkci/ri6joezyzz2jtuHLWxRE0BlCJ+Ak1QUV8nMubpeOGu9cf KsDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712407255; x=1713012055; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=TKbzy8znHr26CvO7hMQVAmzLED6LumWRP6wamBTxOWo=; b=igbVg4DniDYwiAiH9lczxREqyQHXnN8Vzi0OfJsgkD6gzfK1BBmeBcYneQclEg0gKz bpluIzp/YCFl1iSeoUWlbHsmyN7rpRAO8MQbYRGywP+cY7upnFgcppIX0/sAUKjNRGTY BUuHUcYpVzlKHbHCrwdW805EEaLY1GQbP46XXINvtpDBvekazIoC9reXsirAVVKUdyTw KZ5fQyWMTl+WbY6FgFuADmQWuPqwycEnprDrYWzLd3p51FY98gam+269bRrRDpqy/o7E C2EzhYyYUArJtZxaP/UZsPVqJEIUiv37v/DzeGxEAe6JKq2i2IHcNv3N4HUTyV5NirFZ fdtA== X-Forwarded-Encrypted: i=1; AJvYcCUazHtm75qiwU1rAe8P55ov+GHnP63FlQItPz9AzhlEjSsY5sBrziyADNRMsTNyxBCox3WdmUOgu2KKFpPCD7tYI5FNg4F9g1WffrLjpW8M2HssZ+7QtUZbLwa2CKWN8w== X-Gm-Message-State: AOJu0Ywf0fXS3T3CFaobh9x/K9AqsCGRioz0sRmS0cNHhymlrQ7ApJnc gJD3slbYtBj0LzgJR/bBUNBSYRUXWgOHKRsO8m/zwBabh8QmuNzO X-Google-Smtp-Source: AGHT+IGH923lILkg6k1D5LY3F7XHuUJem0umJ9lfWz87O3KBdX4fIyH0Pvbo4QqzZ+EqQUgQggrzMQ== X-Received: by 2002:a17:90b:118e:b0:29b:b6eb:3c0d with SMTP id gk14-20020a17090b118e00b0029bb6eb3c0dmr3754945pjb.36.1712407254690; Sat, 06 Apr 2024 05:40:54 -0700 (PDT) Received: from wheely.local0.net (124-169-104-130.tpgi.com.au. [124.169.104.130]) by smtp.gmail.com with ESMTPSA id nt5-20020a17090b248500b002a279a86e7asm5050576pjb.7.2024.04.06.05.40.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 06 Apr 2024 05:40:54 -0700 (PDT) From: Nicholas Piggin To: Andrew Jones Cc: Nicholas Piggin , Paolo Bonzini , Thomas Huth , Alexandru Elisei , Eric Auger , Janosch Frank , Claudio Imbrenda , =?utf-8?q?Nico_B=C3=B6hr?= , David Hildenbrand , Shaoqin Huang , Nikos Nikoleris , David Woodhouse , Ricardo Koller , rminmin , Gavin Shan , Nina Schoetterl-Glausch , Sean Christopherson , kvm@vger.kernel.org, kvmarm@lists.linux.dev, kvm-riscv@lists.infradead.org, linux-s390@vger.kernel.org Subject: [RFC kvm-unit-tests PATCH v2 14/14] shellcheck: Suppress various messages Date: Sat, 6 Apr 2024 22:38:23 +1000 Message-ID: <20240406123833.406488-15-npiggin@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240406123833.406488-1-npiggin@gmail.com> References: <20240406123833.406488-1-npiggin@gmail.com> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Various info and warnings are suppressed here, where circumstances (commented) warrant. Signed-off-by: Nicholas Piggin Reviewed-by: Andrew Jones --- configure | 2 ++ run_tests.sh | 3 +++ scripts/arch-run.bash | 15 +++++++++++++++ scripts/mkstandalone.sh | 2 ++ scripts/runtime.bash | 2 ++ 5 files changed, 24 insertions(+) diff --git a/configure b/configure index 8508396af..6ebac7e0a 100755 --- a/configure +++ b/configure @@ -437,6 +437,8 @@ ln -sf "$asm" lib/asm # create the config cat < config.mak +# Shellcheck does not see these are used +# shellcheck disable=SC2034 SRCDIR=$srcdir PREFIX=$prefix HOST=$host diff --git a/run_tests.sh b/run_tests.sh index 938bb8edf..152323ffc 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -45,6 +45,9 @@ fi only_tests="" list_tests="" args=$(getopt -u -o ag:htj:vl -l all,group:,help,tap13,parallel:,verbose,list,probe-maxsmp -- "$@") +# Shellcheck likes to test commands directly rather than with $? but sometimes they +# are too long to put in the same test. +# shellcheck disable=SC2181 [ $? -ne 0 ] && exit 2; set -- $args; while [ $# -gt 0 ]; do diff --git a/scripts/arch-run.bash b/scripts/arch-run.bash index 98d29b671..7e5b2bdf1 100644 --- a/scripts/arch-run.bash +++ b/scripts/arch-run.bash @@ -44,6 +44,8 @@ run_qemu () if [ "$errors" ]; then sig=$(grep 'terminating on signal' <<<"$errors") if [ "$sig" ]; then + # This is too complex for ${var/search/replace} + # shellcheck disable=SC2001 sig=$(sed 's/.*terminating on signal \([0-9][0-9]*\).*/\1/' <<<"$sig") fi fi @@ -174,9 +176,12 @@ run_migration () # Holding both ends of the input fifo open prevents opens from # blocking and readers getting EOF when a writer closes it. + # These fds appear to be unused to shellcheck so quieten the warning. mkfifo ${src_infifo} mkfifo ${dst_infifo} + # shellcheck disable=SC2034 exec {src_infifo_fd}<>${src_infifo} + # shellcheck disable=SC2034 exec {dst_infifo_fd}<>${dst_infifo} "${migcmdline[@]}" \ @@ -184,6 +189,9 @@ run_migration () -mon chardev=mon,mode=control \ < ${src_infifo} > ${src_outfifo} & live_pid=$! + # Shellcheck complains about useless cat but it is clearer than a + # redirect in this case. + # shellcheck disable=SC2002 cat ${src_outfifo} | tee ${src_out} | filter_quiet_msgs & # Start the first destination QEMU machine in advance of the test @@ -224,6 +232,9 @@ do_migration () -mon chardev=mon,mode=control -incoming unix:${dst_incoming} \ < ${dst_infifo} > ${dst_outfifo} & incoming_pid=$! + # Shellcheck complains about useless cat but it is clearer than a + # redirect in this case. + # shellcheck disable=SC2002 cat ${dst_outfifo} | tee ${dst_out} | filter_quiet_msgs & # The test must prompt the user to migrate, so wait for the @@ -467,6 +478,8 @@ env_params () [ -n "$ACCEL" ] && QEMU_ACCEL=$ACCEL fi QEMU_VERSION_STRING="$($qemu -h | head -1)" + # SC does not seee QEMU_MAJOR|MINOR|MICRO are used + # shellcheck disable=SC2034 IFS='[ .]' read -r _ _ _ QEMU_MAJOR QEMU_MINOR QEMU_MICRO rest <<<"$QEMU_VERSION_STRING" fi env_add_params QEMU_ACCEL QEMU_VERSION_STRING QEMU_MAJOR QEMU_MINOR QEMU_MICRO @@ -597,6 +610,8 @@ hvf_available () set_qemu_accelerator () { + # Shellcheck does not seee ACCEL_PROPS is used + # shellcheck disable=SC2034 ACCEL_PROPS=${ACCEL#"${ACCEL%%,*}"} ACCEL=${ACCEL%%,*} diff --git a/scripts/mkstandalone.sh b/scripts/mkstandalone.sh index 756647f29..2318a85f0 100755 --- a/scripts/mkstandalone.sh +++ b/scripts/mkstandalone.sh @@ -65,6 +65,8 @@ generate_test () fi temp_file bin "$kernel" + # Don't want to expand $bin but print it as-is. + # shellcheck disable=SC2016 args[3]='$bin' (echo "#!/usr/bin/env bash" diff --git a/scripts/runtime.bash b/scripts/runtime.bash index 3b76aec9e..6e712214d 100644 --- a/scripts/runtime.bash +++ b/scripts/runtime.bash @@ -137,6 +137,8 @@ function run() # the check line can contain multiple files to check separated by a space # but each check parameter needs to be of the form = if [ "$check" ]; then + # There is no globbing or whitespace allowed in check parameters. + # shellcheck disable=SC2206 check=($check) for check_param in "${check[@]}"; do path=${check_param%%=*}