qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 1/4] Move dbus-display1 out of ui


From: Marc-André Lureau
Subject: Re: [PATCH v2 1/4] Move dbus-display1 out of ui
Date: Fri, 15 Dec 2023 16:00:48 +0400

Hi

On Fri, Dec 15, 2023 at 3:29 PM Akihiko Odaki <akihiko.odaki@daynix.com> wrote:
>
> Despite its name, dbus-display1 does not only provide DBus interfaces
> for the display but also for the audio.
>
> Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>

It can actually do a lot more, since you can arbitrarily redirect
chardev devices.. USB, smartcard, QMP and what's not are possible.

Yet, this is a -display module, so we should leave it under ui/ for now imho

> ---
>  MAINTAINERS                               |  1 +
>  meson.build                               | 21 +++++++++++++++++++++
>  ui/dbus.h                                 |  2 +-
>  audio/dbusaudio.c                         |  2 +-
>  tests/qtest/dbus-display-test.c           |  2 +-
>  ui/dbus-display1.xml => dbus-display1.xml |  0
>  ui/meson.build                            | 18 ------------------
>  7 files changed, 25 insertions(+), 21 deletions(-)
>
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 695e0bd34fbb..0c2630d0e264 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -3389,6 +3389,7 @@ F: docs/sphinx/dbus*
>  F: docs/sphinx/fakedbusdoc.py
>  F: tests/qtest/dbus*
>  F: scripts/xml-preprocess*
> +F: dbus-display.xml
>
>  Seccomp
>  M: Daniel P. Berrange <berrange@redhat.com>
> diff --git a/meson.build b/meson.build
> index ec01f8b138aa..5e1b25a47184 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -2014,6 +2014,27 @@ dbus_display = get_option('dbus_display') \
>             error_message: gdbus_codegen_error.format('-display dbus')) \
>    .allowed()
>
> +if dbus_display
> +  env = environment()
> +  env.set('TARGETOS', targetos)
> +  xml = custom_target('dbus-display preprocess',
> +                      input: 'dbus-display1.xml',
> +                      output: 'dbus-display1.xml',
> +                      env: env,
> +                      command: [xml_pp, '@INPUT@', '@OUTPUT@'])
> +  dbus_display1 = custom_target('dbus-display gdbus-codegen',
> +                                output: ['dbus-display1.h', 
> 'dbus-display1.c'],
> +                                input: xml,
> +                                command: [gdbus_codegen, '@INPUT@',
> +                                          '--glib-min-required', '2.64',
> +                                          '--output-directory', 
> meson.current_build_dir(),
> +                                          '--interface-prefix', 'org.qemu.',
> +                                          '--c-namespace', 'QemuDBus',
> +                                          '--generate-c-code', '@BASENAME@'])
> +  dbus_display1_lib = static_library('dbus-display1', dbus_display1, 
> dependencies: gio)
> +  dbus_display1_dep = declare_dependency(link_with: dbus_display1_lib, 
> include_directories: include_directories('.'))
> +endif
> +
>  have_virtfs = get_option('virtfs') \
>      .require(targetos == 'linux' or targetos == 'darwin',
>               error_message: 'virtio-9p (virtfs) requires Linux or macOS') \
> diff --git a/ui/dbus.h b/ui/dbus.h
> index 1e8c24a48e32..ba9bab9f84d9 100644
> --- a/ui/dbus.h
> +++ b/ui/dbus.h
> @@ -31,7 +31,7 @@
>  #include "ui/console.h"
>  #include "ui/clipboard.h"
>
> -#include "ui/dbus-display1.h"
> +#include "dbus-display1.h"
>
>  typedef struct DBusClipboardRequest {
>      GDBusMethodInvocation *invocation;
> diff --git a/audio/dbusaudio.c b/audio/dbusaudio.c
> index 60fcf643ecf8..5222b3c68804 100644
> --- a/audio/dbusaudio.c
> +++ b/audio/dbusaudio.c
> @@ -34,7 +34,7 @@
>  #endif
>
>  #include "ui/dbus.h"
> -#include "ui/dbus-display1.h"
> +#include "dbus-display1.h"
>
>  #define AUDIO_CAP "dbus"
>  #include "audio.h"
> diff --git a/tests/qtest/dbus-display-test.c b/tests/qtest/dbus-display-test.c
> index 21edaa1e321f..a15e9c377b08 100644
> --- a/tests/qtest/dbus-display-test.c
> +++ b/tests/qtest/dbus-display-test.c
> @@ -5,7 +5,7 @@
>  #include <gio/gio.h>
>  #include <gio/gunixfdlist.h>
>  #include "libqtest.h"
> -#include "ui/dbus-display1.h"
> +#include "dbus-display1.h"
>
>  static GDBusConnection*
>  test_dbus_p2p_from_fd(int fd)
> diff --git a/ui/dbus-display1.xml b/dbus-display1.xml
> similarity index 100%
> rename from ui/dbus-display1.xml
> rename to dbus-display1.xml
> diff --git a/ui/meson.build b/ui/meson.build
> index 0ccb3387ee6a..bbb7c5242d55 100644
> --- a/ui/meson.build
> +++ b/ui/meson.build
> @@ -75,24 +75,6 @@ endif
>
>  if dbus_display
>    dbus_ss = ss.source_set()
> -  env = environment()
> -  env.set('TARGETOS', targetos)
> -  xml = custom_target('dbus-display preprocess',
> -                      input: 'dbus-display1.xml',
> -                      output: 'dbus-display1.xml',
> -                      env: env,
> -                      command: [xml_pp, '@INPUT@', '@OUTPUT@'])
> -  dbus_display1 = custom_target('dbus-display gdbus-codegen',
> -                                output: ['dbus-display1.h', 
> 'dbus-display1.c'],
> -                                input: xml,
> -                                command: [gdbus_codegen, '@INPUT@',
> -                                          '--glib-min-required', '2.64',
> -                                          '--output-directory', 
> meson.current_build_dir(),
> -                                          '--interface-prefix', 'org.qemu.',
> -                                          '--c-namespace', 'QemuDBus',
> -                                          '--generate-c-code', '@BASENAME@'])
> -  dbus_display1_lib = static_library('dbus-display1', dbus_display1, 
> dependencies: gio)
> -  dbus_display1_dep = declare_dependency(link_with: dbus_display1_lib, 
> include_directories: include_directories('.'))
>    dbus_ss.add(when: [gio, dbus_display1_dep],
>                if_true: [files(
>                  'dbus-chardev.c',
>
> --
> 2.43.0
>
>


-- 
Marc-André Lureau



reply via email to

[Prev in Thread] Current Thread [Next in Thread]