All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] migration: Fix postcopy tests
@ 2024-12-18 19:22 Fabiano Rosas
  2024-12-18 19:22 ` [PATCH v2 1/2] tests/qtest/migration: Re-enable " Fabiano Rosas
  2024-12-18 19:22 ` [PATCH v2 2/2] tests/qtest/migration: Stop checking __NR_userfaultfd Fabiano Rosas
  0 siblings, 2 replies; 5+ messages in thread
From: Fabiano Rosas @ 2024-12-18 19:22 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Xu, Daniel P . Berrangé

I messed up the includes when splitting the tests and the postcopy
tests got disabled.

- patch 1: fix the problem, re-enabling the tests
- patch 2: imply __NR_userfaultfd from __linux__ [Peter]

Fabiano Rosas (2):
  tests/qtest/migration: Re-enable postcopy tests
  tests/qtest/migration: Stop checking __NR_userfaultfd

 tests/qtest/migration/migration-util.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

-- 
2.35.3



^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v2 1/2] tests/qtest/migration: Re-enable postcopy tests
  2024-12-18 19:22 [PATCH v2 0/2] migration: Fix postcopy tests Fabiano Rosas
@ 2024-12-18 19:22 ` Fabiano Rosas
  2024-12-18 19:22 ` [PATCH v2 2/2] tests/qtest/migration: Stop checking __NR_userfaultfd Fabiano Rosas
  1 sibling, 0 replies; 5+ messages in thread
From: Fabiano Rosas @ 2024-12-18 19:22 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Xu, Daniel P . Berrangé

Postcopy tests have been inadvertently disabled since commit
124a3c58b8 ("tests/qtest/migration: Move ufd_version_check to
utils"). That commit moved the ufd_version_check() function to another
file but failed to make sense of the ifdefs and includes:

The <sys/syscall> include was incorrectly dropped. It is needed to
pull in <asm/unistd.h> for __NR_userfaultfd.

The <sys/ioctl.h> was moved under the wrong ifdef.

Fixes: 124a3c58b8 ("tests/qtest/migration: Move ufd_version_check to utils")
Reviewed-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Fabiano Rosas <farosas@suse.de>
---
 tests/qtest/migration/migration-util.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/tests/qtest/migration/migration-util.c b/tests/qtest/migration/migration-util.c
index 525bf1eed4..eb3640e27e 100644
--- a/tests/qtest/migration/migration-util.c
+++ b/tests/qtest/migration/migration-util.c
@@ -22,6 +22,11 @@
 #include "migration/bootfile.h"
 #include "migration/migration-util.h"
 
+#if defined(__linux__)
+#include <sys/ioctl.h>
+#include <sys/syscall.h>
+#endif
+
 /* for uffd_version_check() */
 #if defined(__linux__) && defined(__NR_userfaultfd) && defined(CONFIG_EVENTFD)
 #include <sys/eventfd.h>
@@ -31,7 +36,6 @@
 /* For dirty ring test; so far only x86_64 is supported */
 #if defined(__linux__) && defined(HOST_X86_64)
 #include "linux/kvm.h"
-#include <sys/ioctl.h>
 #endif
 
 
-- 
2.35.3



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH v2 2/2] tests/qtest/migration: Stop checking __NR_userfaultfd
  2024-12-18 19:22 [PATCH v2 0/2] migration: Fix postcopy tests Fabiano Rosas
  2024-12-18 19:22 ` [PATCH v2 1/2] tests/qtest/migration: Re-enable " Fabiano Rosas
@ 2024-12-18 19:22 ` Fabiano Rosas
  2024-12-18 20:42   ` Peter Xu
  2024-12-20  9:11   ` Daniel P. Berrangé
  1 sibling, 2 replies; 5+ messages in thread
From: Fabiano Rosas @ 2024-12-18 19:22 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Xu, Daniel P . Berrangé

We don't need to check for __NR_userfaultfd in the tests anymore, the
syscall has been present in Linux for a long time now.

Suggested-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Fabiano Rosas <farosas@suse.de>
---
 tests/qtest/migration/migration-util.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tests/qtest/migration/migration-util.c b/tests/qtest/migration/migration-util.c
index eb3640e27e..23e0163945 100644
--- a/tests/qtest/migration/migration-util.c
+++ b/tests/qtest/migration/migration-util.c
@@ -27,8 +27,8 @@
 #include <sys/syscall.h>
 #endif
 
-/* for uffd_version_check() */
-#if defined(__linux__) && defined(__NR_userfaultfd) && defined(CONFIG_EVENTFD)
+/* for ufd_version_check() */
+#if defined(__linux__) && defined(CONFIG_EVENTFD)
 #include <sys/eventfd.h>
 #include "qemu/userfaultfd.h"
 #endif
