All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tests/qtest/migration: Restore include for postcopy
@ 2024-12-17 21:22 Fabiano Rosas
  2024-12-17 21:47 ` Peter Xu
  0 siblings, 1 reply; 7+ messages in thread
From: Fabiano Rosas @ 2024-12-17 21:22 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Xu

Commit 124a3c58b8 ("tests/qtest/migration: Move ufd_version_check to
utils") moved the ufd_version_check() function to another file but
failed to bring along the <sys/syscall> include, which is necessary to
pull in <asm/unistd.h> for __NR_userfaultd.

Restore the missing include.

While here, remove the ifdef __linux__ that's redundant and fix a
couple of typos.

Fixes: 124a3c58b8 ("tests/qtest/migration: Move ufd_version_check to utils")
Signed-off-by: Fabiano Rosas <farosas@suse.de>
---
 tests/qtest/migration/migration-util.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/tests/qtest/migration/migration-util.c b/tests/qtest/migration/migration-util.c
index 525bf1eed4..d18841e357 100644
--- a/tests/qtest/migration/migration-util.c
+++ b/tests/qtest/migration/migration-util.c
@@ -22,8 +22,12 @@
 #include "migration/bootfile.h"
 #include "migration/migration-util.h"
 
-/* for uffd_version_check() */
-#if defined(__linux__) && defined(__NR_userfaultfd) && defined(CONFIG_EVENTFD)
+#if defined(__linux__)
+#include <sys/syscall.h>
+#endif
+
+/* for ufd_version_check() */
+#if defined(__NR_userfaultfd) && defined(CONFIG_EVENTFD)
 #include <sys/eventfd.h>
 #include "qemu/userfaultfd.h"
 #endif
@@ -297,7 +301,7 @@ bool probe_o_direct_support(const char *tmpfs)
 }
 #endif
 
-#if defined(__linux__) && defined(__NR_userfaultfd) && defined(CONFIG_EVENTFD)
+#if defined(__NR_userfaultfd) && defined(CONFIG_EVENTFD)
 bool ufd_version_check(bool *uffd_feature_thread_id)
 {
     struct uffdio_api api_struct;
@@ -333,7 +337,7 @@ bool ufd_version_check(bool *uffd_feature_thread_id)
 #else
 bool ufd_version_check(bool *uffd_feature_thread_id)
 {
-    g_test_message("Skipping test: Userfault not available (builtdtime)");
+    g_test_message("Skipping test: Userfault not available (buildtime)");
     return false;
 }
 #endif
-- 
2.35.3



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

end of thread, other threads:[~2024-12-18 19:21 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-17 21:22 [PATCH] tests/qtest/migration: Restore include for postcopy Fabiano Rosas
2024-12-17 21:47 ` Peter Xu
2024-12-18  8:22   ` Daniel P. Berrangé
2024-12-18 15:12     ` Fabiano Rosas
2024-12-18 16:16       ` Peter Xu
2024-12-18 16:22       ` Daniel P. Berrangé
2024-12-18 19:20         ` Fabiano Rosas

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.