qapi/meson: Restrict qdev code to system-mode emulation

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>
This commit is contained in:
Philippe Mathieu-Daudé 2021-01-22 21:44:38 +01:00 committed by Paolo Bonzini
parent 957b31f6c5
commit 9b45a025ed
4 changed files with 31 additions and 1 deletions

View 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

View 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',

View 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

23
stubs/qdev.c Normal file
View File

@ -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. */
}