All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé via" <qemu-devel@nongnu.org>
To: qemu-devel@nongnu.org
Cc: "Daniel P. Berrangé" <berrange@redhat.com>,
	"Thomas Huth" <thuth@redhat.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Markus Armbruster" <armbru@redhat.com>,
	"Richard Henderson" <richard.henderson@linaro.org>,
	"Philippe Mathieu-Daudé" <f4bug@amsat.org>
Subject: [PATCH 3/4] qom: Remove user-creatable objects from user emulation
Date: Fri,  4 Feb 2022 16:29:23 +0100	[thread overview]
Message-ID: <20220204152924.6253-4-f4bug@amsat.org> (raw)
In-Reply-To: <20220204152924.6253-1-f4bug@amsat.org>

user-mode don't use user-creatable objects. Restrict it to
sysemu / tools.

Add a stub to avoid a link failure with the global callback:

  /usr/bin/ld: libqom.fa(qom_object.c.o): in function `object_initialize_child_with_propsv':
  ../qom/object.c:578: undefined reference to `user_creatable_complete'
  /usr/bin/ld: libqom.fa(qom_object.c.o): in function `object_new_with_propv':
  ../qom/object.c:801: undefined reference to `user_creatable_complete'
  collect2: error: ld returned 1 exit status

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 qom/meson.build           | 7 ++++++-
 qom/user_creatable-stub.c | 8 ++++++++
 tests/unit/meson.build    | 2 +-
 3 files changed, 15 insertions(+), 2 deletions(-)
 create mode 100644 qom/user_creatable-stub.c

diff --git a/qom/meson.build b/qom/meson.build
index 062a3789d8..afc60cc19d 100644
--- a/qom/meson.build
+++ b/qom/meson.build
@@ -2,9 +2,14 @@ qom_ss.add(genh)
 qom_ss.add(files(
   'container.c',
   'object.c',
-  'object_interfaces.c',
   'qom-qobject.c',
 ))
 
+if have_system or have_tools
+  qom_ss.add(files('object_interfaces.c'))
+else
+  qom_ss.add(files('user_creatable-stub.c'))
+endif
+
 qmp_ss.add(files('qom-qmp-cmds.c'))
 softmmu_ss.add(files('qom-hmp-cmds.c'))
diff --git a/qom/user_creatable-stub.c b/qom/user_creatable-stub.c
new file mode 100644
index 0000000000..cc3638e20d
--- /dev/null
+++ b/qom/user_creatable-stub.c
@@ -0,0 +1,8 @@
+#include "qemu/osdep.h"
+
+#include "qom/object_interfaces.h"
+
+bool user_creatable_complete(UserCreatable *uc, Error **errp)
+{
+    g_assert_not_reached();
+}
diff --git a/tests/unit/meson.build b/tests/unit/meson.build
index 64a5e7bfde..2cdcd136c9 100644
--- a/tests/unit/meson.build
+++ b/tests/unit/meson.build
@@ -39,7 +39,6 @@ tests = {
   'test-bitcnt': [],
   'test-qgraph': ['../qtest/libqos/qgraph.c'],
   'check-qom-interface': [qom],
-  'check-qom-proplist': [qom],
   'test-qemu-opts': [],
   'test-keyval': [testqapi],
   'test-logging': [],
@@ -51,6 +50,7 @@ tests = {
 
 if have_system or have_tools
   tests += {
+    'check-qom-proplist': [qom],
     'test-qmp-event': [testqapi],
   }
 endif
-- 
2.34.1



  parent reply	other threads:[~2022-02-04 15:33 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-04 15:29 [PATCH 0/4] buildsys: Avoid building unused objects Philippe Mathieu-Daudé via
2022-02-04 15:29 ` [PATCH 1/4] configure: Restrict TCG to emulation Philippe Mathieu-Daudé via
2022-02-04 15:35   ` Thomas Huth
2022-02-04 16:55   ` Paolo Bonzini
2022-02-04 15:29 ` [PATCH 2/4] tests/fp: Do not build softfloat3 tests if TCG is disabled Philippe Mathieu-Daudé via
2022-02-04 15:38   ` Thomas Huth
2022-02-04 15:29 ` Philippe Mathieu-Daudé via [this message]
2022-02-04 15:56   ` [PATCH 3/4] qom: Remove user-creatable objects from user emulation Thomas Huth
2022-02-04 16:14     ` Philippe Mathieu-Daudé via
2022-02-04 16:56   ` Paolo Bonzini
2022-02-04 15:29 ` [PATCH 4/4] qapi/meson: Restrict machine-specific objects to sysemu Philippe Mathieu-Daudé via
2022-02-04 16:25   ` Thomas Huth
2022-02-04 17:00   ` Paolo Bonzini
2022-02-04 23:40     ` Philippe Mathieu-Daudé via

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=20220204152924.6253-4-f4bug@amsat.org \
    --to=qemu-devel@nongnu.org \
    --cc=armbru@redhat.com \
    --cc=berrange@redhat.com \
    --cc=f4bug@amsat.org \
    --cc=pbonzini@redhat.com \
    --cc=richard.henderson@linaro.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.