Patchwork [RFC,07/10] qdev: add sysbus_get_default() stub

login
register
mail settings
Submitter Eduardo Habkost
Date Nov. 30, 2012, 7:27 p.m.
Message ID <1354303642-4283-8-git-send-email-ehabkost@redhat.com>
Download mbox | patch
Permalink /patch/203033/
State New
Headers show

Comments

Eduardo Habkost - Nov. 30, 2012, 7:27 p.m.
This version will be used on cases where sysbus.c is not compiled in
(e.g. *-user).

Note that code that uses NULL as the bus with qdev{_try,}_create()
implicitly uses sysbus_get_default() as the bus, and requires sysbus.c
to be compiled in.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
Changes v1 -> v2:
 - Use the new QEMU_WEAK_ALIAS mechanism, instead of GCC_WEAK

Changes v2 -> v3:
 - Use the new libqemustub.a mechanism, instead of QEMU_WEAK_ALIAS
---
 stubs/Makefile.objs | 1 +
 stubs/sysbus.c      | 6 ++++++
 2 files changed, 7 insertions(+)
 create mode 100644 stubs/sysbus.c

Patch

diff --git a/stubs/Makefile.objs b/stubs/Makefile.objs
index 5557079..a59885f 100644
--- a/stubs/Makefile.objs
+++ b/stubs/Makefile.objs
@@ -6,4 +6,5 @@  stub-obj-y += fdset-remove-fd.o
 stub-obj-y += get-fd.o
 stub-obj-y += set-fd-handler.o
 stub-obj-y += vmstate.o
+stub-obj-y += sysbus.o
 stub-obj-$(CONFIG_WIN32) += fd-register.o
diff --git a/stubs/sysbus.c b/stubs/sysbus.c
new file mode 100644
index 0000000..e134965
--- /dev/null
+++ b/stubs/sysbus.c
@@ -0,0 +1,6 @@ 
+#include "hw/qdev-core.h"
+
+BusState *sysbus_get_default(void)
+{
+    return NULL;
+}