[PATCH RFC] tests/migration-test: Add mapped-ram + ignore-shared test

Peter Xu posted 1 patch 2 months, 1 week ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20251125194003.833842-1-peterx@redhat.com
Maintainers: Peter Xu <peterx@redhat.com>, Fabiano Rosas <farosas@suse.de>, Laurent Vivier <lvivier@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>
tests/qtest/migration/file-tests.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
[PATCH RFC] tests/migration-test: Add mapped-ram + ignore-shared test
Posted by Peter Xu 2 months, 1 week ago
It was broken, add a test for it.

NOTE: here we do not really need any shared memory blocks, enabling of both
of the features alone would cover the ramblock layout difference that the
bug triggers.

Cc: Pawel Zmarzly <pzmarzly0@gmail.com>
Cc: Fabiano Rosas <farosas@suse.de>
Cc: michel@michel-slm.name
Signed-off-by: Peter Xu <peterx@redhat.com>
---

RFC because currently master branch is broken with it, so need to merge
only after a proper fix lands.

Pawel, feel free to take this with your fix when repost, or I'll manage.
---
 tests/qtest/migration/file-tests.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/tests/qtest/migration/file-tests.c b/tests/qtest/migration/file-tests.c
index 4d78ce0855..ab1b477bdf 100644
--- a/tests/qtest/migration/file-tests.c
+++ b/tests/qtest/migration/file-tests.c
@@ -137,6 +137,22 @@ static void test_precopy_file_mapped_ram(void)
     test_file_common(&args, true);
 }
 
+static void test_precopy_file_mapped_ram_ignore_share(void)
+{
+    g_autofree char *uri = g_strdup_printf("file:%s/%s", tmpfs,
+                                           FILE_TEST_FILENAME);
+    MigrateCommon args = {
+        .connect_uri = uri,
+        .listen_uri = "defer",
+        .start = {
+            .caps[MIGRATION_CAPABILITY_MAPPED_RAM] = true,
+            .caps[MIGRATION_CAPABILITY_X_IGNORE_SHARED] = true,
+        },
+    };
+
+    test_file_common(&args, true);
+}
+
 static void test_multifd_file_mapped_ram_live(void)
 {
     g_autofree char *uri = g_strdup_printf("file:%s/%s", tmpfs,
@@ -324,6 +340,8 @@ void migration_test_add_file(MigrationTestEnv *env)
 
     migration_test_add("/migration/precopy/file/mapped-ram",
                        test_precopy_file_mapped_ram);
+    migration_test_add("/migration/precopy/file/mapped-ram/ignore-share",
+                       test_precopy_file_mapped_ram_ignore_share);
     migration_test_add("/migration/precopy/file/mapped-ram/live",
                        test_precopy_file_mapped_ram_live);
 
-- 
2.50.1
Re: [PATCH RFC] tests/migration-test: Add mapped-ram + ignore-shared test
Posted by Fabiano Rosas 2 months, 1 week ago
Peter Xu <peterx@redhat.com> writes:

> It was broken, add a test for it.
>
> NOTE: here we do not really need any shared memory blocks, enabling of both
> of the features alone would cover the ramblock layout difference that the
> bug triggers.
>
> Cc: Pawel Zmarzly <pzmarzly0@gmail.com>
> Cc: Fabiano Rosas <farosas@suse.de>
> Cc: michel@michel-slm.name
> Signed-off-by: Peter Xu <peterx@redhat.com>
> ---
>
> RFC because currently master branch is broken with it, so need to merge
> only after a proper fix lands.
>
> Pawel, feel free to take this with your fix when repost, or I'll manage.
> ---
>  tests/qtest/migration/file-tests.c | 18 ++++++++++++++++++
>  1 file changed, 18 insertions(+)
>
> diff --git a/tests/qtest/migration/file-tests.c b/tests/qtest/migration/file-tests.c
> index 4d78ce0855..ab1b477bdf 100644
> --- a/tests/qtest/migration/file-tests.c
> +++ b/tests/qtest/migration/file-tests.c
> @@ -137,6 +137,22 @@ static void test_precopy_file_mapped_ram(void)
>      test_file_common(&args, true);
>  }
>  
> +static void test_precopy_file_mapped_ram_ignore_share(void)

s/share/shared/

Acked-by: Fabiano Rosas <farosas@suse.de>
Re: [PATCH RFC] tests/migration-test: Add mapped-ram + ignore-shared test
Posted by Paweł Zmarzły 2 months, 1 week ago
> Peter Xu <peterx@redhat.com> writes:
>
> > Pawel, feel free to take this with your fix when repost, or I'll manage.

Copied into V2 of my patch.