From: Akihiko Odaki <akihiko.odaki@daynix.com>
To: "Marc-André Lureau" <marcandre.lureau@redhat.com>,
"Gerd Hoffmann" <kraxel@redhat.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Daniel P. Berrangé" <berrange@redhat.com>,
"Thomas Huth" <thuth@redhat.com>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>,
"Laurent Vivier" <lvivier@redhat.com>
Cc: qemu-devel@nongnu.org, Akihiko Odaki <akihiko.odaki@daynix.com>
Subject: [PATCH v5 1/2] util: Move dbus_display1 to util
Date: Sun, 17 Dec 2023 15:12:52 +0900 [thread overview]
Message-ID: <20231217-dbus-v5-1-8122e822a392@daynix.com> (raw)
In-Reply-To: <20231217-dbus-v5-0-8122e822a392@daynix.com>
Move dbus_display1 from ui to util as it's used not only by ui/dbus but
also dbus-display-test.
dbus_display1 is now added to util_ss accordingly. It ensures that the
source will be linked with audio/dbus, and also avoids recompilation
when linking with dbus-display-test.
dbus-display.h is also added to genh to ensure it is generated before
compiling ui/dbus, audio/dbus, and dbus-display-test.
Both changes combined, it is no longer necessary for ui/dbus,
audio/dbus, and dbus-display-test to explicitly state the dependency on
dbus_display1.
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
---
MAINTAINERS | 2 +-
docs/interop/dbus-display.rst | 6 +++---
ui/dbus.h | 2 +-
audio/dbusaudio.c | 2 +-
tests/qtest/dbus-display-test.c | 2 +-
tests/qtest/meson.build | 2 +-
ui/meson.build | 20 +-------------------
{ui => util}/dbus-display1.xml | 0
util/meson.build | 21 +++++++++++++++++++++
9 files changed, 30 insertions(+), 27 deletions(-)
diff --git a/MAINTAINERS b/MAINTAINERS
index 695e0bd34fbb..aefc2b62d9f5 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -3381,7 +3381,7 @@ S: Maintained
F: backends/dbus-vmstate.c
F: ui/dbus*
F: audio/dbus*
-F: util/dbus.c
+F: util/dbus*
F: include/ui/dbus*
F: include/qemu/dbus.h
F: docs/interop/dbus*
diff --git a/docs/interop/dbus-display.rst b/docs/interop/dbus-display.rst
index 8c6e8e0f5a82..efec89723a34 100644
--- a/docs/interop/dbus-display.rst
+++ b/docs/interop/dbus-display.rst
@@ -18,14 +18,14 @@ QEMU also implements the standard interfaces, such as
.. only:: sphinx4
- .. dbus-doc:: ui/dbus-display1.xml
+ .. dbus-doc:: util/dbus-display1.xml
.. only:: not sphinx4
.. warning::
Sphinx 4 is required to build D-Bus documentation.
- This is the content of ``ui/dbus-display1.xml``:
+ This is the content of ``util/dbus-display1.xml``:
- .. literalinclude:: ../../ui/dbus-display1.xml
+ .. literalinclude:: ../../util/dbus-display1.xml
:language: xml
diff --git a/ui/dbus.h b/ui/dbus.h
index 1e8c24a48e32..a847bee98876 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 "util/dbus-display1.h"
typedef struct DBusClipboardRequest {
GDBusMethodInvocation *invocation;
diff --git a/audio/dbusaudio.c b/audio/dbusaudio.c
index 60fcf643ecf8..2aacdac6715b 100644
--- a/audio/dbusaudio.c
+++ b/audio/dbusaudio.c
@@ -34,7 +34,7 @@
#endif
#include "ui/dbus.h"
-#include "ui/dbus-display1.h"
+#include "util/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..d4871e2fd80f 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 "util/dbus-display1.h"
static GDBusConnection*
test_dbus_p2p_from_fd(int fd)
diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build
index 47dabf91d048..225cd35e4664 100644
--- a/tests/qtest/meson.build
+++ b/tests/qtest/meson.build
@@ -332,7 +332,7 @@ if vnc.found()
endif
if dbus_display
- qtests += {'dbus-display-test': [dbus_display1, gio]}
+ qtests += {'dbus-display-test': [gio]}
endif
qtest_executables = {}
diff --git a/ui/meson.build b/ui/meson.build
index 0ccb3387ee6a..21d1d3b27f29 100644
--- a/ui/meson.build
+++ b/ui/meson.build
@@ -75,25 +75,7 @@ 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],
+ dbus_ss.add(when: [gio],
if_true: [files(
'dbus-chardev.c',
'dbus-clipboard.c',
diff --git a/ui/dbus-display1.xml b/util/dbus-display1.xml
similarity index 100%
rename from ui/dbus-display1.xml
rename to util/dbus-display1.xml
diff --git a/util/meson.build b/util/meson.build
index c2322ef6e71a..268a8ab03671 100644
--- a/util/meson.build
+++ b/util/meson.build
@@ -119,3 +119,24 @@ elif cpu == 'loongarch64'
elif cpu in ['ppc', 'ppc64']
util_ss.add(files('cpuinfo-ppc.c'))
endif
+
+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@'])
+ util_ss.add(dbus_display1)
+ genh += dbus_display1[0]
+endif
--
2.43.0
next prev parent reply other threads:[~2023-12-17 6:14 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-17 6:12 [PATCH v5 0/2] meson: Fixes for dbus modules Akihiko Odaki
2023-12-17 6:12 ` Akihiko Odaki [this message]
2023-12-17 6:12 ` [PATCH v5 2/2] audio: Do not include ui/dbus.h Akihiko Odaki
2023-12-18 7:06 ` Marc-André Lureau
2023-12-18 7:08 ` Akihiko Odaki
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231217-dbus-v5-1-8122e822a392@daynix.com \
--to=akihiko.odaki@daynix.com \
--cc=berrange@redhat.com \
--cc=kraxel@redhat.com \
--cc=lvivier@redhat.com \
--cc=marcandre.lureau@redhat.com \
--cc=pbonzini@redhat.com \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=thuth@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).