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 ED87DD328; Fri, 13 Jun 2025 14:05:36 +0000 (UTC) Received: by atuin.qyliss.net (Postfix, from userid 993) id 61784D2A4; Fri, 13 Jun 2025 14:05:31 +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=5.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-a3-smtp.messagingengine.com (fhigh-a3-smtp.messagingengine.com [103.168.172.154]) by atuin.qyliss.net (Postfix) with ESMTPS id 653B6D24D for ; Fri, 13 Jun 2025 14:05:26 +0000 (UTC) Received: from phl-compute-01.internal (phl-compute-01.phl.internal [10.202.2.41]) by mailfhigh.phl.internal (Postfix) with ESMTP id 99CD51140192; Fri, 13 Jun 2025 10:05:24 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-01.internal (MEProxy); Fri, 13 Jun 2025 10:05:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alyssa.is; h=cc :cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm3; t=1749823524; x= 1749909924; bh=Uq/5oYKrj+3lxeaEWHgCdNNn8CObyMEnnGBpiuL6uow=; b=X i2TIzxLGefY6CUFSolZi/WRBpcAjdXxsVrRsDzO5fsAxwhShLwz/2rBMBZPsIOV1 r6usb1s16qmb+v7zKuM9pUAwih2rK03DH2l+BBpMPpLxXAK1M2g8mhyCP2MKH/cE +eIn9TZVMa8Tw+O3j00iO+AhzfyswcxUy+21zG1yzNuRtyey+azPk47DwB5iQNfc yGTm4ih1ilsC9evgmk3EID23snXc8L0JZE/GxaXsB4/+JT1fAwmdgJ710h2Oq20W WZ5hKCcTLtUeASN8UfKoh+9LHJed0vUFv57n0qljojtMSj8vHKDdveOf2J7wCyux xHMFqu1rOqkq9nRWZF9ow== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :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=fm1; t=1749823524; x=1749909924; bh=U q/5oYKrj+3lxeaEWHgCdNNn8CObyMEnnGBpiuL6uow=; b=jykL6EoTy2tf2FWwo Is/L7K9j6qXqVmuqdwwwL1vL73O48P18qL+0t3GLaM3XHevaGeS3DvuVDIEDhTfc LVdg0BwvZuKzmTkIdXK6uumPLxr7/akvgjQ8fJsd5Gh32Cq3CCkbsclDeD3qV/yE BReLo6rz9N3XkDF8nxKgheoOBks8ADjR7CCdh4U9aXtcqnXtcaGJPIbl+rLA3kjq qIvFHGJTCGmaiD06LLpBq4C4aWWMe2nejvG+kk33Wjc86DGjXDDn4ZQ0rbO6lqHL ZbgOg15V8YpsfxDRAzmzSKeioDhvRFDkpjE8PGf+ciuYLrfucyBaCdQ3mB1uedRu v34RA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtddugddukedugecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecunecujfgurhephffvve fufffkofgjfhgggfestdekredtredttdenucfhrhhomheptehlhihsshgrucftohhsshcu oehhihesrghlhihsshgrrdhisheqnecuggftrfgrthhtvghrnhepgeeuieduueekkeeivd etffegkeduhfduvedvledvkefhfeeiteekuddujefffeegnecuvehluhhsthgvrhfuihii vgeptdenucfrrghrrghmpehmrghilhhfrhhomhephhhisegrlhihshhsrgdrihhspdhnsg gprhgtphhtthhopedvpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopeguvghvvghl sehsphgvtghtrhhumhdqohhsrdhorhhgpdhrtghpthhtohephihukhgrseihuhhkrgdrug gvvh X-ME-Proxy: Feedback-ID: i12284293:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 13 Jun 2025 10:05:24 -0400 (EDT) Received: by sf.qyliss.net (Postfix, from userid 1000) id D03E2245D6706; Fri, 13 Jun 2025 16:05:20 +0200 (CEST) From: Alyssa Ross To: devel@spectrum-os.org Subject: [PATCH 5/8] release/checks/integration: run from tmpdir Date: Fri, 13 Jun 2025 16:05:05 +0200 Message-ID: <20250613140508.76998-6-hi@alyssa.is> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250613140508.76998-1-hi@alyssa.is> References: <20250613140508.76998-1-hi@alyssa.is> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: E4XKNAWOPXDP2SC4YYZVURH3S6GGEDV4 X-Message-ID-Hash: E4XKNAWOPXDP2SC4YYZVURH3S6GGEDV4 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: Yureka 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: This simplifies the code by avoiding an allocation and free. Signed-off-by: Alyssa Ross --- release/checks/integration/networking.c | 26 ++++++++++++------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/release/checks/integration/networking.c b/release/checks/integration/networking.c index efc7b44..1e5983f 100644 --- a/release/checks/integration/networking.c +++ b/release/checks/integration/networking.c @@ -184,14 +184,13 @@ struct config { } drives; }; -static FILE *start_qemu(const char *tmp_dir, struct config c) +static FILE *start_qemu(struct config c) { FILE *console; struct utsname u; int console_listener, console_conn; char *arch, *args[] = { (char *)c.run_qemu, - "-serial", nullptr, "-drive", nullptr, "-drive", nullptr, "-drive", nullptr, @@ -207,6 +206,7 @@ static FILE *start_qemu(const char *tmp_dir, struct config c) "-monitor", "vc", "-vga", "none", "-smbios", "type=11,value=io.systemd.stub.kernel-cmdline-extra=console=ttyS0", + "-serial", "unix:console", nullptr, }; @@ -217,12 +217,7 @@ static FILE *start_qemu(const char *tmp_dir, struct config c) if (strcmp(arch, "x86_64")) args[sizeof args / sizeof *args - 3] = nullptr; - if (asprintf(&args[2], "unix:%s/console", tmp_dir) == -1) { - perror("asprintf"); - exit(EXIT_FAILURE); - } - - console_listener = setup_unix(args[2] + strlen("unix:")); + console_listener = setup_unix("console"); switch (fork()) { case -1: @@ -234,9 +229,9 @@ static FILE *start_qemu(const char *tmp_dir, struct config c) exit(EXIT_FAILURE); } - if (asprintf(&args[4], "file=%s,format=raw,if=pflash,readonly=true", c.drives.efi) == -1 || - asprintf(&args[6], "file=%s,format=raw,if=virtio,readonly=true", c.drives.img) == -1 || - asprintf(&args[8], "file=%s,format=raw,if=virtio,readonly=true", c.drives.user_data) == -1) { + if (asprintf(&args[2], "file=%s,format=raw,if=pflash,readonly=true", c.drives.efi) == -1 || + asprintf(&args[4], "file=%s,format=raw,if=virtio,readonly=true", c.drives.img) == -1 || + asprintf(&args[6], "file=%s,format=raw,if=virtio,readonly=true", c.drives.user_data) == -1) { perror("asprintf"); exit(EXIT_FAILURE); } @@ -246,8 +241,6 @@ static FILE *start_qemu(const char *tmp_dir, struct config c) exit(EXIT_FAILURE); } - free(args[2]); - if ((console_conn = accept(console_listener, nullptr, nullptr)) == -1) { perror("accept"); exit(EXIT_FAILURE); @@ -323,9 +316,14 @@ int main(int argc, char *argv[]) exit(EXIT_FAILURE); } + if (chdir(make_tmp_dir()) == -1) { + perror("chdir"); + exit(EXIT_FAILURE); + } + int server = setup_server(); - FILE *console = start_qemu(make_tmp_dir(), c); + FILE *console = start_qemu(c); if (fputs("set -euxo pipefail\n" "mkdir /run/mnt\n" -- 2.49.0