@@ -301,7 +301,7 @@ bool probe_o_direct_support(const char *tmpfs)
 }
 #endif
 
-#if defined(__linux__) && defined(__NR_userfaultfd) && defined(CONFIG_EVENTFD)
+#if defined(__linux__) && defined(CONFIG_EVENTFD)
 bool ufd_version_check(bool *uffd_feature_thread_id)
 {
     struct uffdio_api api_struct;
-- 
2.35.3



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v2 2/2] tests/qtest/migration: Stop checking __NR_userfaultfd
  2024-12-18 19:22 ` [PATCH v2 2/2] tests/qtest/migration: Stop checking __NR_userfaultfd Fabiano Rosas
@ 2024-12-18 20:42   ` Peter Xu
  2024-12-20  9:11   ` Daniel P. Berrangé
  1 sibling, 0 replies; 5+ messages in thread
From: Peter Xu @ 2024-12-18 20:42 UTC (permalink / raw)
  To: Fabiano Rosas; +Cc: qemu-devel, Daniel P . Berrangé

On Wed, Dec 18, 2024 at 04:22:23PM -0300, Fabiano Rosas wrote:
> We don't need to check for __NR_userfaultfd in the tests anymore, the
> syscall has been present in Linux for a long time now.
> 
> Suggested-by: Peter Xu <peterx@redhat.com>
> Signed-off-by: Fabiano Rosas <farosas@suse.de>

Reviewed-by: Peter Xu <peterx@redhat.com>

-- 
Peter Xu



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2 2/2] tests/qtest/migration: Stop checking __NR_userfaultfd
  2024-12-18 19:22 ` [PATCH v2 2/2] tests/qtest/migration: Stop checking __NR_userfaultfd Fabiano Rosas
  2024-12-18 20:42   ` Peter Xu
@ 2024-12-20  9:11   ` Daniel P. Berrangé
  1 sibling, 0 replies; 5+ messages in thread
From: Daniel P. Berrangé @ 2024-12-20  9:11 UTC (permalink / raw)
  To: Fabiano Rosas; +Cc: qemu-devel, Peter Xu

On Wed, Dec 18, 2024 at 04:22:23PM -0300, Fabiano Rosas wrote:
> We don't need to check for __NR_userfaultfd in the tests anymore, the
> syscall has been present in Linux for a long time now.

The same is true of the migration/postcopy-ram.c  code too which I
think should be changed at the same time as its tests.

There are a few other places in QEMU also checking __NR_userfaultfd
but not directly under migration subsystem, so change those ones at
your discretion.

> 
> Suggested-by: Peter Xu <peterx@redhat.com>
> Signed-off-by: Fabiano Rosas <farosas@suse.de>
> ---
>  tests/qtest/migration/migration-util.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/tests/qtest/migration/migration-util.c b/tests/qtest/migration/migration-util.c
> index eb3640e27e..23e0163945 100644
> --- a/tests/qtest/migration/migration-util.c
> +++ b/tests/qtest/migration/migration-util.c
> @@ -27,8 +27,8 @@
>  #include <sys/syscall.h>
>  #endif
>  
> -/* for uffd_version_check() */
> -#if defined(__linux__) && defined(__NR_userfaultfd) && defined(CONFIG_EVENTFD)
> +/* for ufd_version_check() */
> +#if defined(__linux__) && defined(CONFIG_EVENTFD)
>  #include <sys/eventfd.h>
>  #include "qemu/userfaultfd.h"
>  #endif
> @@ -301,7 +301,7 @@ bool probe_o_direct_support(const char *tmpfs)
>  }
>  #endif
>  
> -#if defined(__linux__) && defined(__NR_userfaultfd) && defined(CONFIG_EVENTFD)
> +#if defined(__linux__) && defined(CONFIG_EVENTFD)
>  bool ufd_version_check(bool *uffd_feature_thread_id)
>  {
>      struct uffdio_api api_struct;
> -- 
> 2.35.3
> 

With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-12-20  9:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-18 19:22 [PATCH v2 0/2] migration: Fix postcopy tests Fabiano Rosas
2024-12-18 19:22 ` [PATCH v2 1/2] tests/qtest/migration: Re-enable " Fabiano Rosas
2024-12-18 19:22 ` [PATCH v2 2/2] tests/qtest/migration: Stop checking __NR_userfaultfd Fabiano Rosas
2024-12-18 20:42   ` Peter Xu
2024-12-20  9:11   ` Daniel P. Berrangé

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.