From patchwork Fri Apr 5 09:00:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 13618706 Received: from mail-pg1-f179.google.com (mail-pg1-f179.google.com [209.85.215.179]) (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 D5F48611E; Fri, 5 Apr 2024 09:01:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.179 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712307677; cv=none; b=onrfeSOnoFuQP4fRr2N1eeES0+sj1TU9b+iNK7MXZYLDn37jrVG1bxWR2JreoPsnMSZL23bu4jc/7Jf7Budst8nCeN79bgvIurrbudserd/GGJBNkgNBkQhJgXXBGKptMOobbhGBiOw99bIBEWWa+JQQ8HXPdmPDrMtPlODrmhk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712307677; c=relaxed/simple; bh=hU5DyQmB+0+LzoAbBVPYnqv0ir777ARq0XXH0tjCyAM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=fDY8bTjb1+mr2EdJhU7lT/dHV8TOqmZyo6JIAV0cGBz7S7wk7tHkRo/7NPDzjRPoExPsPAidXHq4O89PIFIGos8B8ZrQvWjFOjlQrskvQfJIn+mEHHzeqiPbswvt86udC/dMamdrUJC/m/ijHvGnd9zqL0QQsbqqADD4SecRals= 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=dgsGGuX3; arc=none smtp.client-ip=209.85.215.179 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="dgsGGuX3" Received: by mail-pg1-f179.google.com with SMTP id 41be03b00d2f7-5d8b887bb0cso1529080a12.2; Fri, 05 Apr 2024 02:01:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712307675; x=1712912475; 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=q9O2yN202NqTro1AvvJbZu3/0EjKIcT0nZopuJ7bwyA=; b=dgsGGuX3vE8lKZ7ioUXcGSqmxyf3ut6eIHHurMdWKmYec6r2AdgO8Lk7B7IrwSdPM7 oGOdVQvz0MwI9fb+d7w4lxTjcHFilaC41Q7wFe7glh9Fg250Ty4dtB0YbAbCSOxxxZfe zdWqrAhHi9sRq4/lgBn65sEwR7x10py+aRPXEeAzQGLCrBIWQELWzMekH0Z8g5OF0iuh Jbzq0wyS06/TbZpcQ4eaCkNDDIa1O3eDUL1x7F1HuMyfz9K4eXWoCrvUfTAP02J/FDK5 KFCt170/mw22ujBhVgCE22QFubgfo/O+ZmF5jAEU6XXBw4diXVtpTRPtb0Ee+JvsVkbr R8qA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712307675; x=1712912475; 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=q9O2yN202NqTro1AvvJbZu3/0EjKIcT0nZopuJ7bwyA=; b=piD+WqWbLUSawSym19kE9a5v8yEKKC90HFGJssFqN6gzXLp7rKiK3ccv3kZEspj9gM R+kLsCKuzqY4UUkfgvnPJX91q5mlc2rkANbC4cm7VKvgSWGSj6vc8S514jdz6QkdOWFg A1R/4pTJEYnwnUgQCG0nLeyTzNCy/XpuF7t3gZXE9ylEzoHhMDCYE739CRUmOMuz0n40 R8L7g0UJ+Az0vc0YXDkCiPj7C9k4eTfV70IcM8pB8ufW28vVZYVWn8v2rqQ5lnXlVbWb EUS60wNg7ACBZU0Bcqy7uPzkZVs1D/zZsKq8QYXQ9gApHJ2i0w26NFbjqjWKTijkm/6/ ttuA== X-Forwarded-Encrypted: i=1; AJvYcCX6WD21gFcEQ+tLv2QShc6g38EZXqG2u3UaV0Vs+zQePXELwE1nBgrFuMqx9rH0sHHnQvbOazQr5BUzKbPPVwfzTuV64K4u/nowYp41LEMdKYHijyS1yso01yGLGMbdMA== X-Gm-Message-State: AOJu0YwfPm9aZYUa8CHyV8CyGZqeTOrlbcNUtSxYQ3bzO6LXh7chFdcm dw4btpWHHZDchxAcM9NMPki0rhG/T1CByMeAVZgXQL1hz5P1brhN X-Google-Smtp-Source: AGHT+IG3iGQczT0lBc6+U4GYfzX73yWnuYF+Xus3bRqqURm/CLDRZv9h0qLlh8Hdhn5oQL0ovQ4TZg== X-Received: by 2002:a05:6a20:9494:b0:1a7:30ce:4261 with SMTP id hs20-20020a056a20949400b001a730ce4261mr906687pzb.24.1712307675161; Fri, 05 Apr 2024 02:01:15 -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 s12-20020a62e70c000000b006ecf25d0b8dsm995783pfh.184.2024.04.05.02.01.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Apr 2024 02:01:14 -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 , Nadav Amit , 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: [kvm-unit-tests RFC PATCH 01/17] Add initial shellcheck checking Date: Fri, 5 Apr 2024 19:00:33 +1000 Message-ID: <20240405090052.375599-2-npiggin@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240405090052.375599-1-npiggin@gmail.com> References: <20240405090052.375599-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 Signed-off-by: Nicholas Piggin Reviewed-by: Andrew Jones --- .shellcheckrc | 32 ++++++++++++++++++++++++++++++++ Makefile | 4 ++++ README.md | 2 ++ scripts/common.bash | 5 ++++- 4 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 .shellcheckrc diff --git a/.shellcheckrc b/.shellcheckrc new file mode 100644 index 000000000..2a9a57c42 --- /dev/null +++ b/.shellcheckrc @@ -0,0 +1,32 @@ +# 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 SC2034 - config.mak contains a lot of these unused variable errors. +# Maybe we could have a script extract the ones used by shell script and put +# them in a generated file, to re-enable the warning. +# +# In config.mak line 1: +# SRCDIR=/home/npiggin/src/kvm-unit-tests +# ^----^ SC2034 (warning): SRCDIR appears unused. Verify use (or export if used externally). +disable=SC2034 + +# 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 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..77718675e 100644 --- a/README.md +++ b/README.md @@ -193,3 +193,5 @@ 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. 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 Fri Apr 5 09:00:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 13618707 Received: from mail-pf1-f177.google.com (mail-pf1-f177.google.com [209.85.210.177]) (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 8257E13D265; Fri, 5 Apr 2024 09:01:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.177 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712307687; cv=none; b=mzw+vteNoWw3v9CNr9xNkkD18fM0xJoz7JvsyeqXpz5q4d27uqbcw7wZdDt8PCECaXytPiwPUm8M0T7BmARQKcTaEUIosmTC8HZJTZMt1Cj5oZQ3eqZxhUNhjDYxiF3HspzQUIUAyHey0LzbdTaMle/1e030BCgwN9f4oFo69N0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712307687; c=relaxed/simple; bh=JfJMxUdKZR8GL8vEZBI0bBxnPTsZ62D9OnWb7Hg3WEs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=fqTUtt27aYm+YXMFtKxqDa6AmBq1WVLhQj4y0S23mNyyRg42dzp3Rwp8En/VcssC6i6SguEFVS31FZpme7Y4/DBOZzmgT2t9ZJvK3P6R/9b329zaxUOE3ZXpcK7m3IptLQX+8cQu3zd6oHCjq8MBXQgK0l3vD3IOBFfZEof5svU= 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=nfllIvLg; arc=none smtp.client-ip=209.85.210.177 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="nfllIvLg" Received: by mail-pf1-f177.google.com with SMTP id d2e1a72fcca58-6ea9a60f7f5so1666704b3a.3; Fri, 05 Apr 2024 02:01:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712307686; x=1712912486; 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=Uu6wGEwM6aIXMj2Zv0exGHWMPbPED90o0LJmrvuij2Q=; b=nfllIvLgYg4pROhLN+7RHUMurFtfye2svhzrhITa4tuDXTX/X5kBXV7DSoX8sLZS6b XzxWXMmd/yTnt1zAtmaQ8W52tiDDkLtmJWdHwALzpSXLkSdTUi1ELb5KNAjrXJKDLiy+ 9uoChpoYF+tAv12ffFyKtorSAoFLfCTN7znHoBKUUl+F3oaBbVzWIVRd9RZyYgzmK7CX G1exeh/B6NpngTeAteSIYZyPZiOsvSzygIkY5n9mwtzjUfWGjEaGZ9Z5oZFckIKctdXA GseXe34+uNrpsRpcwwiuctg+wtUI4l75qvXQM5PvB5annJmg4Ktn8iuye8CGuvdYv/72 gm2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712307686; x=1712912486; 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=Uu6wGEwM6aIXMj2Zv0exGHWMPbPED90o0LJmrvuij2Q=; b=q/a4C5BMbmiraZepl1qVJZ07/oRbnExqrTiYtq7ztmyxXABt1rsKCZ+JMZuFYLA57d U7H15vs1Y/H27RHE0/sLkDRbe0GixJm2LiU4NUhsjC/AkqMVCw4wEK3APewInkzDOyFv OqQ22vkBQjJSDHveW3kR+uKDz4bS5J+krR2LfuQXiUDpbjaO0RsyJV6ElhhdlN6QoGFn MXTI4D+MghqkJucBdpnVQE9eR3WylDpaWnMzC94lqC04PqhpgydkNQ9atFGM5r9z9qO5 JagJ8lg+Q1cfK00lk+UmWOLtcCkbidv2vc0frC/PrukvzpQvog8iqZ5BMjzMk5gmxLud ln3g== X-Forwarded-Encrypted: i=1; AJvYcCUiDIF88mZtxKPfdXFNwmHMywaMoFjQJIKzBWQKYNoDNQe3yDqHN0N6cxXrZBtGKhryQ8IT2LlRzAyOyNQisNPTaooJ8Vwx7+gjSVaT0PmNnQftQmNFqjZhsirOU7dZHw== X-Gm-Message-State: AOJu0Yx4lf+6uG/5y0sIY0u70wcoxb61efvLZrMHr7ftzApjsYmsC1g5 gr/L/jdorqSYBHK6L//4jYTBWxQV6/fsXqElTZS+QsDCXQ3aH0gn X-Google-Smtp-Source: AGHT+IHzCPSa8orVhvE583R1aVmAhgho8AabCJP5Cs3T+kAcshecv2v+XDz4XgLOLVKXC5dMRzf0KA== X-Received: by 2002:a05:6a20:a122:b0:1a6:f913:afdf with SMTP id q34-20020a056a20a12200b001a6f913afdfmr991282pzk.46.1712307683777; Fri, 05 Apr 2024 02:01:23 -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 s12-20020a62e70c000000b006ecf25d0b8dsm995783pfh.184.2024.04.05.02.01.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Apr 2024 02:01:23 -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 , Nadav Amit , 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: [kvm-unit-tests RFC PATCH 02/17] shellcheck: Fix SC2223 Date: Fri, 5 Apr 2024 19:00:34 +1000 Message-ID: <20240405090052.375599-3-npiggin@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240405090052.375599-1-npiggin@gmail.com> References: <20240405090052.375599-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. Signed-off-by: Nicholas Piggin Reviewed-by: Andrew Jones --- 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 Fri Apr 5 09:00:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 13618708 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 55D0413D290; Fri, 5 Apr 2024 09:01:33 +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=1712307694; cv=none; b=JRsuxRZLw6Fo4YOa9liqxYyfgptLZlNx2M1P48rAtXAuKY5wBrstTuQ/s4GXWRLA6Z8r8iYifUmXgzXnbkFKK/ZTPKNTilq48AEDGrOhoM8hHBKmXq7AobFRfKjufCahVgE1FxSpyvNArqD90MsO2k1bXl6GqergwO9q5PHq1uI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712307694; c=relaxed/simple; bh=iorWhAXzDkMgXS5/h1dXUFesPq+RiQ56mLvxEzBdjLQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Ilk/gbr44Cph3rQ5rTEXb3NV2/pFH/q3WgAC75oLZf3YnFaBBdvRsVIx1J0A/YUhfrAZXP4+TiRE4PlZitbZdnzoFV2w2Ip0iHrqN3vwYSpUSa7HazGZ8ya9Oez/ztpScBgg53xji6hX5+WZWdxbGjMRlYSE5Oz6nbKCuv5nVvE= 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=YgqljkMQ; 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="YgqljkMQ" Received: by mail-pf1-f178.google.com with SMTP id d2e1a72fcca58-6ecf3943040so961514b3a.0; Fri, 05 Apr 2024 02:01:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712307692; x=1712912492; 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=OJFizl9fM2o773KG2KC0tcguyLSt89Cu1ul3ajDj2fU=; b=YgqljkMQxl4rnBZCTdSTPK8G8OOLJj9Dv0aN/p9jwR1zSEODMXNAnqXfIkWMVLZ9Pe aZNULXj92+wm68626fcwQnxc605ntnFCZHRiXFpADvY6v/ouYJu2roVhSRBSaINiblFl Yzq9+SALr67Va6FwKbmdzD1ZcyzLTdG5zIJ5U/s5uY4tI76vtRvB1D6P+kTaZReUW5xX DrS24hDij+OSQW4yPARUXMeLDQAzetbOFKpk9Un2njHI4pBKVyx0hneXc/UvUeHWIxY5 mR6l/5yFvtqnBboZPwGZZswxo1iFqXOmauoLOMcSbsPSXGAbk4ZnzrRICEWcDTO0gfiR z1Ew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712307692; x=1712912492; 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=OJFizl9fM2o773KG2KC0tcguyLSt89Cu1ul3ajDj2fU=; b=k9X5kUO2Z6X/6Qo9pgWUdp5ELBtUQZvOzpXj3TdcWQsx9+skcTi9jrViQOqwQ4PovT q4pmBoSaojBHkWYpUsxcdkEOcdi2ULHVOx3QIQKEgNoFPflQCBBgHFnaJQxuXfk6pUu/ fCa/hJtEJebGkxDzkqSJZnzqOQvsmoIOTcH0P4LegXDxcEqjKuMEKu2ghygzsuYRXNKI JNwpj69p6nCEds9P/kSoU2X9NuTqICic9vGQWbKrW/KR/LOwoNNfGqVc0nV9pMVBKUrI ZI6HbdBxqnLJTb4DLmAo8KAj5CPAdpEJPEbEdi90+Xwx2VvCFSSJ7HozMpOeCFYLaet9 96dA== X-Forwarded-Encrypted: i=1; AJvYcCVTHWYvdNbVFGqd/tczlXZMU2KSNISK6bVSeujaszguumMJQwritnWAv6Yoseth+tU8qzJh4hZ38KjQ0Bs6yBPoxGGzyPbtyFfkDKoGjLYprhENQPeLfov+tDJj5WrJCg== X-Gm-Message-State: AOJu0YwcunrR4GaAFJP4dkwFhG96Jj20oiuyyZDrNr8I4J6SNtXg8tK0 JEufXkds5z3HGUz/+tAvXha6SGQnFYaEKv68BDTEa1HQmH1T+YFQ X-Google-Smtp-Source: AGHT+IFwBaywWHmRGfwbcmA9HRMJtA9TMzs93GW1jGz92SN7GfW4oW/+SF2bpNq91FjZDkLQnrluFw== X-Received: by 2002:a05:6a21:9996:b0:1a3:55d2:1489 with SMTP id ve22-20020a056a21999600b001a355d21489mr1063196pzb.7.1712307692560; Fri, 05 Apr 2024 02:01:32 -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 s12-20020a62e70c000000b006ecf25d0b8dsm995783pfh.184.2024.04.05.02.01.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Apr 2024 02:01:32 -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 , Nadav Amit , 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: [kvm-unit-tests RFC PATCH 03/17] shellcheck: Fix SC2295 Date: Fri, 5 Apr 2024 19:00:35 +1000 Message-ID: <20240405090052.375599-4-npiggin@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240405090052.375599-1-npiggin@gmail.com> References: <20240405090052.375599-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. Signed-off-by: Nicholas Piggin Reviewed-by: Andrew Jones --- 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 Fri Apr 5 09:00:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 13618709 Received: from mail-pf1-f169.google.com (mail-pf1-f169.google.com [209.85.210.169]) (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 E095915F338; Fri, 5 Apr 2024 09:01:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.169 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712307703; cv=none; b=JiCoqCj9x5GQylgiTkj/HYnQe9UrJ/nvP5I5qxnOcDdRq9zgLPzVHNP2c35bhEvln4ZjohlBZQ9eTDoITiuYQFxXVvWWt5IVjejDvCRfaQfna5MmHZMiUjSGOoY/2n3ezWtMObuoYFBTsWOMo/U6wxmzc/VRrClYpu+SKHZN63k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712307703; c=relaxed/simple; bh=506MTEjbVPXF8Zt3kJ2sS8cgtechUEV91w1R5KBhWo0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=hnsVyehVWm71/iZ1Pjht/DrvV73OLtuxTzGchBSJwVn9CBYM3/uOPWjZWgvmgtJVS148DlugAP94Mz1r4+ZK5eswMbKZsmJQpd9t6usePVcxN7xC68OVfH0CdUPcyqxNmzBQ0ikao8aB/jIHj1NnAFiJf0tLMmXGoI/jMgjSPm0= 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=UL3Pl01I; arc=none smtp.client-ip=209.85.210.169 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="UL3Pl01I" Received: by mail-pf1-f169.google.com with SMTP id d2e1a72fcca58-6eaf1a3e917so1667842b3a.2; Fri, 05 Apr 2024 02:01:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712307701; x=1712912501; 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=jWkgTiRHnk4W4aXSUXKYIpIrbIJtMcwldZh7NhaIyxs=; b=UL3Pl01IdWLplxzLv7vcwFfTyMHiJvqQx3U8ZDyeHDfhYfzobqYyZp3Se/Q8NCzXdv q/B37o6SmvPaHdN8U9Fwj0QCCy9qA7JtYmw/az+3q02wDFBFUWVpFX7cfNsXUppRsCwN 6FGs77T0RHPGMk3iI+gXLG3wlfL/n6Z/hm0GbMQdeRjkUWWZ8OnbeVwg3+Q+ApvrYEFQ Ow9PaIMKRiEWUx8OpWM2RSrdCcYzMAW8vtLYnxG9CP1JiiMjAWskeyMc40sSzYyfhsBv NnLh3RC/AdMqL/uFNiMhSeM641oZ1z8ay5bqKEdwGMAPRYQx/LDCc4jH2gepT6yyjOdx j2HQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712307701; x=1712912501; 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=jWkgTiRHnk4W4aXSUXKYIpIrbIJtMcwldZh7NhaIyxs=; b=QYzeeffcnBAf1lgE7a1cFB3/VLjz4zIS1nRp+a7wl5TXgfoB1L/puXYfbVbnPZUkGP E2ap3323gYjfmLwl6mu1kc4qpuM/vHcS9nzCve0v0PrDfu5c5WfL5goZyAm5llHvOYCA RmyuANht8QI1eTlKCPs8PqtG89sbC3G8hoFTpuwb03qevFbNM0v/lMkUXHyNeeHlODg4 eOPaM2XgcvRGsk2dfQSntF4SGcuaxaRd68mIz8SgR3KgH7f81+9uL64CpEP8HYzFPXnR FVbuVUgb6+5cslEeHFYZqsVwXl79+UHa/AjthhmE30kEVdzovlMmoZpO6LpTHjJ5fK8e gcuA== X-Forwarded-Encrypted: i=1; AJvYcCVYQhWkLYlcfs3Mt5oZEABu5AWUkExCeBi6UE1U3nZqqqaJ4NCR48MD6mteBV8L4wsMIFjxvuUWpqryJp0Vwj7xhNlHJ/vAW/xkxljNYKPNxg+9DTSYgpAHbFQ5i1q4YA== X-Gm-Message-State: AOJu0YzkARmZ7HADPsifiG8ASDNiPLObv4sifDuhsCnQeBbpqG7ZgQ8+ qVF+biFSRddRPVpPSLtzY0Jjgwl1q9voRWD8mCiDgDNYcFGJ/lTG X-Google-Smtp-Source: AGHT+IFKRylcUQSeLpH891qpaLSwfOXby/ZCFByKbFqJhH6RagTfsZsaWuVIt0y3x2KTtKSKRijqgw== X-Received: by 2002:a05:6a20:5603:b0:1a3:69e9:2fc4 with SMTP id ir3-20020a056a20560300b001a369e92fc4mr759512pzc.22.1712307701154; Fri, 05 Apr 2024 02:01:41 -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 s12-20020a62e70c000000b006ecf25d0b8dsm995783pfh.184.2024.04.05.02.01.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Apr 2024 02:01:40 -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 , Nadav Amit , 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: [kvm-unit-tests RFC PATCH 04/17] shellcheck: Fix SC2094 Date: Fri, 5 Apr 2024 19:00:36 +1000 Message-ID: <20240405090052.375599-5-npiggin@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240405090052.375599-1-npiggin@gmail.com> References: <20240405090052.375599-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? Signed-off-by: Nicholas Piggin Reviewed-by: Andrew Jones --- 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 Fri Apr 5 09:00:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 13618710 Received: from mail-pf1-f182.google.com (mail-pf1-f182.google.com [209.85.210.182]) (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 AE66B13D265; Fri, 5 Apr 2024 09:01:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712307712; cv=none; b=NbxOJeegzzM6S5b67BdmmnhCk/1Zot9SmVw9m+9KRpgdrVV1wyANGD0wcrSwfv05FFYLM0u4Hq76s1mVu4ugiW4JyieJc149A1n8cVKjhdA+4+QYXWrUeOYV/fZX/uvd8EOXkQBAbH+psb0PzXKfGl4C7OrCuxgkh/hI7fSzyjI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712307712; c=relaxed/simple; bh=4g1r/UsnPqbm9eIN4ayWeeOIX2i8p9mAV/a9qMDvTH8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=o0vJAfGXlllJASp1IqRuYXrTLCm3u3GixrQq9FInaZzpMjCkKJ8e5YNLMz8+u3iYOPZOZ/idFaG4xBPtXETQY4ltxe/bqFVASsvOXOTOPuXDmfv0i8CYSLoiVWpHV2fWLtTIGxdyFx/Ykpisw5lq21mtirGYOF/dCSSJrO5eJoQ= 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=EePS2SyO; arc=none smtp.client-ip=209.85.210.182 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="EePS2SyO" Received: by mail-pf1-f182.google.com with SMTP id d2e1a72fcca58-6ed054f282aso48072b3a.0; Fri, 05 Apr 2024 02:01:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712307710; x=1712912510; 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=tE5LrHkhPWwsD1wVtesjtmAMJJFllrOtQDVtshSFCEA=; b=EePS2SyOhcD8W5iI1cieVp/3buQpQrZ/Q6QPZ2gmL9/vMFrlpOVzQdMOyB1Yn8PA5i eCMCT9swb7EpJvJ5h0r0V8ScR+RYeQZj0QvcvbPusWFnO6w8PbNk/XWQviD3z0Gx/1H2 ZZOeByW2oEM8CR0BmDF0/KesQXI/BnwDf7uvgy3eza1+Ee1IVP+7J4C/KjAoVw/Ob0T4 30jbY96ffDIbWzVjY7lzyZq72EVDHA+dRLgufwT/xzU7cqwR6L7CfklAv8402h30ksQv 9aRJqI/zjBYPMB+71SST0wx30CrmS14XOaNEk/ASxCKq+Eex/CTSrdnkaqp1Jr2VC6ye wxdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712307710; x=1712912510; 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=tE5LrHkhPWwsD1wVtesjtmAMJJFllrOtQDVtshSFCEA=; b=Ok/CAUH4qKEhi9Nx38EGPZYNA2mfHVLR3CX1iyUn7386OlzvkxN9HYdloWE+3NLsT/ Aa2fjHr1/kNL+A2Ta6nxL0pIAM62Eutm5NEt0422OPoE68AfO4w+P8GgnTBA66SoZLEi hKxYnKSKYwfg9yIxLnrIki2doEXNnNRoxAUlGwDhiHuk/g+7i2g4SdhpQy6XfyKc7E+I o0AdaMZ9bBRPbQeRUE4aNah78pTnu4K4+FAOMvfkn8fPaJx0GN6SK/JEy9j0VX+M0azf xsOZ90/tWzGrSX5JywYdzMK3eKS4RY/i8a3ccbPiiyY6DWBZDVw5pdItzd/GN/rSlhTJ C5kw== X-Forwarded-Encrypted: i=1; AJvYcCW3VhU6Zs3htsnE18vd/n124xv4U2unAz9w61YuDXB8FExsz1ZAQ7hzZZFQ+Dk+oKdoSTXRHpXSYzHDMY84iyxAB7N8fSSfQ9/3oZFon8eh6qifMnFswEPdHfsxQhj7Sg== X-Gm-Message-State: AOJu0YwPVMg5XjAQ02W2yfI1TEx8PxNnJc/H1PVae9Bd97Q9iRJAZL0q 3DCN5vfCezTcVyIV8WI3pG1k2hv9aO7+njrOP/NmZSLWn4mgFY/c X-Google-Smtp-Source: AGHT+IG8zRLKzBiTQEfRs0hBIeVmr7NK/SMycA7/nOPbTjd9DY0AzfGVwPzzqjCddECVKUaZg6xLKQ== X-Received: by 2002:a05:6a00:988:b0:6ec:da6c:fd42 with SMTP id u8-20020a056a00098800b006ecda6cfd42mr1095467pfg.5.1712307709981; Fri, 05 Apr 2024 02:01:49 -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 s12-20020a62e70c000000b006ecf25d0b8dsm995783pfh.184.2024.04.05.02.01.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Apr 2024 02:01:49 -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 , Nadav Amit , 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: [kvm-unit-tests RFC PATCH 05/17] shellcheck: Fix SC2006 Date: Fri, 5 Apr 2024 19:00:37 +1000 Message-ID: <20240405090052.375599-6-npiggin@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240405090052.375599-1-npiggin@gmail.com> References: <20240405090052.375599-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. Signed-off-by: Nicholas Piggin Reviewed-by: Andrew Jones --- 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 Fri Apr 5 09:00:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 13618711 Received: from mail-pf1-f175.google.com (mail-pf1-f175.google.com [209.85.210.175]) (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 7B7941EEE6; Fri, 5 Apr 2024 09:01:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.175 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712307723; cv=none; b=Am6KrW9mUMNS98FNjiyRTTU0rk5ZjX/j+Gv5o3JDLvX805/XpAHX9saJmFtQoPkyEXfXvntiqc/ibkmng+Uuy8zjfgm/Q+ktN16ksivgePpxJsBlBHIxeYtJs90udNVhjuPzjcSQC8fgpJ9SLA6WARgnBl+/R8FJL66OsCuuinU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712307723; c=relaxed/simple; bh=cgOlMFOLTOAhPaG8TMTBDw1poLawKTTj8nPBJ3XWL8A=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=bcA7JHT6lcyitByhDQaxFGporFC0UAX/kXWsYxd54wfRmD5hFzMLqXLuE7C9tzxD3O9SqffW2NOXGa5VNcl/2jsTpa4wwttT/3T6JxHssfvVfPtIArrpXjdiEt3t3joA4G0PRSCucmg09Kc+ruQbB8Pkn3kqeDPHaV7N8krqYsU= 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=Z/0yGwWp; arc=none smtp.client-ip=209.85.210.175 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="Z/0yGwWp" Received: by mail-pf1-f175.google.com with SMTP id d2e1a72fcca58-6ecf3f001c5so1250366b3a.1; Fri, 05 Apr 2024 02:01:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712307719; x=1712912519; 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=xvXYLc0uu+LcIsnEe4bo5tAncaXv58vUX5rvt7kRU2I=; b=Z/0yGwWppiUvbTwsDcJ+DEYmgfPnrpBfqPCem0T5ZxZEGeIRimdEFqY3TpI9L9lSQC z3KnrZQs2OY22G/q6nW/WM+IA7FaiCUMOydRakfdpdwiehuKnq2NJoJcv0ViiqpzGajB u7I0c/5UUXbQGG1wYMLO+k9VIX3jKzL3FrqSGJMRuUgDpVIxDSMjO4Xhltd2p/M7rY/f UMR5jUObW0BuXeAO1/gSoUahOxcQHjUJg4pOxmsDLJgAGMFC5DzJMOCK7Jh4kDerQvlJ b1Dbt+8S9tvv58046tdvsiKPukwZAfT4sLYM5Ps2Z4BuVbHlTnQyIcbUFnwI0BO1Uc2H Douw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712307719; x=1712912519; 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=xvXYLc0uu+LcIsnEe4bo5tAncaXv58vUX5rvt7kRU2I=; b=KidS2eL/xDUMkLmW5KOsqPHqmH0sg0ChyqbbXmvkhqLbO9TbGFmIIL7KFlmA8GTS0V dyJMrm7zJ1U3nxe31diA5Itj9y74fm7Crz7y9QYiUVN1wxWDnYhOR+kHDqnLZaW11KOa +wVrYW1vO+Wyp4TdCM2bn1XwEPWyzR3iVHhlmoZvO81M0cP6ROYGEMXnnddmo0OG2+ca br/YnbVzejzynM7EeKt2WKfmiCRM5o75kMyz4ISq5bTQOpPtLt4A1Yf3Jp0+zuxBEMbp i/LEHa8GeQD9wKN9gmipcTSJiS1CR4Mc98g4tWayFGdXbg1WQZFdmLPkQcoauDRFIwKm GmZg== X-Forwarded-Encrypted: i=1; AJvYcCXx48aENW78ECSougpkefHFze6Uvx89Fr+SzveGQojd5JRpKq0SvjvhCWvPBguO4RrGYL9EplrbSNdLLcN4895PUaAgayqZpL0ql5Hk5qGEksVhH2sig1FQFU8hvQ/w3A== X-Gm-Message-State: AOJu0YySvBaE0vco+ECqHx/wMhVopubfWAxDy9cLxL72afVJcL+EAha8 Kxd2g2UJvYx48lRaIcEGYOZy3B/CVOBreWoOHdQ92Nf7GZQqOHYN X-Google-Smtp-Source: AGHT+IFj7I4WRf6mG1Ngr9iOIJklIrAymGwlwsRpKSgckGok7UED5Jz/iGyna+dzLfvclH/dWdFZdw== X-Received: by 2002:a05:6a00:9296:b0:6ec:ceb4:49b8 with SMTP id jw22-20020a056a00929600b006ecceb449b8mr1142659pfb.0.1712307718798; Fri, 05 Apr 2024 02:01:58 -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 s12-20020a62e70c000000b006ecf25d0b8dsm995783pfh.184.2024.04.05.02.01.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Apr 2024 02:01:58 -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 , Nadav Amit , 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: [kvm-unit-tests RFC PATCH 06/17] shellcheck: Fix SC2155 Date: Fri, 5 Apr 2024 19:00:38 +1000 Message-ID: <20240405090052.375599-7-npiggin@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240405090052.375599-1-npiggin@gmail.com> References: <20240405090052.375599-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. Signed-off-by: Nicholas Piggin Reviewed-by: Andrew Jones --- 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 Fri Apr 5 09:00:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 13618719 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 1D29E16132B; Fri, 5 Apr 2024 09:02:07 +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=1712307729; cv=none; b=hz2w0BoRytnBDvTMQfSUL/Br3l2a1rLQBxA163+vD85IgQTfW2FnudytgSMGLHaMrFaK5QWACtZZiarSqh72iOfU0csfsJJG+w8nSSybNIPouoUGANzogNxw3ojtNz6MbfYCJC5kuUn0/1YFU8G9wisDk6K2l4vbICNDocaqTwc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712307729; c=relaxed/simple; bh=47fkLuLqHEZtB3S2cnlevqOMobm0CWU9n/5DYYSuwNc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=scN9tU8JgBEsIUbYB329DoweuMQlVYGW7cuxtb6osBCCzsHIVGoaai59LuQEmlMhV8PtcHPvEP9YWS9y1ssLG5twb/uUfsTHurFerxd43w6gcnfP1k093ZgoHW1O4VyJWsSctOUGrdB1QicNY+Tf/gijGte4hXKn/rLWxT2sjy0= 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=Ow5h2Pok; 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="Ow5h2Pok" Received: by mail-pf1-f173.google.com with SMTP id d2e1a72fcca58-6eced6fd98aso1444146b3a.0; Fri, 05 Apr 2024 02:02:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712307727; x=1712912527; 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=XTMqAyJBqz4rOiSgRtnzTZtMbx0voGPftwqzEIUfG30=; b=Ow5h2PokgtE4EVhHS/Enlwt+Af5b1KmE3sG5ugwpnRmAwI8tJ6dgRAp5Rt/lZv8qLN Mexus1oOpdHk13H3aPR4pyOrkmdwoJQ9S0tKyJXVBp478/hm15uuggqPAJOIYPJd2Hbg WnQ+RT+ADghdTtixq/aTDt2f5N2OAffWgBdg6CsISgS/Z8FRMaSZzNCOdJF3kB7VLpfc 2NFrd1AcAQiOCeLcK8SBF5EBeGMW3pVkxlL9c7s0i0J/WNuwfqlMk5fHKFTYh5Y7F4KZ iQQKaqEIEMp1xC9rbbLYSyl/+DUHUHmYuQasmsyUraV6Tt5UhRAPFEMqQGJpSET7T7gE d6Xw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712307727; x=1712912527; 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=XTMqAyJBqz4rOiSgRtnzTZtMbx0voGPftwqzEIUfG30=; b=lxL3aSWp5B4LduI4vtHRCWAB1GDwaZUi24c7AM2Q5rhMbeDDEdigB4Ar8eSnx0sUCc g8EhqUCXRlnHqhjIV6yCVE7x+tFcZYtWwLVM/BpTJxtv24JIntskJO/KuylkZYOqz1Co O/ky3VxWzhLHK5OoP6JXSjTWpY9mLmmwzZ2jgC3l7dp868LSsOxd5Wygz8/uR2CcIaHB srKqMInBDpPKStLKHuZMLbN39B8hEypmwvpmImGZ2E7+ypaeU6if9VRlAAfQfBl5CuRO 8kNEFMYt7TW7xQ3iawWSRFliPCx4+vhvH03CvYVPm9Bcg2kSJENgQSTEUzAhIw4hQ9k6 5mag== X-Forwarded-Encrypted: i=1; AJvYcCWP8nxBoZnreuF1lFINeUykWG3qIEBbP8LrjT+S2nbTyQyxRNyXZW12EC/64ZSTsXpXauk97o01VnSicjw42xyR9PJafclb71NS+AGCQFLQRsDWYLxzUOOPIF3F3CIHwA== X-Gm-Message-State: AOJu0YxdbWbB+BI92qjOqljSQqSVPU3gsYqJvn6xyVso/BQ3oplKx5kg XT1roGfMF46KBqBWIt+pBVOIlcZUqUmAPd9sR4ox3gdu7AbgeIC7 X-Google-Smtp-Source: AGHT+IEXfc3N1ZI16wRWq13BpZo+ByZPJ7Mm8iWXe4JP9NepPrfWkfcdQ8IrIrN/6TID9n4Pw5Bi8A== X-Received: by 2002:a05:6a20:9785:b0:1a3:a99c:cd4d with SMTP id hx5-20020a056a20978500b001a3a99ccd4dmr926415pzc.48.1712307727470; Fri, 05 Apr 2024 02:02:07 -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 s12-20020a62e70c000000b006ecf25d0b8dsm995783pfh.184.2024.04.05.02.01.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Apr 2024 02:02:07 -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 , Nadav Amit , 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: [kvm-unit-tests RFC PATCH 07/17] shellcheck: Fix SC2235 Date: Fri, 5 Apr 2024 19:00:39 +1000 Message-ID: <20240405090052.375599-8-npiggin@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240405090052.375599-1-npiggin@gmail.com> References: <20240405090052.375599-1-npiggin@gmail.com> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 SC2235 (style): Use { ..; } instead of (..) to avoid subshell overhead. No bug identified. Overhead is pretty irrelevant. 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 ae4b06679..d1edd1d69 100644 --- a/scripts/arch-run.bash +++ b/scripts/arch-run.bash @@ -580,15 +580,15 @@ kvm_available () return 1 [ "$HOST" = "$ARCH_NAME" ] || - ( [ "$HOST" = aarch64 ] && [ "$ARCH" = arm ] ) || - ( [ "$HOST" = x86_64 ] && [ "$ARCH" = i386 ] ) + { [ "$HOST" = aarch64 ] && [ "$ARCH" = arm ] ; } || + { [ "$HOST" = x86_64 ] && [ "$ARCH" = i386 ] ; } } hvf_available () { [ "$(sysctl -n kern.hv_support 2>/dev/null)" = "1" ] || return 1 [ "$HOST" = "$ARCH_NAME" ] || - ( [ "$HOST" = x86_64 ] && [ "$ARCH" = i386 ] ) + { [ "$HOST" = x86_64 ] && [ "$ARCH" = i386 ] ; } } set_qemu_accelerator () From patchwork Fri Apr 5 09:00:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 13618720 Received: from mail-pf1-f182.google.com (mail-pf1-f182.google.com [209.85.210.182]) (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 B4EDB15FD1E; Fri, 5 Apr 2024 09:02:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712307738; cv=none; b=VnrPEwd4It4vjkhfkJhgEl2gRc4zBqSC6ir9TcjDQPWrY+mMZcdkuu0i8Rh8H2fzGJ0rmoWa8MHDl07iwGCQWgEOMm6YQlq1L/1STa6tADIYoOVWQz2kmArdJsd0Ovkt6IeSg83PLiPMusOLuepjjWB8i0z6Y+a8dg3yF3APXsI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712307738; c=relaxed/simple; bh=D2NZsjGRY1JDUL/nxvnSyIqqAbyckX5TCaIHUVo+eHo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=pc21UDylOXzVpacQ2r0pG5GTMoyi9EGqzS6EXYDgCUdim52hkXhY9FHXbXD5Jy3FUyIN2Kv2LEftqXE4p5isjqumbQ7152nveNldLEqZSkFu5SloVOnagz8tjqrbf4z5fyFGd4WbUAlBAvqw5qU06huNKEt2W+w4LOsCkf/fwlc= 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=AEi/763L; arc=none smtp.client-ip=209.85.210.182 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="AEi/763L" Received: by mail-pf1-f182.google.com with SMTP id d2e1a72fcca58-6ecf541e19aso1026241b3a.1; Fri, 05 Apr 2024 02:02:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712307736; x=1712912536; 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=cohi3aKjv+1U6Puqidh80iZqRFzOJIsMybMNYjaL8SU=; b=AEi/763LF7UdJr7VCVGPcL/rEvVciAtlPbtGeTBQOtl1ULIXFRlB/8tzxWoxmD38Vh s27CUlnj8rd9ESh+Td0Ibxegqb6SVl6Br2uR54QLprY43Y7AaVAEPvjZjjFJvf6zj7Rp pMMJe9LO6e6wl/ChJbw0LXlgn6IIFOvfRhWIlX8lxG8IXq5Xy8uDX1ETHTy0JgqMjBnk sMf2LJp9L2pwvlmlSlPIh0BeG4JJIsbOe7qq4RVDpxlfUmVbP1tywi4ejvlLwBbC+sMp /mQxGeGAgX7LV4Yhu48R5PY+4j6/NK7d5IefGRa3MgE9OKg/y6y6RVmcTKw6MApLg436 ZeRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712307736; x=1712912536; 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=cohi3aKjv+1U6Puqidh80iZqRFzOJIsMybMNYjaL8SU=; b=oxCqpAtNKEvCcgFkpq9NmIBB+Wkv3W63SqKCZzhGcmM2YXRgUzEW8wqbwPgc6QuOw0 eVH2F14gdOHwgQBkYsxXzwkWJD6wJ/lngfLwszYQfvJUejy2EmiTQa4pQ3sBD+Ei2TrD f9Hkuik0hTXx2OzcDv0jJtMuHtMvcEGvmt3DhIDvRTQ6g5YElrwT/R39mc+6FQpiWb9L NYJrfGbehbf5074RS0n/tvxkGOeNd3ga5EzEstljwuYffbanjYX+uNybAvqgl45FdASu 3WYWMZMtRhqM+c87DJJVubchWRWqTiBIkWpSQoHYbOAQe4dMm63tkjxAUt5ngxU0Hq0f sFZg== X-Forwarded-Encrypted: i=1; AJvYcCW/6zKq2ZracF8D1+5BpkSiSvKaF7CDAbe/u3ey6bUYN3h0MJR2biPdkfVI9P6OvCYexkhOce09DBRW+AHFuHvPSyhGmCPGDqJTEJQ/3cq4U9dL1Tm0LJlHCKxAA3duTQ== X-Gm-Message-State: AOJu0YyzcJTeGfp2N6B0XbWD8pb1Hb7vpcI6J6yiAQ1HWvvNVl5Fo0cv xutkpznwiEs3A1sq9vtL05uP+L7ufDcMIHHicAK1o3Ax1WcuYwgy X-Google-Smtp-Source: AGHT+IG9dVdT+vakcHxy2GC/HHhs+O8CS4HJBxtK610mZlct905ZAPsg+YVWeNrmXHHatzgeuDW9jQ== X-Received: by 2002:a05:6a20:8d24:b0:1a3:c8db:97b7 with SMTP id q36-20020a056a208d2400b001a3c8db97b7mr713286pzi.47.1712307735963; Fri, 05 Apr 2024 02:02:15 -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 s12-20020a62e70c000000b006ecf25d0b8dsm995783pfh.184.2024.04.05.02.02.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Apr 2024 02:02:15 -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 , Nadav Amit , 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: [kvm-unit-tests RFC PATCH 08/17] shellcheck: Fix SC2119, SC2120 Date: Fri, 5 Apr 2024 19:00:40 +1000 Message-ID: <20240405090052.375599-9-npiggin@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240405090052.375599-1-npiggin@gmail.com> References: <20240405090052.375599-1-npiggin@gmail.com> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 SC2119 (info): Use is_pv "$@" if function's $1 should mean script's $1. SC2120 (warning): is_pv references arguments, but none are ever passed. Could be a bug? Signed-off-by: Nicholas Piggin Reviewed-by: Andrew Jones --- s390x/run | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/s390x/run b/s390x/run index e58fa4af9..34552c274 100755 --- a/s390x/run +++ b/s390x/run @@ -21,12 +21,12 @@ is_pv() { return 1 } -if is_pv && [ "$ACCEL" = "tcg" ]; then +if is_pv "$@" && [ "$ACCEL" = "tcg" ]; then echo "Protected Virtualization isn't supported under TCG" exit 2 fi -if is_pv && [ "$MIGRATION" = "yes" ]; then +if is_pv "$@" && [ "$MIGRATION" = "yes" ]; then echo "Migration isn't supported under Protected Virtualization" exit 2 fi @@ -34,12 +34,12 @@ fi M='-machine s390-ccw-virtio' M+=",accel=$ACCEL$ACCEL_PROPS" -if is_pv; then +if is_pv "$@"; then M+=",confidential-guest-support=pv0" fi command="$qemu -nodefaults -nographic $M" -if is_pv; then +if is_pv "$@"; then command+=" -object s390-pv-guest,id=pv0" fi command+=" -chardev stdio,id=con0 -device sclpconsole,chardev=con0" From patchwork Fri Apr 5 09:00:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 13618721 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 44D8F15FD0E; Fri, 5 Apr 2024 09:02:25 +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=1712307746; cv=none; b=l47WWLPGZSI/oxqEbXmXzoZxj8aWPAIqusYrywDWDF53JBCKIyc7GDkKBh1tjtntoZ2sWsm+JhuElq+i38lyHLS9Cu/CR3zn0zjuZ5EYVdfZ+VYRO8g3tST3uq8ndgaah05JvWH1xBbo2HzKJfFaygyOi+ZhwLnKtVZOLJ/YF3I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712307746; c=relaxed/simple; bh=5GeQjgmyuUTE42hH1s2QbxPN2QS1tsG/7YB+V3jiAPo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=eTyXJSDmOzWLEHwZXaPgPV9ZDmTjiiymOBuibYi42A1h4UqAKtj7vb+5gKfXuNTurrGMt0rClEWXI1r0077Zs9mtKPxHf6hugfnLUJwuCuwzWCfqnsHUeIdApb4yLnMzFRAYZTNZazbOkHE+qjMHSih/nlVZU0dAHFy5hBt0yco= 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=EHyOLtcr; 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="EHyOLtcr" Received: by mail-pf1-f173.google.com with SMTP id d2e1a72fcca58-6eced6fd98aso1444416b3a.0; Fri, 05 Apr 2024 02:02:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712307744; x=1712912544; 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=Pxe6HTJDpXeWz+A4d/z3W+WfFv5s26i6kZ8vmOxuk2w=; b=EHyOLtcreR/mRZyaA43XoD4o8qt6RHabd2yYQzjlj6SQ65jUSrV8ktnTQLQcxLbePZ dK4FPiGTjTNpjOIOb69n9oIOgwm6wf+Z/xohaMHxyWaWQnHxTpV+ZNGQlmGvdMCaCgFa HSL/jSLqsbwdJURas9epAYeIOEDOItE+jbtPsdEx9uIk1hgCyUK4v0GMRp+rjoBl9WaH mtIOjP/AqWyDWevII2aRFDtcEP7Ra2awzpNA8Pq5yfkJKrf/Vzg14io6JIUVaKCE75O0 Wr5yYVFpHa3rz9+zt4pqcV89B2rDuIjHobatoCcLPAffq5Ar9QPIUjhQLDz/VNfF8VZg mqWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712307744; x=1712912544; 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=Pxe6HTJDpXeWz+A4d/z3W+WfFv5s26i6kZ8vmOxuk2w=; b=oWFlL70G0+PyPHc79fNM+f9h5dXL7PTTNtYEqp3ct/e0d5XQk50Imfu5Yd2nylwXE7 paEQSJSF/lnb0OQRB/PRhdmmWKcXy9n+mYftqTMDhOXWMGOF5ollENVHI/qgkw4lXPeO eRsXJOYWduE2qQ6WO0Wu3+7lLZ/riYpUm2t8Qgy5fjZouuuluGBFqxAbPVavgba7hesn CtRSdTDRTsasv9grSRTYG9iKzjtkuUGHpzXV3J+N6+I+2kpLSnUg/VZb0ma8QN3cTo23 qO0z4YDmtWNsMfroXn2VCPJbVRaINwiXUsb4CaUPX2i8A0m5mMO/W3MhVn1r18/jGfsW g8mg== X-Forwarded-Encrypted: i=1; AJvYcCXVRJrthN1yfpquG89gdMru/JEFxYwRLOaImqHsXs4kKY+vCF9OUVzldsb0XExqOVdzAoYyRpdSeR9SjfS0GDkqEaAaYv0ZHgeBtiHPTWn1edqkrTqcjcYCpf39/8wRQg== X-Gm-Message-State: AOJu0YyFW2ikwgiOBpjpS02mP4R5hCZlXFg7WapLxonWRF4C2pS85X6Y ZCoCvj1iM+yWvLok7npg/jk7QkKsjoqGnLSUg29CtdWiNNAztN93 X-Google-Smtp-Source: AGHT+IFi0wcgnFzUT48JpEZlFnQyd03or96zaStrZ3u3axPTcX7D20CB8PvzKwnmjg2fzqLkBgB2zA== X-Received: by 2002:aa7:8893:0:b0:6e5:faca:3683 with SMTP id z19-20020aa78893000000b006e5faca3683mr1042054pfe.26.1712307744654; Fri, 05 Apr 2024 02:02:24 -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 s12-20020a62e70c000000b006ecf25d0b8dsm995783pfh.184.2024.04.05.02.02.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Apr 2024 02:02:24 -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 , Nadav Amit , 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: [kvm-unit-tests RFC PATCH 09/17] shellcheck: Fix SC2143 Date: Fri, 5 Apr 2024 19:00:41 +1000 Message-ID: <20240405090052.375599-10-npiggin@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240405090052.375599-1-npiggin@gmail.com> References: <20240405090052.375599-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. Signed-off-by: Nicholas Piggin Reviewed-by: Andrew Jones --- 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 d1edd1d69..9dc34a54a 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 Fri Apr 5 09:00:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 13618722 Received: from mail-pf1-f182.google.com (mail-pf1-f182.google.com [209.85.210.182]) (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 CDD5B15FCE9; Fri, 5 Apr 2024 09:02:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712307755; cv=none; b=CQi+7M4b94Nkbe/VutMaWU0qy269E9JRqpcmiwdsQXETk/hJ8V81vehs7SHUSnNj2LX5b53iDCLV28B+Ub9vF16V5p1wxVc/BteJJmdtYSuD5NUal+RRgqmH6jfqjqPFA9T+UDoIMpvMq/G4XYA9LxFkxHkV8UQHPxAj4fnAGYw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712307755; c=relaxed/simple; bh=2vv/IKl54+GfCSIelDXCPjWVEwwZrrCpGl2AJlVYet4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=hMqVm9rzU3J1eZeLF2XWPUSqKno/ECqZ/HI7ZW/nKPv6e8Mol0P1hMfALHEMRnG7bkpK++Cx/wXYcawMiKaXHk9VU95U+dMhq5L2W6ioH+A39BKf7OKUApTPTEHLC3aUGtItivZxMR/LcV1m+b3XwbmhUZhq+Uh3yGoHWR59ii8= 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=KzlUzlzW; arc=none smtp.client-ip=209.85.210.182 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="KzlUzlzW" Received: by mail-pf1-f182.google.com with SMTP id d2e1a72fcca58-6e782e955adso1797783b3a.3; Fri, 05 Apr 2024 02:02:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712307753; x=1712912553; 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=FQyG6PJPa2DgRXJ6ENxjgOjT0GZyabu8ITbgcsO6HNU=; b=KzlUzlzWpUmG0Ix5/33JGLLNAItTxusnZ6XWuysOqZ4yezfUpxvCRM/uYGYgCBdVNT Hi6MTTdexYbUfFgHxiBjrY1kQ2K5Y4qyTLpA/gH6ueiN0ygIxe4cgYsNDi11tzVZ9ClA QuWf3oWZ+tfqQgGjA/VyjmBb0a8K1v324qjAcSM10AXu5PT/zftWs1u4DMkdZeSUhV+m Je3dZCiZl9bFCS5gdtfzskM96cej1hgGKBiyfkeE4IvS0is88SSdZWln7yGh4LA5EsNq BoPCUzb+adYTrwrDmFD0omfb/3HvCJ+XLF+MgIcMVNe0ZKCV4C3+Xu2sSv4rMUGdL69p TuWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712307753; x=1712912553; 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=FQyG6PJPa2DgRXJ6ENxjgOjT0GZyabu8ITbgcsO6HNU=; b=cxkBCJyrAMyHBz/81YZCiHQ3WhWvdP7WsMEqjGYhfUHjOB58FfXgWTf1IukWMN5/LZ 7CdvBwBHHLLjWXG+N+S6aSi+9y4T3CY71PgjzE5eabuo2iqtLQNLFMTprZzj2om4dfYF dd4DC1LMSuMJ+h/1fEeSI2TElwV9RyinUcI7DpvMYGmgs/2cMmr4Jdz9m6aMIiRfGR9t apKQGqFlVI9oeBtvQVJ6bBpq0nY8DoEGhY6sfy8gkTZ09AyfHerTs848SdDaFMRCOhwd BW5sE7v3dwM4C/gd9/pakiw7UT5A0eFY+/+RGF8NW+0a0Ym0b5uryMRoyfG79lWUl49q ibag== X-Forwarded-Encrypted: i=1; AJvYcCW9EzwgffLJShsON2VlzWLYY2F5lON3tpXwnRfqMh74gYGJDAeElo6rcSDQw6IZWngL896sUCmxFNmHp78MegNhXHgiugnfU9BkDFi7uyQYART8J/4gtG4Lqlv35A872A== X-Gm-Message-State: AOJu0YwfqHGBjIWThFHwU2Hfc3ey3mgDxBnFFFn4IC9Pkegn7sDPtDiM emecBDPRgGbHEalk6aPI4jKW07lI3eC9znJPPzyZYsunj0KKNzDU X-Google-Smtp-Source: AGHT+IHhBxfSYK+gCHVhFCLwN0vh7vqzr1fhMMMTvd8dOdpq1OMcW1smOYtODZbfkK2Var8DE55FAA== X-Received: by 2002:a05:6a21:1a5:b0:1a1:87b5:298b with SMTP id le37-20020a056a2101a500b001a187b5298bmr1072821pzb.21.1712307753391; Fri, 05 Apr 2024 02:02:33 -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 s12-20020a62e70c000000b006ecf25d0b8dsm995783pfh.184.2024.04.05.02.02.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Apr 2024 02:02:33 -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 , Nadav Amit , 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: [kvm-unit-tests RFC PATCH 10/17] shellcheck: Fix SC2013 Date: Fri, 5 Apr 2024 19:00:42 +1000 Message-ID: <20240405090052.375599-11-npiggin@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240405090052.375599-1-npiggin@gmail.com> References: <20240405090052.375599-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 9dc34a54a..e5750cb98 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 Fri Apr 5 09:00:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 13618723 Received: from mail-pf1-f181.google.com (mail-pf1-f181.google.com [209.85.210.181]) (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 49A5C16079C; Fri, 5 Apr 2024 09:02:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.181 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712307764; cv=none; b=QREMJA3jPKNeS/umVhGgXElz4Dk9DY6RCWa1AW0e5HBvUMFNirDOLOmEcHTGz/48cOOYJs45lQKWdGr2Rst1THCyu7klOhj91vwlAF4z0z+LnJYdIlHkCdN4zPQ6H3C9pbqwFb57Aq4zPo9U5kbPGxOjHV2j3N6+jT5yoIsLkmw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712307764; c=relaxed/simple; bh=pE3HfiIGEmqFSFiLu/iGrulwEbzK+1DappCu3kmRLRI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=YoNOhZexxsOAs0u/fbdfz8AVE+2OQoIGep2xBOkJUJfHEtyE0P3znVmV7QFWm7uwMrM7RRyzogQicE6pKclgaucnbVdrFC/E2ZMcd4NdZ3ObhY8BPWFrxBaRlvREVGeNHPdBzgIB5vGLQ4DS0SB5QtkEx40N4MsEijDisA3ATPk= 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=edQelarB; arc=none smtp.client-ip=209.85.210.181 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="edQelarB" Received: by mail-pf1-f181.google.com with SMTP id d2e1a72fcca58-6ecf406551aso1130359b3a.2; Fri, 05 Apr 2024 02:02:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712307762; x=1712912562; 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=oK6zod+kpdXqaCAT61YomIe0gTSB8IC96Vd/WuMdYZk=; b=edQelarBqxBVwF8JANqus6D2id8ay616sHedrvFCcImRxr41tytyvk5UeLrKDbkVow MADgTKpsMbL9pXM9OTiZV+QYzeQMgpdD8p+pM6+uUYOMPb7DEvYwsF3aQMzG+5esM3S7 TLytQF7M/7LhS6Yt1X2knQ9tnxfoF34S/elZEDgb/FGHtKEajrgreXrO86eHHUjnEUFu lmThg8sKtbenkKYxhAcpewNQpoCPJfzs0EfMdnVxBv57KYdd5RlWPlFH5uWXqUNOMmEZ 0utzL2H3ANmbu7KeOdXWMqULa2qd1bxsMMcfuYYEzwohiYu9diW0hK67h1q3J0MJ7QLs FeqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712307762; x=1712912562; 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=oK6zod+kpdXqaCAT61YomIe0gTSB8IC96Vd/WuMdYZk=; b=mJtYOHUMXLPkmP30/d9fJc6Cz98BF396M19hFVTWLtBG9wPxBEIUy4n1WwTIrYWuVJ mvw+h8DxAcNdR1FN/nRyxqs8Fx1aVRRVInzdDJGZk8v2TXRcEINqrOOgC2sUSAlV89ga vuP/2FcqBeNaebEwRBN+pBaAIoEOUDca6GevlHzA1cRcxuaV6WjmeeSreiNUr5nZ1GRS b9Unh3eB7woSv6Qd42mLd6VAibgfd8s88jrJrvnhDB8xh0bkArx11qCq4dVI8eWiH6/O g6mE4LfE7Mt7baEnBX/JDZFlWldsLDtBrHtMn5uwH+l8Gi9UEAhQToi4OAuLTFA4w9Vd vMcQ== X-Forwarded-Encrypted: i=1; AJvYcCWtUA8YZIY5l5oV0DJZmflBzOWSOOmzKvL+mUu14poincbJiULkqFwsHoOPm71/yopzTrT2eXmCeHdA1HvmV3ZGhwyKjEjHpaR+oV2YfURaQNbyav3FNvslsVRK3qfvww== X-Gm-Message-State: AOJu0Yyw6FmX1csR/yxQmH5FXYW7HXfj3n/3YLjz6c7I11UYrhjsbzoG 8bAuVZVQ7pgyTutqzhHNzqSQ8Z7NE1XUzzQ5jYu4yUnlIIRNsFdR X-Google-Smtp-Source: AGHT+IG7JVb1s7kMZIVcxNaa60h6q30VL08nNHdeaH0PUwUMxshI28Z3r3tOvqs6XzFQP44N1cvSNg== X-Received: by 2002:a05:6a20:6a09:b0:1a5:6f67:3f63 with SMTP id p9-20020a056a206a0900b001a56f673f63mr1142804pzk.0.1712307762482; Fri, 05 Apr 2024 02:02:42 -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 s12-20020a62e70c000000b006ecf25d0b8dsm995783pfh.184.2024.04.05.02.02.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Apr 2024 02:02:41 -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 , Nadav Amit , 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: [kvm-unit-tests RFC PATCH 11/17] shellcheck: Fix SC2145 Date: Fri, 5 Apr 2024 19:00:43 +1000 Message-ID: <20240405090052.375599-12-npiggin@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240405090052.375599-1-npiggin@gmail.com> References: <20240405090052.375599-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. Could be a bug? Signed-off-by: Nicholas Piggin Reviewed-by: Andrew Jones --- 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 Fri Apr 5 09:00:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 13618724 Received: from mail-pf1-f176.google.com (mail-pf1-f176.google.com [209.85.210.176]) (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 A0BFA16079A; Fri, 5 Apr 2024 09:02:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.176 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712307773; cv=none; b=If2JYyRcrji+c5VMC5Eg0r3hQKarxUNO4TpNUacC5N/uZt7qyvhEeA7nrW0M8xvQv+hJtOmx+Gh7PJIR7wqLTc9C89vKUwMpqCEvzm1n/eh4ENOzgU+4JbJnooRBf88LkHU0GPiFo9ugGWXTz3hBMW0iMBN8R/VDjQtFS3ouMSQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712307773; c=relaxed/simple; bh=6xB+wIQnOPLKF7pHbmVgFhJt61sfpiZqfgj5DzaM+0w=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=SF+pQjZ68wV63akNap4huvU4x6TfVuyH81yY6iPViFue17kmkw8h0ZX5sb+q5aJ6ifW0CIi5P0k/eHk+tUc8WEqCwOFFih03PGPHNauEOPEj+6jb/eohFGmQwzcOwri8EhXIzIYmqddRir2slMq9hMtdVvkT1Sx4lJNyyY0rPi0= 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=MssTNjr2; arc=none smtp.client-ip=209.85.210.176 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="MssTNjr2" Received: by mail-pf1-f176.google.com with SMTP id d2e1a72fcca58-6ecf8ebff50so787926b3a.1; Fri, 05 Apr 2024 02:02:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712307771; x=1712912571; 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=irIYlf5WoFbPGWpVJt4Aw1Uvp/IzdQOpW5w6SFgi17E=; b=MssTNjr2pA3qZgA6G9/JfVVfCxqhuMHhjUq1uhNYhy40rHpmjhU6kXcdDIoLZM/Z7+ ZzVDilHyjKswx9FVMEiVFfFMuggvmOWn9SvwTJbdkoWIkr80ZigFQfE1SWg8fLYoMXSL DB1M4hu7w0L4+9wuhAP/2TGcj7BxTQG3VxyYzWtqFPv1HyA+/YcbnN84CIb+KbY5MhmP 65t0bfFBbM/cD1dDSqp7z6wbg7Jk5qHlUlsCztbzpgS1OT17lHwKaPxzaDV5x8icC2Jm dkD2+zsJyuH2ege554W6TN/qZR2DhSs56wIUIvSxdhOe7XV/Yry1904S8zfGGONWRw3u LArA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712307771; x=1712912571; 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=irIYlf5WoFbPGWpVJt4Aw1Uvp/IzdQOpW5w6SFgi17E=; b=PudUPyJB73zfUNnqUyDAadFz/m5KebmASkIG0CA4z8RaM7AGYpBkiDbWh5xhiGt8os CgV0dUuBksk7ORkkl4/vbadC1k56fMEj9K2beXedxnNAnX7mfTDYnlb8awYSqBbNw8Tf XX92SXA1wf9SJe4ojNrFHIXZqkOacphfwjnVKjsbQiNM0uPUSLWYMEQO4eoj+ar7ZICI t8pYzd/ll2xJDUNwDesmvJXTqs72sv/dH0nnJ67xwdWPjlKOTE4OdEN76hQuJGOVSI7a j6zOHPwG0khQyOSb7DRVkBFlLfZFaUKJsn684Zha1Fx3sMZIJtXHfIQnrSk44DDJT+m3 9Arw== X-Forwarded-Encrypted: i=1; AJvYcCWp1DprKwbFvcLeZvtLoZ3Xk4eMQ1OytNdRHWAea8t94SRycLdMqcj2ZBiOxIHGxAEJwGXPPppjDyT4Jas/jKvEpEmtp0qvcNNqCsDOieQXuepRQtJ04qunVfCzQ5ehSQ== X-Gm-Message-State: AOJu0YxW5NXGBhuCbzTD4WW+RvchNtHIPlbfL5xMbnWfRuEpohZ0q0h8 XEUIV4NmPjFfZgk/Jfway2W3zxwDcvlsP7uISGYELHbimQs8xSSF X-Google-Smtp-Source: AGHT+IElr9+azYHPCzUFeTz1EuYFHglVKOWVA4EowaDvaPKZHxot7h8o9eZbcs6oAHVCQxDmjIZ3Sw== X-Received: by 2002:a05:6a20:2589:b0:1a5:6fd3:dff4 with SMTP id k9-20020a056a20258900b001a56fd3dff4mr1361769pzd.13.1712307770983; Fri, 05 Apr 2024 02:02:50 -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 s12-20020a62e70c000000b006ecf25d0b8dsm995783pfh.184.2024.04.05.02.02.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Apr 2024 02:02:50 -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 , Nadav Amit , 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: [kvm-unit-tests RFC PATCH 12/17] shellcheck: Fix SC2124 Date: Fri, 5 Apr 2024 19:00:44 +1000 Message-ID: <20240405090052.375599-13-npiggin@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240405090052.375599-1-npiggin@gmail.com> References: <20240405090052.375599-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. Signed-off-by: Nicholas Piggin Reviewed-by: Andrew Jones --- 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 e5750cb98..89a496014 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 Fri Apr 5 09:00:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 13618725 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 7BFE91607AC; Fri, 5 Apr 2024 09:03:00 +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=1712307781; cv=none; b=DBi9vJjzxPDrnFPgfo8dlC/PjM2ZbcBQZkHj9lGQIO3UotGEWSlLikK41DRr3yepiMZWaKAayvmwc+amJ/AA+NnHdAPYJBNdhP8zFuKr+cnapVSrDML3yEwFKmpWSNeJ5OVHF683mgVTVFqp8vL4sr2zaQB2xaRPKdiolEE7eek= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712307781; c=relaxed/simple; bh=EAtbJa1uGcSNumSfbYbK82PzgPPN/6qFy0k8JsSEh2o=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=bzwu9RdY/Dwn0KBoh4jI2TabmgOv+K561ka1eYVzEqXf6XfgTPW6pIbmtXrt6D1r0jkpQaYJUZ6z6+F1CkaeW41gUzVooPL5YtZ9HAi4irskDnlmRLFLNDODIfP8Bw3evUKwAyt5GaT0HG7XidzEwmhiz4Wu4T7RhacWeHcE0XU= 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=JvC8/iv5; 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="JvC8/iv5" Received: by mail-pf1-f173.google.com with SMTP id d2e1a72fcca58-6ed04c91c46so64875b3a.0; Fri, 05 Apr 2024 02:03:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712307780; x=1712912580; 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=gmkt4qhFZhSEnd+pxfVPyRti/r9TlYGWMJpmXepb5wo=; b=JvC8/iv5lYSL5c6P6jIPFfDER13h2xLmJfvgO+0OaNfTFWQzaAqptvMkfxga4OqrIJ G98tx+mCTMhA3uyLqnTmRdVhHkIftqDD5YwasSs52HY9oD4Z5WJW3KCuujNFEMAcGqPZ iPTNR4ZTOfDUoHVj86P3RS4j6Hz17wY3xhMOzCzzaSATNhZiLZPBfV1AVeloLVPDjwP9 gxm4vfhr5L4jssEpFrwkGPbSgrho4ZJGugCyzxcxjwPseDvvEzVjQ1ZYlyyFWFQLoEAA jwOxga71N4TmvFUMOJN/8w1vWLISu79xUpLw/WI/SCDOF9t0tekYAaQJsOiO0YLiPuTq ya+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712307780; x=1712912580; 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=gmkt4qhFZhSEnd+pxfVPyRti/r9TlYGWMJpmXepb5wo=; b=DQaNY27tbZ+F2m8jyRaiomZExoczDMe6m4X+LGkMAGBCwaAIAJtCM1YKLX4dExoiqp drogAMK+lUK/X+S7bobEmcuuPyeXknEugYrIFBZKZxQIHdZyA7ZqITKaShGsvkI/WMA9 cGKOhsQl43d6SDq+59RzoOzN/nUVoH3CUjxki0Q+V0+HizMeg/bAzAiqowu5p2NG7dri ES8cVHXB7d2Zb9xHoLFzhP1cVBVtV/aAwtEhueLeXVfOlDeIm1YIHT9hE7YOOvkC5ZBS Dr6n1hvwJpow4hD5ECCtfEdKDZj0d+IoYaKf8coC773O2O8VXm/qA2lpFr/1NzyOYe0w cA2Q== X-Forwarded-Encrypted: i=1; AJvYcCW6HRsiaL8bj3yHBTJkBQRK7Qetmu7j9tGokPtKygMEwSWXcGCiEJ+9+Kj/0klx9jcmq6mOO3PZcBYOJ5WCa/X17HEOofsxRCTSk4YA7AqjkKRe7yN17lyBMLqfvWrPrA== X-Gm-Message-State: AOJu0YxdIEiFMzPY0vo/Uz8FQRPds4GINPl4OcsZF4nylXIBxgBdwj+9 y/8FG74o9Eyw9Skp5w1OA2qFfMZODZw4kKxUEwu3SSyYryUqQYuR X-Google-Smtp-Source: AGHT+IGL+jM7I5Xj0jEMVbIu9IEgKgrsozrrThogKrmDVWc//cKRXd3PlSR8uLhql0Pf8HhB7qsklg== X-Received: by 2002:a05:6a00:98d:b0:6ea:d114:5ea1 with SMTP id u13-20020a056a00098d00b006ead1145ea1mr964542pfg.17.1712307779850; Fri, 05 Apr 2024 02:02:59 -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 s12-20020a62e70c000000b006ecf25d0b8dsm995783pfh.184.2024.04.05.02.02.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Apr 2024 02:02: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 , Nadav Amit , 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: [kvm-unit-tests RFC PATCH 13/17] shellcheck: Fix SC2294 Date: Fri, 5 Apr 2024 19:00:45 +1000 Message-ID: <20240405090052.375599-14-npiggin@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240405090052.375599-1-npiggin@gmail.com> References: <20240405090052.375599-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. Signed-off-by: Nicholas Piggin Reviewed-by: Andrew Jones --- 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 89a496014..ed440b4aa 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 Fri Apr 5 09:00:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 13618726 Received: from mail-pf1-f175.google.com (mail-pf1-f175.google.com [209.85.210.175]) (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 A835515FA79; Fri, 5 Apr 2024 09:03:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.175 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712307793; cv=none; b=DzrYd6W5FC1Ixp07mao2ExqoCqU0sOkU/zvtda0sruh0HXMFZZp9AqQNLY1OL35WslYCBaEM6ikIqDULZPhM7T4hLke6J1eN0WkUTxUvAypwPkINpD0b9Fy5/MepQSdxIHPtDCBRYSwjxLd290bnSfkA4bBCqUL7f2iDi/azhZ0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712307793; c=relaxed/simple; bh=6p41UD/Qlbix35q2GMWXKkxcjMPc3SCEBB08xXaduLo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=oC7n8+TJZTlSel+MfnudoNr5EheowHM7wBVnZ1YhjSy+pko0XkkAuWjw5S8utKJCA/AgNu5p1uj+Jlonfgm5WC2wc3DjUKY9qhn9/oahnftns9f+rX1ASy9ABCfxBMGqiI3QFV82hD/vVcJrUB6bxG7B3ANwbJNy/7qnqOiyvBI= 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=WwpZcVM2; arc=none smtp.client-ip=209.85.210.175 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="WwpZcVM2" Received: by mail-pf1-f175.google.com with SMTP id d2e1a72fcca58-6ecea46e1bfso1659893b3a.3; Fri, 05 Apr 2024 02:03:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712307790; x=1712912590; 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=R9jePsdBCGcy8FOcE4Dl0oxWEJ48LRHCUA6lv3K1JxQ=; b=WwpZcVM2pggQBh2At7BvrUGZyXfi390lQbCyxpvav3vCi+b4v71sJeQme9m32f1EgG Zvy4IV9Rtx/FkIMPPHqkGwetSBXFQLet70NiEshjHJrVcIkTuDHSgoRuMY+nFwitpadl LCwO+qPndKwQoV4/54gWQi7+ZTNbrfArHNJ31JxkCBYWUy3fbNEqOmKWHmgkeFBZ38eg RUNlm5ZqGVudwPZ1fRKK6T5H6ggVRl7mdGorAdgYZoyVuNWfvrMODorJLC8CnoD3WWgm rVmD/houT3y9dck1mpiioheVn9h9+29AEd/VSpLvBVBnshYnVvjx+gA8dqRIcM+6pIQk kRKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712307790; x=1712912590; 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=R9jePsdBCGcy8FOcE4Dl0oxWEJ48LRHCUA6lv3K1JxQ=; b=Fx5odcc41+6EAFJBHImAlok9zycqqOhmhom+lxhbLDfOGq4ZEmnQyHCUwLEYCHJt4U Hu3qvEk4WMPPDDlC7qh2V8iXx3EHGh92WWos1Dk2yd1SmpQRAS3FRQSDR2ZQZnqb+UKQ QXHMU9ud/w1YIMKXvWfzQWtr5iVv0jJMjcaE4WLq3hBp3JyQe6mQKWvOZlQm9/mdQ91Q T/M40rljm8RDz61sOVkKh2RVPUrSt226vF8fg1P3U6y98/3kSrdw2QmyYTfaszHnUbGW e5Tz9M/fuY2H1Wh2NenFYhqMtyryy4zMI3jPa4QpzLgSWS2ofJeNAV6R0Q7qLYAUUDuF aSAw== X-Forwarded-Encrypted: i=1; AJvYcCVV3WRoywxxhw6aDSQfvX4QObMiZGEkGOgUvkQIAIAac9z4hTbpSKqKTOuVGgw6bXjIB9gegnK9J9Ar+3iMoBcRx9XtX+u41JTh7MdK0NGlxyKq7NGxgCR0uuUTzf5E/A== X-Gm-Message-State: AOJu0Ywov47Wasbmtq838fJACNOtYLS6Rh2TdLxmpB/9zqTU8NXS1X54 2SMOYtwMNzk8VFQQHqkaHNfg9SVrZNvCRLuRLbTXysdHYAXdu+OP X-Google-Smtp-Source: AGHT+IEMEJ3nCJeD++W+neSnwL46t0FBmKBloHUglg2zIiLw0F8GdaDYwaaevNYobN9Y4Al5iZ2kEQ== X-Received: by 2002:a05:6a00:4f89:b0:6ea:e31e:dc75 with SMTP id ld9-20020a056a004f8900b006eae31edc75mr827353pfb.5.1712307789932; Fri, 05 Apr 2024 02:03: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 s12-20020a62e70c000000b006ecf25d0b8dsm995783pfh.184.2024.04.05.02.03.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Apr 2024 02:03:09 -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 , Nadav Amit , 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: [kvm-unit-tests RFC PATCH 14/17] shellcheck: Fix SC2178 Date: Fri, 5 Apr 2024 19:00:46 +1000 Message-ID: <20240405090052.375599-15-npiggin@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240405090052.375599-1-npiggin@gmail.com> References: <20240405090052.375599-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. Not sure if there's a real bug. Signed-off-by: Nicholas Piggin Reviewed-by: Andrew Jones --- 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 Fri Apr 5 09:00:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 13618727 Received: from mail-pf1-f170.google.com (mail-pf1-f170.google.com [209.85.210.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 B52B815FA79; Fri, 5 Apr 2024 09:03:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712307802; cv=none; b=Gk5flg35G6glhQYamkWf1MgxmPghz0TFI3SI37yd3wgef1Y9tFtI+TY3wzPCZvWMtJO2opngG1GCT8zDdPvfxu0ygFlGvR/139k6hA8oWTwsqI3yNTM29m5lLeMudy/l7fSPtVZGk7vZ8vysNmWQKLtEt9uqShmVQItTXBQ2Aus= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712307802; c=relaxed/simple; bh=Q9N10wDNVQO2Isx1GrQkRJ55/A8RSrRwkxpCPQXpaCY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DHJp9NXaIFDBbnwn6cyoMu62n5P2D75aFYYCgagK8sd+on8xLwD6c6E7Vg6N9wOU/upRXAYWRwrHUwLvSTiBIQlZwVhJcdpPIzX2uVz9gSofLduwegWfdFnrQ2bT8xcm5zDqgpOr958kA0pWUG+veOPY0uqbCL7hXb7EnWubvSw= 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=aEqGySza; arc=none smtp.client-ip=209.85.210.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="aEqGySza" Received: by mail-pf1-f170.google.com with SMTP id d2e1a72fcca58-6ecf3943040so962944b3a.0; Fri, 05 Apr 2024 02:03:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712307800; x=1712912600; 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=WZoPeMi4EUbYS5bzq/p7KT/LoRuIgjUs4gHO9gJQvmw=; b=aEqGySzaKG76Quk3RLXr0O3DrrcNp8Fg8VU3WvXKwtvmmZBkZnNw8i1pb9puvzXinM oi6PePHCOVrfKk/XQWjAy3w1h1XPEGVoGgTQTR7v8zNJsj2/5k8R70L9zd6TYGS8M/KJ FzRIoXhCUHkFrsn2xceXMIONPDyGCD8mtSM2lGLG9oJItGjam1LZ1G4c8YT8PCMOPA/1 BPHypQyjZ18VfFMRK6szrfsCMpkLGz702tNkWIfP/e5DWjmgSLcwGD23vmWMMsOWG5Kr IQkUDC1IY/EyKBp3yUx0i7k9Q7DEV0WtB89G4vBASBljuSvDNKZpVAjHrl4oDX7ImOOF cVog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712307800; x=1712912600; 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=WZoPeMi4EUbYS5bzq/p7KT/LoRuIgjUs4gHO9gJQvmw=; b=CvJu4ZV77vqmrU58EPYiccLiF4ndle4wpT3ky2K3+HgkZ3XRJdZL6uvCMEWDZeJSYx fP/b24dveR8RKAiKatKMuIswMmJw/IsCKHPrsCJPacvVB3375isHG/F1y/xMBBf8JlwG CAiRoexZivZGTtLeRHg1tBkolbT4xldd+p1AQKqmZITQ8DQIJi9ECDTxM1ZWVvBKrr1Q QIF+Lv8wZtOecQmE/EJ5FPKWKnYa7LufJmfiQhzoo7PQAQ421Zg873PKx09+Y75Kn5gc EXZPPJ9TN5TIVjskPwD6rYm67eKVK7g8P+AGp7w3/tSWaRvdHE9wAwwdR2VPVx8pVin6 jnsg== X-Forwarded-Encrypted: i=1; AJvYcCXIOu75DhQ3g+PxcVr+aMeeJWxwJAn635iSq5qST3pLXqPh5cw7DRCQBo8C/Vlc+ihHqQOdGBvo27X2c96dRJM9O3Q6JzfA7e4FqAxpgazXZK2BOt0SOfdLN8pB4c8djA== X-Gm-Message-State: AOJu0Yzl4/pBUDrQFZuh1uysflmP+6yylMebAjBC7fC32QjX6x2ZRIi1 SBuUEJDiBoQr4nESZF0X5gCOg8RP9Z7dHgvQmMcC7RFcSovok9C5 X-Google-Smtp-Source: AGHT+IGhF6M+sYBw6xULHEvA6i3LuA5ZQUV1BEY4WWHLg6fW1cN5WbIu03G3AJlZbUnpEKHDGrYjVA== X-Received: by 2002:a05:6a21:9996:b0:1a3:55d2:1489 with SMTP id ve22-20020a056a21999600b001a355d21489mr1068416pzb.7.1712307799958; Fri, 05 Apr 2024 02:03: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 s12-20020a62e70c000000b006ecf25d0b8dsm995783pfh.184.2024.04.05.02.03.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Apr 2024 02:03: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 , Nadav Amit , 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: [kvm-unit-tests RFC PATCH 15/17] shellcheck: Fix SC2048 Date: Fri, 5 Apr 2024 19:00:47 +1000 Message-ID: <20240405090052.375599-16-npiggin@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240405090052.375599-1-npiggin@gmail.com> References: <20240405090052.375599-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. Not sure if there's a real bug. Signed-off-by: Nicholas Piggin Reviewed-by: Andrew Jones --- 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 Fri Apr 5 09:00:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 13618728 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 482A915FCFA; Fri, 5 Apr 2024 09:03:29 +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=1712307810; cv=none; b=ms7jSBVQ9Yl7FxuQymqMsymeb9N32NNOkCLU2PHFbbupLSV6xlfp6x2vW5HKngiZHTY2mi3GA759FrCUW9LwfwjzhFkZHXbd+EBrA0LlGg+vHi3dRvLqtCStV3QRGtwOFTO6rYzIW+ofMqBJekxfwVI2pZpMGHdLo0hQ3eXPPMI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712307810; c=relaxed/simple; bh=OSqsyeBYuUgPPx4PzD0nDj2h27raEgPA3BttTW7g4bQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=GIn3F6NkcrwyOshdPES88jgYACJ7BhB4zvSlMFPQsgHhBNxI0SIr6P3gTK1yNQKo1+9FM9neUcSdkuqoHf6J8RgYcPCHU/68ON5vEKTNjqNo78k+lzcSFe24V5ZF4BpoAy1EuzbwcDI5Tigwr8GY2zo1xMqlFNv9nHBbK25Ujqo= 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=FocAB8rP; 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="FocAB8rP" Received: by mail-pf1-f172.google.com with SMTP id d2e1a72fcca58-6ed01c63657so224425b3a.2; Fri, 05 Apr 2024 02:03:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712307808; x=1712912608; 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=N6QzAi7vCknWCSn8NS2P26SXGhMEhJFXPF1hl6gc7nk=; b=FocAB8rP5rEpwbB/W0NR+jRmBewH4nqtgdL04BVhYumwWsNx+p09WA3tPEc9m6riV0 0z10mbDNPPQ4PdLIFltRDE66Gl+uGRwtzPJr9fY11+NILPBo/m25WTelIKkp7Ikfy5ZI e6T27Z5yk4QZqPTEkK1kxtX3CLo3gigGlxbqREWiPGPLs5yRN84Ng9Bv/iQBeEW3UrUP QPc6/+NyQ0BvWYF0waE/6Ir1ZdtGPdzKVwb8LLPcU9OyGuqUXBVzRp/UsOqzOJh2V/9h /dBeX3M1yob99ToXUOcSH+qaN55BFE7ArGq9VslRfwkLGUrz5vJD6iCv0ikS8O07MBPS 0jiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712307808; x=1712912608; 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=N6QzAi7vCknWCSn8NS2P26SXGhMEhJFXPF1hl6gc7nk=; b=umE11aO04e+M/m1NGgd6s50Ba9Khq5Z76ZfMa8wdb+uQaYYZ+GLX/1b541Zm7ORcty LAWFcIs26TDvlh4UjKAX+pIpWyRZKJp3ryuNt0NZEjoZbLHVv3KJFxm4lnwMHWsugIYp BFTsxt68cNeEVVHoX+V1CJRlm0iWML4Iq0/pJOiRxEC41ZTNyTvS1s/iSUI+bOf8L4YO ExFwMbo+y/7c5rUpQD5jgsVDxmroWE8QGg2ay8YrK3WPkTAfb+89QaxJlxmvB3Tpg5MW 04IIaAYfDZdGs4TpvM9rbkCuvh+iqLiSLN2wPBLkHQ/rFYN5oWqlq3fSwNLgbMIlkHBH mCNg== X-Forwarded-Encrypted: i=1; AJvYcCVa6GauFYQEkP1K6zife+ETV0OcXmjjo80Qk4DE7wZwfIc/wJWaeyaRXVdotiyo2w24L9ox1XNSHG4knPrPIR4xwlidAPwzQhpnkc7FEqhdJrLKtNbotFpJiWdTrZnZZg== X-Gm-Message-State: AOJu0YxQ1SzwbJut4Ovi/c8gHgD72LdaZDFf8PidcWfx8xWs4bA3Z2Zb uG9rgDSERvqxHWL6ObkIGLb5UN4b/Wnp22L6AdivF1o0cpB3VU/k X-Google-Smtp-Source: AGHT+IEIbvzhR4Vb46KhNonnfT+UvilCqW0L9youNLHT1B8fzSApy5lkKFatECJ6OHe0njlNIb7qaA== X-Received: by 2002:a05:6a00:809:b0:6ea:f392:bce9 with SMTP id m9-20020a056a00080900b006eaf392bce9mr862456pfk.15.1712307808567; Fri, 05 Apr 2024 02:03: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 s12-20020a62e70c000000b006ecf25d0b8dsm995783pfh.184.2024.04.05.02.03.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Apr 2024 02:03: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 , Nadav Amit , 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: [kvm-unit-tests RFC PATCH 16/17] shellcheck: Fix SC2153 Date: Fri, 5 Apr 2024 19:00:48 +1000 Message-ID: <20240405090052.375599-17-npiggin@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240405090052.375599-1-npiggin@gmail.com> References: <20240405090052.375599-1-npiggin@gmail.com> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 SC2153 (info): Possible misspelling: ACCEL may not be assigned. Did you mean accel? Looks like a bug? Signed-off-by: Nicholas Piggin Reviewed-by: Andrew Jones --- scripts/s390x/func.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/s390x/func.bash b/scripts/s390x/func.bash index 6c75e89ae..fa47d0191 100644 --- a/scripts/s390x/func.bash +++ b/scripts/s390x/func.bash @@ -21,7 +21,7 @@ function arch_cmd_s390x() "$cmd" "$testname" "$groups" "$smp" "$kernel" "$opts" "$arch" "$check" "$accel" "$timeout" # run PV test case - if [ "$ACCEL" = 'tcg' ] || grep -q "migration" <<< "$groups"; then + if [ "$accel" = 'tcg' ] || grep -q "migration" <<< "$groups"; then return fi kernel=${kernel%.elf}.pv.bin From patchwork Fri Apr 5 09:00:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 13618729 Received: from mail-pf1-f179.google.com (mail-pf1-f179.google.com [209.85.210.179]) (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 165AD15FD05; Fri, 5 Apr 2024 09:03:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.179 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712307819; cv=none; b=PNr9gq3Rq6sm/yBNH+9NxmSXHJwPUSsPXWwcUopkgxlMqx//f8JtKarwO0GY7XFh1OaHmpelWHqSV/prxBUB4QTC5giWJnBQ9XDIlstes5rlqll+w/YBSLhHF/evnOPx0DX5Pb7/zhBfgSG/PDolZ3r63DdgZ/RoNxM9C0LcgjA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712307819; c=relaxed/simple; bh=rlL2+FErBdos2+O/hylf7fixnJvVATK9Gyb1N4Ov7ZA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZiFe+0YvdVpYhqaQjncoA/HlRk/qwtpsyXV1MqLnzawQfB5189RPYfSwwOyOw4n1TYFeIXrntdzeS0cokoOGZ8ilfj6glKACgI0FtdXYMVf8VZtk47KppdiMU8X0uJoLLUQsfwcFpViltgR7ZxbQ1SsLgMkhoskq7Uo10fUhEDE= 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=RWZU5hha; arc=none smtp.client-ip=209.85.210.179 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="RWZU5hha" Received: by mail-pf1-f179.google.com with SMTP id d2e1a72fcca58-6eced6fd98aso1445352b3a.0; Fri, 05 Apr 2024 02:03:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712307817; x=1712912617; 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=uiRGj9yVp2/RttD7SIRbJPPpByI/TPSbVrR2YfMTJYI=; b=RWZU5hhaPdKeEtzbfjMaH3g90DiuO1qrC8s4SbJ4VWAaHRkxTFuUdTMmf0ekOTYWnj B9kdPYxBJjwHFTHHo6l8JID+Vs/sLRENoxtIS1Cwmlk5Cl52GcSuRIK3pWeEVx8+0a4O wPfkKBPRgUgcGieJzUaYYtDBMbRe3al1PPuNiCD+bT6XU31eFvQrSrN9Oag2TxKQHhaA ZW6p0UwLLQPy+RMShgulDfCUOPw/DlUpiohMNgUfffeNWVy1F4cx1skj6ZNognWfRXX8 8VGDl+iGxirx1r8wa+1WcMcUzdzsymwfhnK8Y0fItx0/M99qysm1Hx1+nyC/QhVccn6b 9GLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712307817; x=1712912617; 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=uiRGj9yVp2/RttD7SIRbJPPpByI/TPSbVrR2YfMTJYI=; b=Cw/sM7nB/xuV350kKwsDDTzn+xcPvXQTrJIixC7ccR0zlnIxEyYMs1XxBHce4P8/sx QviIiq3SqLFS5P0usAsSXqBs3kuQxNPbact0QhiruF7fYKgZTIVODiulcpS+TSV5n8cr 21jR90Yz18K73wKgz+AOYgsxA3w+V7NNxVaK1faC43BpyfrEibXQOggmf22eK+8DJbff 8s6Jopap1O0/4mo0GK1qi6DavE8rsFLteylf0rhTLNUsAi0307HZDVFC1n79npRw1mkX Vjxrw/bDKSUsofm57hoFsWBVsivQ9n1Lx1i/RT5WpHoeW6jJWClGWJY6AQyevAQk+Lsp FMWg== X-Forwarded-Encrypted: i=1; AJvYcCVidAiwoBanzyLUAqZOeS1AAbyXiIk8q36lHL3ThIX2NeqYTmhXFyCwN5Znzr9dZ7UTTmVa8HhjEx1cijpimZpxJ0OlKz1dsZIRwXgeXCSVSmU1jtSJwPR3aik3QPBl3A== X-Gm-Message-State: AOJu0Yy82z3SOR0lxmKCFLva6y9ydlZNuaQVw5Af26ogF7lSxiYwiR9l vI9auNxU7jl/LclU11nUmuz9eJzsKEkSR8/JopO+jWVxljn8VT3j X-Google-Smtp-Source: AGHT+IFqNZOWLsGBfX2j9GyTIkY7CisycE4Gye8dmhOPb3YIK0IRM5IIkvfRtFIykc5HqnGn3C5teA== X-Received: by 2002:a05:6a00:4fc7:b0:6ea:749c:7849 with SMTP id le7-20020a056a004fc700b006ea749c7849mr907567pfb.13.1712307817273; Fri, 05 Apr 2024 02:03: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 s12-20020a62e70c000000b006ecf25d0b8dsm995783pfh.184.2024.04.05.02.03.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Apr 2024 02:03:36 -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 , Nadav Amit , 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: [kvm-unit-tests RFC PATCH 17/17] shellcheck: Suppress various messages Date: Fri, 5 Apr 2024 19:00:49 +1000 Message-ID: <20240405090052.375599-18-npiggin@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240405090052.375599-1-npiggin@gmail.com> References: <20240405090052.375599-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 --- run_tests.sh | 3 +++ scripts/arch-run.bash | 9 +++++++++ scripts/mkstandalone.sh | 2 ++ scripts/runtime.bash | 2 ++ 4 files changed, 16 insertions(+) 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 ed440b4aa..fe8785cfd 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,8 @@ run_migration () -mon chardev=mon,mode=control \ < ${src_infifo} > ${src_outfifo} & live_pid=$! + # SC complains about useless cat but I prefer it over redirect here. + # 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 +231,8 @@ do_migration () -mon chardev=mon,mode=control -incoming unix:${dst_incoming} \ < ${dst_infifo} > ${dst_outfifo} & incoming_pid=$! + # SC complains about useless cat but I prefer it over redirect here. + # shellcheck disable=SC2002 cat ${dst_outfifo} | tee ${dst_out} | filter_quiet_msgs & # The test must prompt the user to migrate, so wait for the 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..c87613b96 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 allowed in the check parameter. + # shellcheck disable=SC2206 check=($check) for check_param in "${check[@]}"; do path=${check_param%%=*}