From nobody Mon Nov 25 07:23:22 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; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1717062950; cv=none; d=zohomail.com; s=zohoarc; b=DcOtm7zy8kZu97H2v3sX2Hfbb8YbX6+Zai3OQVUQzlwRbNWMW0zM/i5yVs9OygMfCt8YB8l+ohEHRLV6ftQVMDbz+lMEcmJx4MqABKdVQZ0YngysDBRZasEbbJipR0XkpvcShqfxxfu2LjWMtiuJ15v8gWXVc5UcxvTyRmoQ05M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1717062950; h=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=7OY+Yb66xH2ve4EOh/kSWfFWLssdw6ThCr38/yoK6pI=; b=GI4fVvGx59oMWC9xznZ5AAafeolw/EASRyHLHD1Skj6vIvs6HNwJERZZiSAKLm4xFyP0zFvnuSdDn9F1/ZQmrARx9m9GfT0A6OjABw+LFYOguK0kBILmb+XvtY0rXERX+KiIvtl3nOMlJOUilTSneTzeE/xN97SH9X1ZT+PNYVk= 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; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1717062950169156.40779775778026; Thu, 30 May 2024 02:55:50 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sCcUN-00070l-Tn; Thu, 30 May 2024 05:54:27 -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 1sCcUL-000704-Rl for qemu-devel@nongnu.org; Thu, 30 May 2024 05:54:25 -0400 Received: from mail-pg1-x52c.google.com ([2607:f8b0:4864:20::52c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sCcUJ-00026Q-IV for qemu-devel@nongnu.org; Thu, 30 May 2024 05:54:25 -0400 Received: by mail-pg1-x52c.google.com with SMTP id 41be03b00d2f7-6c104f64ff6so218161a12.1 for ; Thu, 30 May 2024 02:54:23 -0700 (PDT) Received: from wheely.local0.net ([1.146.0.82]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2c1a775d28asm1183626a91.8.2024.05.30.02.54.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 May 2024 02:54:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717062862; x=1717667662; darn=nongnu.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=7OY+Yb66xH2ve4EOh/kSWfFWLssdw6ThCr38/yoK6pI=; b=TuIgLXAg2iAcwZrMI/B7S0WRFDOwAyghYDMyJd0dlzkF8l8RtM+C752X4Aw3J8So5y SCf0vJtLqFb9DFWvdInWnH0+D/eqaB6abKTU/AluqSTuljF2xEwO4jKOf4i4UfIVUtt+ AIvh4Tv9lsKsV4fJk5PTpVmbt0T47IYjKzg/KPTRD4J3xd1iW4Ap+lcn0mRp+RyZj+tn s0ba6ZZjVV4QHCuDL1Ur2uV5zuLyUZho0F3ZgUruEobDQ/l4At+7RE040xxci95k9xYn M+9N8jtXmQFaUJQ828drRlT3LGOtPLQxhS4ZSFkKJ/4bzBruRXF9Z//SGqZI61Gvu3PD Pqbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717062862; x=1717667662; 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=7OY+Yb66xH2ve4EOh/kSWfFWLssdw6ThCr38/yoK6pI=; b=wlA2n3b9zGdYCuHjdC7K14n4WfSfDXf0a+2A8zAE5fJlmNY2gAetY6w5+ZUX8eNC5v HxsRrSbHsGnt3WpXWNva6rZ/6dwtiIwcS1uGsHX99bLjD113UBXz+1lCprhm8HPYbV4+ T7/+haOYd+f/EeHu1uXzrZdIKa8LbzUhPdZWVHKWRtZ3RxfbmoU6fh2OX/U3lsJf2II3 cBtqb706jm1enmtUD0q8kHqb5JMxLTNXQQEtng317/Dep12tpRXtiUZ0UVwkVFMyDXS3 dK0Loq/9tWcSEfdXjHzIXVdaClxTyNmN736T05j6p5Bp2td5Xk+/jhXlIPhjyi0ts/sR 2fDQ== X-Gm-Message-State: AOJu0Yyv6pLZj3KEbPI/VgXcTjyOuhJP9YMoJMdXI8REXezVY1r6Ku+J JlxmfOTdtWhBHS8AB6kEkMuizacrFBXZHdLWpbX/WwivFtmsK7mHzekcN9Uu X-Google-Smtp-Source: AGHT+IFb8Oi6i9H0gmUifZb4BGlKK57TqfSUWvOHImiNUBpsrMEcHrrNoGVfA2rMPwUztr8Z9rNzoA== X-Received: by 2002:a17:90b:60e:b0:2bd:dce4:8f90 with SMTP id 98e67ed59e1d1-2c1abc064f1mr1627738a91.6.1717062861513; Thu, 30 May 2024 02:54:21 -0700 (PDT) From: Nicholas Piggin To: qemu-devel@nongnu.org Cc: Nicholas Piggin , Peter Xu , Fabiano Rosas , Thomas Huth , Laurent Vivier , Paolo Bonzini Subject: [PATCH v2 1/4] tests/qtest/migration-test: Use regular file file for shared-memory tests Date: Thu, 30 May 2024 19:54:04 +1000 Message-ID: <20240530095408.31608-2-npiggin@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240530095408.31608-1-npiggin@gmail.com> References: <20240530095408.31608-1-npiggin@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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: pass client-ip=2607:f8b0:4864:20::52c; envelope-from=npiggin@gmail.com; helo=mail-pg1-x52c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-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 @gmail.com) X-ZM-MESSAGEID: 1717062950558100001 Content-Type: text/plain; charset="utf-8" There is no need to use /dev/shm for file-backed memory devices, and on Gitlab CI the tmpfs mount is too small to be usable for migration tests. Switch to using a regular file in /tmp/ which will usually have more space available. Signed-off-by: Nicholas Piggin Reviewed-by: Prasad Pandit --- tests/qtest/migration-test.c | 34 +++++++++++++++------------------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c index d6f5ceed80..8bbf45313d 100644 --- a/tests/qtest/migration-test.c +++ b/tests/qtest/migration-test.c @@ -552,7 +552,7 @@ typedef struct { * unconditionally, because it means the user would like to be verbose. */ bool hide_stderr; - bool use_shmem; + bool use_memfile; /* only launch the target process */ bool only_target; /* Use dirty ring if true; dirty logging otherwise */ @@ -672,21 +672,14 @@ static int test_migrate_start(QTestState **from, QTes= tState **to, g_autofree gchar *cmd_source =3D NULL; g_autofree gchar *cmd_target =3D NULL; const gchar *ignore_stderr; - g_autofree char *shmem_opts =3D NULL; - g_autofree char *shmem_path =3D NULL; + g_autofree char *memfile_opts =3D NULL; + g_autofree char *memfile_path =3D NULL; const char *kvm_opts =3D NULL; const char *arch =3D qtest_get_arch(); const char *memory_size; const char *machine_alias, *machine_opts =3D ""; g_autofree char *machine =3D NULL; =20 - if (args->use_shmem) { - if (!g_file_test("/dev/shm", G_FILE_TEST_IS_DIR)) { - g_test_skip("/dev/shm is not supported"); - return -1; - } - } - dst_state =3D (QTestMigrationState) { }; src_state =3D (QTestMigrationState) { }; bootfile_create(tmpfs, args->suspend_me); @@ -746,12 +739,12 @@ static int test_migrate_start(QTestState **from, QTes= tState **to, ignore_stderr =3D ""; } =20 - if (args->use_shmem) { - shmem_path =3D g_strdup_printf("/dev/shm/qemu-%d", getpid()); - shmem_opts =3D g_strdup_printf( + if (args->use_memfile) { + memfile_path =3D g_strdup_printf("/%s/qemu-%d", tmpfs, getpid()); + memfile_opts =3D g_strdup_printf( "-object memory-backend-file,id=3Dmem0,size=3D%s" ",mem-path=3D%s,share=3Don -numa node,memdev=3Dmem0", - memory_size, shmem_path); + memory_size, memfile_path); } =20 if (args->use_dirty_ring) { @@ -780,7 +773,7 @@ static int test_migrate_start(QTestState **from, QTestS= tate **to, memory_size, tmpfs, arch_opts ? arch_opts : "", arch_source ? arch_source : "", - shmem_opts ? shmem_opts : "", + memfile_opts ? memfile_opts : "", args->opts_source ? args->opts_source : "= ", ignore_stderr); if (!args->only_target) { @@ -802,7 +795,7 @@ static int test_migrate_start(QTestState **from, QTestS= tate **to, memory_size, tmpfs, uri, arch_opts ? arch_opts : "", arch_target ? arch_target : "", - shmem_opts ? shmem_opts : "", + memfile_opts ? memfile_opts : "", args->opts_target ? args->opts_target : "= ", ignore_stderr); *to =3D qtest_init_with_env(QEMU_ENV_DST, cmd_target); @@ -814,8 +807,8 @@ static int test_migrate_start(QTestState **from, QTestS= tate **to, * Remove shmem file immediately to avoid memory leak in test failed c= ase. * It's valid because QEMU has already opened this file */ - if (args->use_shmem) { - unlink(shmem_path); + if (args->use_memfile) { + unlink(memfile_path); } =20 return 0; @@ -1868,6 +1861,9 @@ static void test_ignore_shared(void) { g_autofree char *uri =3D g_strdup_printf("unix:%s/migsocket", tmpfs); QTestState *from, *to; + MigrateStart args =3D { + .use_memfile =3D true, + }; =20 if (test_migrate_start(&from, &to, uri, false, true, NULL, NULL)) { return; @@ -2024,7 +2020,7 @@ static void test_mode_reboot(void) g_autofree char *uri =3D g_strdup_printf("file:%s/%s", tmpfs, FILE_TEST_FILENAME); MigrateCommon args =3D { - .start.use_shmem =3D true, + .start.use_memfile =3D true, .connect_uri =3D uri, .listen_uri =3D "defer", .start_hook =3D test_mode_reboot_start --=20 2.43.0