From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from atuin.qyliss.net (localhost [IPv6:::1]) by atuin.qyliss.net (Postfix) with ESMTP id 90F8F1EB7E; Thu, 13 Nov 2025 12:23:23 +0000 (UTC) Received: by atuin.qyliss.net (Postfix, from userid 993) id E8DE71EB74; Thu, 13 Nov 2025 12:23:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on atuin.qyliss.net X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DMARC_MISSING,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=4.0.1 Received: from fhigh-a2-smtp.messagingengine.com (fhigh-a2-smtp.messagingengine.com [103.168.172.153]) by atuin.qyliss.net (Postfix) with ESMTPS id 1978C1EC12 for ; Thu, 13 Nov 2025 12:23:19 +0000 (UTC) Received: from phl-compute-01.internal (phl-compute-01.internal [10.202.2.41]) by mailfhigh.phl.internal (Postfix) with ESMTP id EC56F14001B0; Thu, 13 Nov 2025 07:23:17 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-01.internal (MEProxy); Thu, 13 Nov 2025 07:23:17 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alyssa.is; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm2; t=1763036597; x=1763122997; bh=WPidpyL+N5 8dCDNO+49ChhMUshu6q0AXUTSrKdqK3mc=; b=YWLo3ePs1jn7iLHoE59v9842Ci cQGEIZY5OxkECnp1365HxsJSp2/3wTdd7L4n0d2QT7ldP9WrWCpA5iEgx87dr3zD KaDv1gTVnzghx72IYPN2L9SOm7Zb07/RzJ+3OakW5k+Hf9AHfQJsq9/TYbP0eK83 OSb50VwrwIL9dL7ZVatydLjkm/xbcJPd1wm0flMyvAzRALQmrz6DJrZLtIwzixu8 GDjtYKK4m4JfFWtutNrYJUN6U1uFMtz8ferEE2AdlbBufAdbmGQDyWCHRnYoQzKP lLN9e1ClwjvfTwe53ANjMDxGjpjvxUSMM/MPdqkbdF0ag1W23Uqqrlk7AqKw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1763036597; x=1763122997; bh=WPidpyL+N58dCDNO+49ChhMUshu6q0AXUTS rKdqK3mc=; b=pNMaw/eQju1JHnoGvKVsiLLaDbrjlrqNd949R+SEwIBlJIwftO8 7WQ3JV3F6O1ZxfPmAJCUYSmuiXme1IFENMywpYwXamyTELoPJXWMXerWroSorReV RWMuOxjHNijjU3mcXUnpqB5UgBr2YoKSfnIbKBcO6/6y7afGKLffENl/r9dmF/dp H5qRXEHsNRJE9sycxUc6wFSDH0kGCOBrK292OP6vrxzJKVMo18Xfnk0NawkMj1q+ tp2NSF7W8tF6MGSekbzKkLdDHK2on0a+/S/8JC8q8VIn1kKmbPYSF5pjRKw+dGqI djUpI6YT3OwJeu7nIoLl67wK+/WFkDtIU4Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdeggddvtdeiledvucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhephffvvefujghffffkgggtsehgtderredttddtnecuhfhrohhmpeetlhihshhsrgcu tfhoshhsuceohhhisegrlhihshhsrgdrihhsqeenucggtffrrghtthgvrhhnpeeiudffue eilefgtefgtddttdekkeehkefgheekudefveetgeefiefftedvteeuveenucevlhhushht vghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehhihesrghlhihsshgrrd hishdpnhgspghrtghpthhtohepvddpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohep uggvmhhiohgsvghnohhurhesghhmrghilhdrtghomhdprhgtphhtthhopeguvghvvghlse hsphgvtghtrhhumhdqohhsrdhorhhg X-ME-Proxy: Feedback-ID: i12284293:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 13 Nov 2025 07:23:17 -0500 (EST) Received: by mbp.qyliss.net (Postfix, from userid 1000) id 6C1516966CD4; Thu, 13 Nov 2025 13:23:16 +0100 (CET) From: Alyssa Ross To: Demi Marie Obenour Subject: Re: [PATCH 1/4] scripts/run-qemu.sh: better error checks & formatting In-Reply-To: <20251107-simple-sh-quote-fix-v1-1-5f2d35260c4d@gmail.com> References: <20251107-simple-sh-quote-fix-v1-0-5f2d35260c4d@gmail.com> <20251107-simple-sh-quote-fix-v1-1-5f2d35260c4d@gmail.com> Date: Thu, 13 Nov 2025 13:23:13 +0100 Message-ID: <87v7jeglzi.fsf@alyssa.is> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Message-ID-Hash: DSTG4OATYLCX45FY234ZYZDD7PTP5F3E X-Message-ID-Hash: DSTG4OATYLCX45FY234ZYZDD7PTP5F3E X-MailFrom: hi@alyssa.is X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-devel.spectrum-os.org-0; header-match-devel.spectrum-os.org-1; header-match-devel.spectrum-os.org-2; header-match-devel.spectrum-os.org-3; header-match-devel.spectrum-os.org-4; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Spectrum OS Development X-Mailman-Version: 3.3.9 Precedence: list List-Id: Patches and low-level development discussion Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Demi Marie Obenour writes: > No other functional change intended. > > Signed-off-by: Demi Marie Obenour > --- > scripts/run-qemu.sh | 24 ++++++++++++++---------- > 1 file changed, 14 insertions(+), 10 deletions(-) This is a lot of changes all in one, without individual explanation. I'd appreciate it if they could be broken up and explained, because I'm going to have to ask what the purpose of each change is. > diff --git a/scripts/run-qemu.sh b/scripts/run-qemu.sh > index 64fd29259ab108bc547cb7c74623ae9dc288b3b7..9c6c8193bbeba5916038c82d8= f76992051719c19 100755 > --- a/scripts/run-qemu.sh > +++ b/scripts/run-qemu.sh > @@ -1,11 +1,15 @@ > -#!/bin/sh -ue > +#!/bin/sh -- The idea here is to be robust against the script being invoked with argv[0] set to "-c" or something? > # SPDX-FileCopyrightText: 2023-2025 Alyssa Ross > # SPDX-License-Identifier: EUPL-1.2+ >=20=20 > # This script wraps around QEMU to paper over platform differences, > # which can't be handled portably in Make language. > +set -uef Adding -f makes sense. > +if [ -n ${ARCH+test} ]; then > + ARCH=3D$(uname -m) > +fi >=20=20 > -case "${ARCH:=3D"$(uname -m)"}" in > +case $ARCH in > aarch64) > machine=3Dvirt,accel=3Dkvm:tcg,gic-version=3D3,iommu=3Dsmmuv3 > ;; Why is this better? > @@ -17,13 +21,13 @@ case "${ARCH:=3D"$(uname -m)"}" in > esac >=20=20 > i=3D0 > -while [ $i -lt $# ]; do > - arg=3D"$1" > +while [ "$i" -lt "$#" ]; do > + arg=3D$1 > shift >=20=20 > - case "$arg" in > + case $arg in > -append) Makes sense as long as we're consistent about it. I wonder if we could get the formatter to do this. > - set -- "$@" -append "${append:+$append }$1" > + set -- "$@" -append ${append:+"$append "}"$1" > i=3D$((i + 2)) > shift > continue Don't understand this one. We've gone from one set of quotes to two sequential ones. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEARYKAB0WIQRV/neXydHjZma5XLJbRZGEIw/wogUCaRXNsQAKCRBbRZGEIw/w ot1YAQCjD/fLlb4gDfAEACySbdYXWxRGW4mIEq6zgyLrQw5KvAD7B3rEGt7Qg9IP f417r2+Z8+r0GYOSray/55hSBMKDXgg= =/3cX -----END PGP SIGNATURE----- --=-=-=--