Added
This commit is contained in:
		@@ -1,30 +0,0 @@
 | 
			
		||||
From 8cb699dc59c64dc9f58873b3bbe2d17c3a08d2f9 Mon Sep 17 00:00:00 2001
 | 
			
		||||
From: Matt Turner <mattst88@gmail.com>
 | 
			
		||||
Date: Fri, 18 Mar 2022 17:40:52 -0700
 | 
			
		||||
Subject: [PATCH] Disable anonymous-file test
 | 
			
		||||
 | 
			
		||||
It attempts to open /proc/self/fd/* (an fd created by memfd_create),
 | 
			
		||||
which sandbox disallows.
 | 
			
		||||
---
 | 
			
		||||
 src/tests/meson.build | 5 -----
 | 
			
		||||
 1 file changed, 5 deletions(-)
 | 
			
		||||
 | 
			
		||||
diff --git a/src/tests/meson.build b/src/tests/meson.build
 | 
			
		||||
index a19703288..50027d1f8 100644
 | 
			
		||||
--- a/src/tests/meson.build
 | 
			
		||||
+++ b/src/tests/meson.build
 | 
			
		||||
@@ -180,11 +180,6 @@ test_cases += [
 | 
			
		||||
     'suite': 'compositor',
 | 
			
		||||
     'sources': [ 'stage-view-tests.c', ],
 | 
			
		||||
   },
 | 
			
		||||
-  {
 | 
			
		||||
-    'name': 'anonymous-file',
 | 
			
		||||
-    'suite': 'unit',
 | 
			
		||||
-    'sources': [ 'anonymous-file.c', ],
 | 
			
		||||
-  },
 | 
			
		||||
 ]
 | 
			
		||||
 
 | 
			
		||||
 if have_native_tests
 | 
			
		||||
-- 
 | 
			
		||||
2.34.1
 | 
			
		||||
 | 
			
		||||
@@ -1,79 +0,0 @@
 | 
			
		||||
From db854a8588c1164df2f54c5718930aadf353b948 Mon Sep 17 00:00:00 2001
 | 
			
		||||
From: Simon McVittie <smcv@debian.org>
 | 
			
		||||
Date: Thu, 18 Aug 2022 10:41:01 +0100
 | 
			
		||||
Subject: [PATCH] backend/native: Don't warn on EACCES if headless
 | 
			
		||||
 | 
			
		||||
Since commit 1bf70334 "tests/runner: Make test runner use the headless
 | 
			
		||||
backend", tests are run with the native backend in headless mode, which
 | 
			
		||||
will attempt to open each GPU and show a warning (fatal during tests)
 | 
			
		||||
if it cannot.
 | 
			
		||||
 | 
			
		||||
However, in headless mode we might not be logged in on any seat (for
 | 
			
		||||
example we might be logged in via ssh instead), which means we might
 | 
			
		||||
legitimately not have permission to use any GPUs, even if they exist.
 | 
			
		||||
Downgrade the warning to a debug message in this case.
 | 
			
		||||
 | 
			
		||||
Resolves: https://gitlab.gnome.org/GNOME/mutter/-/issues/2381
 | 
			
		||||
Signed-off-by: Simon McVittie <smcv@debian.org>
 | 
			
		||||
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2584>
 | 
			
		||||
(cherry picked from commit 64a67aa00bfe54fe7219d7f581950897fcbf9a75)
 | 
			
		||||
---
 | 
			
		||||
 src/backends/native/meta-backend-native.c | 35 +++++++++++++++++++----
 | 
			
		||||
 1 file changed, 30 insertions(+), 5 deletions(-)
 | 
			
		||||
 | 
			
		||||
diff --git a/src/backends/native/meta-backend-native.c b/src/backends/native/meta-backend-native.c
 | 
			
		||||
index 224538787..a2babb4b0 100644
 | 
			
		||||
--- a/src/backends/native/meta-backend-native.c
 | 
			
		||||
+++ b/src/backends/native/meta-backend-native.c
 | 
			
		||||
@@ -514,8 +514,20 @@ on_udev_device_added (MetaUdev          *udev,
 | 
			
		||||
   new_gpu_kms = create_gpu_from_udev_device (native, device, &error);
 | 
			
		||||
   if (!new_gpu_kms)
 | 
			
		||||
     {
 | 
			
		||||
-      g_warning ("Failed to hotplug secondary gpu '%s': %s",
 | 
			
		||||
-                 device_path, error->message);
 | 
			
		||||
+      if (meta_backend_is_headless (backend) &&
 | 
			
		||||
+          g_error_matches (error, G_IO_ERROR,
 | 
			
		||||
+                           G_IO_ERROR_PERMISSION_DENIED))
 | 
			
		||||
+        {
 | 
			
		||||
+          meta_topic (META_DEBUG_BACKEND,
 | 
			
		||||
+                      "Ignoring unavailable secondary gpu '%s': %s",
 | 
			
		||||
+                      device_path, error->message);
 | 
			
		||||
+        }
 | 
			
		||||
+      else
 | 
			
		||||
+        {
 | 
			
		||||
+          g_warning ("Failed to hotplug secondary gpu '%s': %s",
 | 
			
		||||
+                     device_path, error->message);
 | 
			
		||||
+        }
 | 
			
		||||
+
 | 
			
		||||
       return;
 | 
			
		||||
     }
 | 
			
		||||
 
 | 
			
		||||
@@ -552,9 +564,22 @@ init_gpus (MetaBackendNative  *native,
 | 
			
		||||
 
 | 
			
		||||
       if (!gpu_kms)
 | 
			
		||||
         {
 | 
			
		||||
-          g_warning ("Failed to open gpu '%s': %s",
 | 
			
		||||
-                     g_udev_device_get_device_file (device),
 | 
			
		||||
-                     local_error->message);
 | 
			
		||||
+          if (meta_backend_is_headless (backend) &&
 | 
			
		||||
+              g_error_matches (local_error, G_IO_ERROR,
 | 
			
		||||
+                               G_IO_ERROR_PERMISSION_DENIED))
 | 
			
		||||
+            {
 | 
			
		||||
+              meta_topic (META_DEBUG_BACKEND,
 | 
			
		||||
+                          "Ignoring unavailable gpu '%s': %s'",
 | 
			
		||||
+                          g_udev_device_get_device_file (device),
 | 
			
		||||
+                          local_error->message);
 | 
			
		||||
+            }
 | 
			
		||||
+          else
 | 
			
		||||
+            {
 | 
			
		||||
+              g_warning ("Failed to open gpu '%s': %s",
 | 
			
		||||
+                         g_udev_device_get_device_file (device),
 | 
			
		||||
+                         local_error->message);
 | 
			
		||||
+            }
 | 
			
		||||
+
 | 
			
		||||
           g_clear_error (&local_error);
 | 
			
		||||
           continue;
 | 
			
		||||
         }
 | 
			
		||||
-- 
 | 
			
		||||
2.35.1
 | 
			
		||||
 | 
			
		||||
@@ -1,27 +0,0 @@
 | 
			
		||||
From 8cb699dc59c64dc9f58873b3bbe2d17c3a08d2f9 Mon Sep 17 00:00:00 2001
 | 
			
		||||
From: Matt Turner <mattst88@gmail.com>
 | 
			
		||||
Date: Fri, 18 Mar 2022 17:40:52 -0700
 | 
			
		||||
Subject: [PATCH] Disable anonymous-file test
 | 
			
		||||
 | 
			
		||||
It attempts to open /proc/self/fd/* (an fd created by memfd_create),
 | 
			
		||||
which sandbox disallows.
 | 
			
		||||
---
 | 
			
		||||
 src/tests/meson.build | 5 -----
 | 
			
		||||
 1 file changed, 5 deletions(-)
 | 
			
		||||
 | 
			
		||||
diff --git a/src/tests/meson.build b/src/tests/meson.build
 | 
			
		||||
index a19703288..50027d1f8 100644
 | 
			
		||||
--- a/src/tests/meson.build
 | 
			
		||||
+++ b/src/tests/meson.build
 | 
			
		||||
@@ -224,11 +224,6 @@ test_cases += [
 | 
			
		||||
     'suite': 'compositor',
 | 
			
		||||
     'sources': [ 'stage-view-tests.c', ],
 | 
			
		||||
   },
 | 
			
		||||
-  {
 | 
			
		||||
-    'name': 'anonymous-file',
 | 
			
		||||
-    'suite': 'unit',
 | 
			
		||||
-    'sources': [ 'anonymous-file.c', ],
 | 
			
		||||
-  },
 | 
			
		||||
   {
 | 
			
		||||
     'name': 'edid',
 | 
			
		||||
     'suite': 'unit',
 | 
			
		||||
		Reference in New Issue
	
	Block a user