ui/console: Restrict udmabuf_fd() to Linux
authorPhilippe Mathieu-Daudé <philmd@redhat.com>
Mon, 23 Aug 2021 10:04:54 +0000 (12:04 +0200)
committerGerd Hoffmann <kraxel@redhat.com>
Tue, 31 Aug 2021 12:31:43 +0000 (14:31 +0200)
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20210823100454.615816-3-philmd@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
include/ui/console.h
ui/meson.build
ui/udmabuf.c

index b30b63976a5ab06045b33bc563ea6f70b3f9cdec..3be21497a2e885dca1843c97b30c4464021a5910 100644 (file)
@@ -471,7 +471,9 @@ bool vnc_display_reload_certs(const char *id,  Error **errp);
 /* input.c */
 int index_from_key(const char *key, size_t key_length);
 
+#ifdef CONFIG_LINUX
 /* udmabuf.c */
 int udmabuf_fd(void);
+#endif
 
 #endif
index a3a187d633abfdf3dc3212c72e6c0a263cc5a839..7d25c1b95b5f67eab08038df7a840da7ef888890 100644 (file)
@@ -12,12 +12,14 @@ softmmu_ss.add(files(
   'kbd-state.c',
   'keymaps.c',
   'qemu-pixman.c',
-  'udmabuf.c',
 ))
 softmmu_ss.add([spice_headers, files('spice-module.c')])
 softmmu_ss.add(when: spice_protocol, if_true: files('vdagent.c'))
 
-softmmu_ss.add(when: 'CONFIG_LINUX', if_true: files('input-linux.c'))
+softmmu_ss.add(when: 'CONFIG_LINUX', if_true: files(
+  'input-linux.c',
+  'udmabuf.c',
+))
 softmmu_ss.add(when: cocoa, if_true: files('cocoa.m'))
 
 vnc_ss = ss.source_set()
index 23abe1e7eb91b864728ac9fb3f0f9f1cb2ebda84..cebceb261001be02da9e4c330e98bb36b0e95650 100644 (file)
@@ -8,8 +8,6 @@
 #include "qapi/error.h"
 #include "ui/console.h"
 
-#ifdef CONFIG_LINUX
-
 #include <fcntl.h>
 #include <sys/ioctl.h>
 
@@ -29,12 +27,3 @@ int udmabuf_fd(void)
     }
     return udmabuf;
 }
-
-#else
-
-int udmabuf_fd(void)
-{
-    return -1;
-}
-
-#endif