From nobody Sun Nov 24 13:29:16 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=1724393669; cv=none; d=zohomail.com; s=zohoarc; b=aBUh8+hBbd5Hrw2NZGGghjVcLgqTfF4gxj9FdAx7ehMW5hUOJypAgwiwQQSVGOTycs5rC64i4sgqm9I3vJhs8kW6NY2jZYmp0mjz0y9+wX7Ozm6QqvNiXuJzOf04fV5U+rOqoFt5lNpoZa4hkS9edaO4n8Jqk0nbHjbdJdccOV8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1724393669; 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=TCWqBNLN76lvDt02Z9O72XGpvlEOCWgTyfhqZXKjDaw=; b=MQ7wJNxHDyRyGEqoeBNSEEOsLG/03Wa2HAmEDQQ/wEawNUtkckVm9CtREDi+vKkZ8/mzO+BYpCNS0ORUfvTzc3492fi4KN3QiVjisDWOCKbpdV3WO9dc/NxfchsjGxpO2ZNIAlMHR41giM4R8jSZlD3ydH+Dk01jH6Q0ExSMJ+A= 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 1724393669668642.170452714711; Thu, 22 Aug 2024 23:14:29 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1shNYq-0003dR-V7; Fri, 23 Aug 2024 02:14:12 -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 1shNYo-0003Yt-QU for qemu-devel@nongnu.org; Fri, 23 Aug 2024 02:14:10 -0400 Received: from mail-pf1-x42b.google.com ([2607:f8b0:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1shNYn-0003DT-60 for qemu-devel@nongnu.org; Fri, 23 Aug 2024 02:14:10 -0400 Received: by mail-pf1-x42b.google.com with SMTP id d2e1a72fcca58-7141b04e7a3so1343288b3a.3 for ; Thu, 22 Aug 2024 23:14:08 -0700 (PDT) Received: from localhost ([157.82.207.23]) by smtp.gmail.com with UTF8SMTPSA id d2e1a72fcca58-7143431052bsm2316219b3a.181.2024.08.22.23.14.02 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 22 Aug 2024 23:14:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20230601.gappssmtp.com; s=20230601; t=1724393647; x=1724998447; 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=TCWqBNLN76lvDt02Z9O72XGpvlEOCWgTyfhqZXKjDaw=; b=tkEQIl/8nJAQAZb9O3Q84H+Ds+tyJ4rlz4/GAyLSCeA8o8SpeL66vShDQzudPIPXSi zBFHxXHzSjuhhwTzQBQqSJ4Q6JZ8xQKpGWGEZYz5hixUWETWfgPm9BFUejQ0M6LsRtuH tH35Dmm58QdQayVCTV3WDZfMR7DDcRbSG4Ws3mhqE6ZnOQ+sFFLs1r2VWIPNGOrFBkcQ 4jkTmicKJPD0xjVcN9aVfP5A4oghLqm7tXoFxuIrv1WcZXT/S8I5m3BmErNIL9lDULwv xe0RkHVVatItEO7PtuKqfKjyYU/Uv6s1z7wnQN5JgS999bSBvwOcxQ6OeZR5QYbO31LJ fnsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724393647; x=1724998447; 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=TCWqBNLN76lvDt02Z9O72XGpvlEOCWgTyfhqZXKjDaw=; b=i4ZL2FxpUrzDlKKHVEVmOk+5GbFS8ftnPPr20hHUtBrxlstmJvU5RxktY6b1Vcx0fV DhyQn+/sydjKHdw6zu+GnNNmUtXYLHJxb5kXjbpWmBHjgw6fHVsAD629H0Iyl2agllRX FwViusBEaWnvifhniUPZYCmteyT7R8MDh/InjBMprfDtNDW3j3i8I3h0YoDVshfh+pui OEmv9ZS6tJ/ZW06lub5dxJIeL2b2O7aK/Z6BKoara0FZWza6rcuZzT9Kixo+rtwmpw8E uusyRUY4M8ZIXkbN/GVdA8Qb1dxCVIBzwurL3PxscnaTJq/lHRLcdwQv3nnFMAptVkVG WIWw== X-Gm-Message-State: AOJu0YwVtGuOBCWLz3nZ4bFmzpMndRtqlmamrlvOrxcem9FIJ+4zJH5c KKQyZbVpeyRubeUxi0N0mQLQmax0jC31pyZSyKMHQana+js/MZUhgYRQs8ArAJM= X-Google-Smtp-Source: AGHT+IHQAQTjyHnSxviZgtgI0vIuOZfZH2ixcOe5Tj2LMg+WQaj65xPn4VkB/GO1BZ89fiRkpEeF7A== X-Received: by 2002:a05:6a00:1a8e:b0:710:4d08:e094 with SMTP id d2e1a72fcca58-7144573cd07mr1253784b3a.2.1724393647393; Thu, 22 Aug 2024 23:14:07 -0700 (PDT) From: Akihiko Odaki Date: Fri, 23 Aug 2024 15:13:12 +0900 Subject: [PATCH v4 7/7] tests/qtest: Delete previous boot file MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20240823-san-v4-7-a24c6dfa4ceb@daynix.com> References: <20240823-san-v4-0-a24c6dfa4ceb@daynix.com> In-Reply-To: <20240823-san-v4-0-a24c6dfa4ceb@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 , Peter Maydell 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::42b; envelope-from=akihiko.odaki@daynix.com; helo=mail-pf1-x42b.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, T_SCC_BODY_TEXT_LINE=-0.01 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: 1724393670942116600 A test run may create boot files several times. Delete the previous boot file before creating a new one. Signed-off-by: Akihiko Odaki Reviewed-by: Michael S. Tsirkin Acked-by: Thomas Huth --- 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 70b606b88864..6c06100d91e2 100644 --- a/tests/qtest/migration-test.c +++ b/tests/qtest/migration-test.c @@ -144,12 +144,23 @@ static char *bootpath; #include "tests/migration/ppc64/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 */ @@ -177,13 +188,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.46.0