qapi/meson: Restrict qdev code to system-mode emulation
authorPhilippe Mathieu-Daudé <philmd@redhat.com>
Fri, 22 Jan 2021 20:44:38 +0000 (21:44 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 8 Feb 2021 13:43:55 +0000 (14:43 +0100)
Beside a CPU device, user-mode emulation doesn't access
anything else from qdev subsystem.

Tools don't need anything from qdev.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20210122204441.2145197-10-philmd@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
MAINTAINERS
qapi/meson.build
stubs/meson.build
stubs/qdev.c [new file with mode: 0644]

index 8d8b0bf966d68036f7f3b387a8e0716737c5f835..ca74617cc30e48e7ea4857028f5c98b287cfb864 100644 (file)
@@ -2539,6 +2539,7 @@ F: qapi/qom.json
 F: qapi/qdev.json
 F: scripts/coccinelle/qom-parent-type.cocci
 F: softmmu/qdev-monitor.c
+F: stubs/qdev.c
 F: qom/
 F: tests/check-qom-interface.c
 F: tests/check-qom-proplist.c
index ab68e7900e41ed57e0b884b03882ad56bad9aa94..2839871b478943f6df2d44155984b229548af187 100644 (file)
@@ -35,7 +35,6 @@ qapi_all_modules = [
   'misc-target',
   'net',
   'pragma',
-  'qdev',
   'pci',
   'qom',
   'rdma',
@@ -49,6 +48,11 @@ qapi_all_modules = [
   'ui',
   'yank',
 ]
+if have_system
+  qapi_all_modules += [
+    'qdev',
+  ]
+endif
 
 qapi_storage_daemon_modules = [
   'block-core',
index 1a656cd070474024a4f180956796d6dfdd6083e3..a054d5877fb8236a379fb352a2ccb7830fc6aea9 100644 (file)
@@ -53,4 +53,6 @@ endif
 if have_system
   stub_ss.add(files('semihost.c'))
   stub_ss.add(files('xen-hw-stub.c'))
+else
+  stub_ss.add(files('qdev.c'))
 endif
diff --git a/stubs/qdev.c b/stubs/qdev.c
new file mode 100644 (file)
index 0000000..92e6143
--- /dev/null
@@ -0,0 +1,23 @@
+/*
+ * QOM stubs
+ *
+ * Copyright (c) 2021 Red Hat, Inc.
+ *
+ * Author:
+ *   Philippe Mathieu-Daudé <philmd@redhat.com>
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or later.
+ * See the COPYING file in the top-level directory.
+ */
+
+#include "qemu/osdep.h"
+#include "qapi/qapi-events-qdev.h"
+
+void qapi_event_send_device_deleted(bool has_device,
+                                    const char *device,
+                                    const char *path)
+{
+    /* Nothing to do. */
+}