From nobody Mon Nov 25 03:04:59 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1719400168; cv=none; d=zohomail.com; s=zohoarc; b=ROYEAgF1T/45UBZm/+QK4N/di8WqSHaDHPSSBWXCvAnA7moVtkRSV84I9/F46acPErfX2IeopvfV3XjIPZXXklD+fm/MWR3row/iFTvsoo4pSQuTkovNKEZOA3OREs9ghrbZYSk4ngXO1kS830aNp3q5bk//FxEr+AyWKgzSGHQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1719400168; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=IDtmLd4DIh+2XRkZ57QtXjyzkDOakOx1Ds4rKdXYuOE=; b=iE9G9zF+x4+Vubmf3mauSyjyKoVh48c7FdZdw/GzK+m0WDo1zDXV1T5GLhsYT1F5fLW63drORHnRCPOgjXbe0qjKVKYt1G7qctw795V8tBAnZyyRqsjqF9UEGPjEQTnO16YsIll4bvm0XCjOz67OpK23u6CzeMuwIym4DUlvZIU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 17194001682529.407912997842573; Wed, 26 Jun 2024 04:09:28 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sMQVK-0007eE-Sb; Wed, 26 Jun 2024 07:07:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sMQVH-0007Vs-3s for qemu-devel@nongnu.org; Wed, 26 Jun 2024 07:07:56 -0400 Received: from mail-pf1-x432.google.com ([2607:f8b0:4864:20::432]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sMQVE-0004wa-Fa for qemu-devel@nongnu.org; Wed, 26 Jun 2024 07:07:54 -0400 Received: by mail-pf1-x432.google.com with SMTP id d2e1a72fcca58-70683d96d0eso2313960b3a.0 for ; Wed, 26 Jun 2024 04:07:52 -0700 (PDT) Received: from localhost ([157.82.204.135]) by smtp.gmail.com with UTF8SMTPSA id d2e1a72fcca58-7069d65dfc7sm2664394b3a.133.2024.06.26.04.07.45 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 26 Jun 2024 04:07:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20230601.gappssmtp.com; s=20230601; t=1719400070; x=1720004870; darn=nongnu.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=IDtmLd4DIh+2XRkZ57QtXjyzkDOakOx1Ds4rKdXYuOE=; b=MmUcDohBTSvlo2NHH7APomDrwVolYb3Z3vp23AkMn2GWrmuomUSlqUufc+wRx5WM12 SA0dhfZESVCBGOlnk87nanuXx3KtgT/8Kz3IAFs7oatxKFArO2oIRPeXlJ2GWDdJCcXn GWsxDNTk+hpiDHnMfnraAiMIG0fLr9nqHdyJsFyI5KNcElqCdHxlK6HWr8S/xjONmZ3m +0JCUMoCZsLQWKpfZEHc5QcdCVMZST0sfk15w43ppTJMFeg/yHFdFeEpcBtlxbZXB73j 5bZeV2/SnqPJUs6a+VadeyaO5pX8ji25Sd/fmLrGDwGXS4+QNRY9sIPgeCeBvuKhkBgU e7DA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719400070; x=1720004870; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=IDtmLd4DIh+2XRkZ57QtXjyzkDOakOx1Ds4rKdXYuOE=; b=SmX7VXkpTzwecPd6yRJeOy2r6GM1bd307tUttXfnKUZfhK8HHfVSWPP+a2NS1dVd9/ cYi6qch9RVwwkVLLfNDx3x7KUJH/g96+BDH2xJVh7/vBiN59uHsB3hhBGT++2g8sUVBY eSiZNkpXihgWlbzxfl8H78tuTk0UMoz9F3cwucVdvxplK+StVDqw5k7spriWm8pZ+ckJ dW4CVx8r6KK58uZmDFBNAmCcEkKj10K08udacSAtAjVtOMESxG7sudUHHAMF0oE/Uc4w dtLJb1OzAD6jbLSUfQABoslHTsjUby2Ij2f3Rpw53UiXEVzo/uD0VyCgl/9dRa62NSQ0 j+Dw== X-Gm-Message-State: AOJu0Yyvz87bXMzGx7rmVha04OiO4RMfBbn20nupYLWQszU0SQMKgG7n 4hHMSrlYMML+HPjRDb4M5+vUtw9eyudPg+GvMJWqKxCOpxOpM6TTRa5E/OYUJz8= X-Google-Smtp-Source: AGHT+IEtTUgO/yYQ0iY6MlOqVPv57FtOgSJbQp3S4MxOFQ5jPw6w5cGtdccBLo9897IO/nsxIpFxsw== X-Received: by 2002:a05:6a00:22cc:b0:705:ddbf:5c05 with SMTP id d2e1a72fcca58-7066e52a7cbmr12746690b3a.11.1719400070579; Wed, 26 Jun 2024 04:07:50 -0700 (PDT) From: Akihiko Odaki Date: Wed, 26 Jun 2024 20:06:35 +0900 Subject: [PATCH 12/14] tests/qtest: Delete previous boot file MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20240626-san-v1-12-f3cc42302189@daynix.com> References: <20240626-san-v1-0-f3cc42302189@daynix.com> In-Reply-To: <20240626-san-v1-0-f3cc42302189@daynix.com> To: Eduardo Habkost , Marcel Apfelbaum , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Yanan Wang , John Snow , BALATON Zoltan , Jiaxun Yang , Nicholas Piggin , Daniel Henrique Barboza , David Gibson , Harsh Prateek Bora , Alexey Kardashevskiy , "Michael S. Tsirkin" , =?utf-8?q?Alex_Benn=C3=A9e?= , Peter Xu , Fabiano Rosas , Paolo Bonzini , David Hildenbrand , Thomas Huth , Laurent Vivier Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org, qemu-ppc@nongnu.org, Akihiko Odaki X-Mailer: b4 0.14-dev-fd6e3 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::432; envelope-from=akihiko.odaki@daynix.com; helo=mail-pf1-x432.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @daynix-com.20230601.gappssmtp.com) X-ZM-MESSAGEID: 1719400170144100007 A test run may create boot files several times. Delete the previous boot file before creating a new one. Signed-off-by: Akihiko Odaki --- tests/qtest/migration-test.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c index b7e3406471a6..5c0d669b6df3 100644 --- a/tests/qtest/migration-test.c +++ b/tests/qtest/migration-test.c @@ -129,12 +129,23 @@ static char *bootpath; #include "tests/migration/aarch64/a-b-kernel.h" #include "tests/migration/s390x/a-b-bios.h" =20 +static void bootfile_delete(void) +{ + unlink(bootpath); + g_free(bootpath); + bootpath =3D NULL; +} + static void bootfile_create(char *dir, bool suspend_me) { const char *arch =3D qtest_get_arch(); unsigned char *content; size_t len; =20 + if (bootpath) { + bootfile_delete(); + } + bootpath =3D g_strdup_printf("%s/bootsect", dir); if (strcmp(arch, "i386") =3D=3D 0 || strcmp(arch, "x86_64") =3D=3D 0) { /* the assembled x86 boot sector should be exactly one sector larg= e */ @@ -164,13 +175,6 @@ static void bootfile_create(char *dir, bool suspend_me) fclose(bootfile); } =20 -static void bootfile_delete(void) -{ - unlink(bootpath); - g_free(bootpath); - bootpath =3D NULL; -} - /* * Wait for some output in the serial output file, * we get an 'A' followed by an endless string of 'B's --=20 2.45.2