qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/2] Restrict virtio-gpu-udmabuf stubs to !Linux
@ 2021-08-23 10:04 Philippe Mathieu-Daudé
  2021-08-23 10:04 ` [PATCH v2 1/2] hw/display: " Philippe Mathieu-Daudé
  2021-08-23 10:04 ` [PATCH v2 2/2] ui/console: Restrict udmabuf_fd() to Linux Philippe Mathieu-Daudé
  0 siblings, 2 replies; 3+ messages in thread
From: Philippe Mathieu-Daudé @ 2021-08-23 10:04 UTC (permalink / raw)
  To: qemu-devel
  Cc: Maxim R ., Paolo Bonzini, Philippe Mathieu-Daudé, Gerd Hoffmann

Annoying problem when stubs take over module symbols.

See https://gitlab.com/qemu-project/qemu/-/issues/553

Philippe Mathieu-Daudé (2):
  hw/display: Restrict virtio-gpu-udmabuf stubs to !Linux
  ui/console: Restrict udmabuf_fd() to Linux

 include/ui/console.h                                  |  2 ++
 .../display/virtio-gpu-udmabuf-stubs.c                |  0
 ui/udmabuf.c                                          | 11 -----------
 hw/display/meson.build                                |  3 ++-
 stubs/meson.build                                     |  1 -
 ui/meson.build                                        |  6 ++++--
 6 files changed, 8 insertions(+), 15 deletions(-)
 rename stubs/virtio-gpu-udmabuf.c => hw/display/virtio-gpu-udmabuf-stubs.c (100%)

-- 
2.31.1




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

* [PATCH v2 1/2] hw/display: Restrict virtio-gpu-udmabuf stubs to !Linux
  2021-08-23 10:04 [PATCH v2 0/2] Restrict virtio-gpu-udmabuf stubs to !Linux Philippe Mathieu-Daudé
@ 2021-08-23 10:04 ` Philippe Mathieu-Daudé
  2021-08-23 10:04 ` [PATCH v2 2/2] ui/console: Restrict udmabuf_fd() to Linux Philippe Mathieu-Daudé
  1 sibling, 0 replies; 3+ messages in thread
From: Philippe Mathieu-Daudé @ 2021-08-23 10:04 UTC (permalink / raw)
  To: qemu-devel
  Cc: Maxim R ., Paolo Bonzini, Philippe Mathieu-Daudé, Gerd Hoffmann

When using qemu configured with --enabled-modules, the
generic stubs are used instead of the module symbols:

  qemu-system-x86_64: -device virtio-vga,blob=on: cannot enable blob resources without udmabuf

Restrict the stubs to Linux and only link them when
CONFIG_VIRTIO_GPU is disabled (only the modularized
version is available when it is enabled).

Reported-by: Maxim R. <mrom06@ya.ru>
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/553
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 .../display/virtio-gpu-udmabuf-stubs.c                         | 0
 hw/display/meson.build                                         | 3 ++-
 stubs/meson.build                                              | 1 -
 3 files changed, 2 insertions(+), 2 deletions(-)
 rename stubs/virtio-gpu-udmabuf.c => hw/display/virtio-gpu-udmabuf-stubs.c (100%)

diff --git a/stubs/virtio-gpu-udmabuf.c b/hw/display/virtio-gpu-udmabuf-stubs.c
similarity index 100%
rename from stubs/virtio-gpu-udmabuf.c
rename to hw/display/virtio-gpu-udmabuf-stubs.c
diff --git a/hw/display/meson.build b/hw/display/meson.build
index 1e6b707d3c0..861c43ff984 100644
--- a/hw/display/meson.build
+++ b/hw/display/meson.build
@@ -56,7 +56,8 @@
   virtio_gpu_ss = ss.source_set()
   virtio_gpu_ss.add(when: 'CONFIG_VIRTIO_GPU',
                     if_true: [files('virtio-gpu-base.c', 'virtio-gpu.c'), pixman])
-  virtio_gpu_ss.add(when: 'CONFIG_LINUX', if_true: files('virtio-gpu-udmabuf.c'))
+  virtio_gpu_ss.add(when: 'CONFIG_LINUX', if_true: files('virtio-gpu-udmabuf.c'),
+                                          if_false: files('virtio-gpu-udmabuf-stubs.c'))
   virtio_gpu_ss.add(when: 'CONFIG_VHOST_USER_GPU', if_true: files('vhost-user-gpu.c'))
   hw_display_modules += {'virtio-gpu': virtio_gpu_ss}
 
diff --git a/stubs/meson.build b/stubs/meson.build
index d3fa8646b38..3d7cfac608e 100644
--- a/stubs/meson.build
+++ b/stubs/meson.build
@@ -53,7 +53,6 @@
   stub_ss.add(files('semihost.c'))
   stub_ss.add(files('usb-dev-stub.c'))
   stub_ss.add(files('xen-hw-stub.c'))
-  stub_ss.add(files('virtio-gpu-udmabuf.c'))
 else
   stub_ss.add(files('qdev.c'))
 endif
-- 
2.31.1



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

* [PATCH v2 2/2] ui/console: Restrict udmabuf_fd() to Linux
  2021-08-23 10:04 [PATCH v2 0/2] Restrict virtio-gpu-udmabuf stubs to !Linux Philippe Mathieu-Daudé
  2021-08-23 10:04 ` [PATCH v2 1/2] hw/display: " Philippe Mathieu-Daudé
@ 2021-08-23 10:04 ` Philippe Mathieu-Daudé
  1 sibling, 0 replies; 3+ messages in thread
From: Philippe Mathieu-Daudé @ 2021-08-23 10:04 UTC (permalink / raw)
  To: qemu-devel
  Cc: Maxim R ., Paolo Bonzini, Philippe Mathieu-Daudé, Gerd Hoffmann

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 include/ui/console.h |  2 ++
 ui/udmabuf.c         | 11 -----------
 ui/meson.build       |  6 ++++--
 3 files changed, 6 insertions(+), 13 deletions(-)

diff --git a/include/ui/console.h b/include/ui/console.h
index b30b63976a5..3be21497a2e 100644
--- a/include/ui/console.h
+++ b/include/ui/console.h
@@ -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
diff --git a/ui/udmabuf.c b/ui/udmabuf.c
index 23abe1e7eb9..cebceb26100 100644
--- a/ui/udmabuf.c
+++ b/ui/udmabuf.c
@@ -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
diff --git a/ui/meson.build b/ui/meson.build
index a3a187d633a..7d25c1b95b5 100644
--- a/ui/meson.build
+++ b/ui/meson.build
@@ -12,12 +12,14 @@
   '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()
-- 
2.31.1



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

end of thread, other threads:[~2021-08-23 10:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-23 10:04 [PATCH v2 0/2] Restrict virtio-gpu-udmabuf stubs to !Linux Philippe Mathieu-Daudé
2021-08-23 10:04 ` [PATCH v2 1/2] hw/display: " Philippe Mathieu-Daudé
2021-08-23 10:04 ` [PATCH v2 2/2] ui/console: Restrict udmabuf_fd() to Linux Philippe Mathieu-Daudé

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).