Modules 20200707 patches
The following changes since commit 7623b5ba017f61de5d7c2bba12c6feb3d55091b1:
Merge remote-tracking branch 'remotes/vivier2/tags/linux-user-for-5.1-pull-request' into staging (2020-07-06 11:40:10 +0100)
are available in the Git repository at:
git://git.kraxel.org/qemu tags/modules-20200707-pull-request
for you to fetch changes up to ef138c77249771081d8c2d09b8e729f7e92cdf28:
chardev: enable modules, use for braille (2020-07-07 15:33:59 +0200)
----------------------------------------------------------------
qom: add support for qom objects in modules.
build some devices (qxl, virtio-gpu, ccid, usb-redir) as modules. build braille chardev as module.
v2: more verbose comment for "build: fix device module builds" patch.
note: qemu doesn't rebuild objects on cflags changes (specifically
-fPIC being added when code is switched from builtin to module). Workaround for resulting build errors: "make clean", rebuild.
----------------------------------------------------------------
Gerd Hoffmann (10):
module: qom module support
object: qom module support
qdev: device module support
build: fix device module builds
ccid: build smartcard as module
usb: build usb-redir as module
vga: build qxl as module
vga: build virtio-gpu only once
vga: build virtio-gpu as module
chardev: enable modules, use for braille
Makefile.objs | 2 ++ Makefile.target | 14 +++++++++ include/qemu/module.h | 2 ++ include/qom/object.h | 12 +++++++ chardev/char.c | 2 +- hw/core/qdev.c | 6 ++-- qdev-monitor.c | 5 +-- qom/object.c | 14 +++++++++ qom/qom-qmp-cmds.c | 3 +- softmmu/vl.c | 4 +-- util/module.c | 67 ++++++++++++++++++++++++++++++++++++++++ chardev/Makefile.objs | 5 ++- hw/Makefile.objs | 2 ++ hw/display/Makefile.objs | 28 ++++++++++------- hw/usb/Makefile.objs | 13 +++++--- 15 files changed, 155 insertions(+), 24 deletions(-)
Signature · 1 line
2.18.4
[PULL 03/10] qdev: device module support
Hook module loading into the places where we
need it when building devices as modules.
Message-id: [email protected]
--- hw/core/qdev.c | 6 ++++-- qdev-monitor.c | 5 +++-- qom/qom-qmp-cmds.c | 3 ++- softmmu/vl.c | 4 ++-- 4 files changed, 11 insertions(+), 7 deletions(-)
hw/core/qdev.c +4 -2
@@ -137,6 +137,9 @@ void qdev_set_parent_bus(DeviceState *dev, BusState *bus)*/ DeviceState *qdev_new (const char *name) { +if (!object_class_by_name (name)) { +module_load_qom_one (name); + }return DEVICE (object_new (name)); }
@@ -147,10 +150,9 @@ DeviceState *qdev_new(const char *name)*/ DeviceState *qdev_try_new (const char *name) { -if (!object_class_by_name (name)) { +if (!module_object_class_by_name (name)) {return NULL ; } -return DEVICE (object_new (name)); }
qdev-monitor.c +3 -2
@@ -147,6 +147,7 @@ static void qdev_print_devinfos(bool show_no_user)int i;bool cat_printed; +module_load_qom_all (); list =object_class_get_list_sorted (TYPE_DEVICE , false);for (i =0 ; i <=DEVICE_CATEGORY_MAX ; i++) {
@@ -215,13 +216,13 @@ static DeviceClass *qdev_get_device_class(const char **driver, Error **errp)DeviceClass *dc;const char *original_name = *driver; - oc =object_class_by_name (*driver); + oc =module_object_class_by_name (*driver);if (!oc) {const char *typename =find_typename_by_alias (*driver);if (typename) { *driver = typename; - oc =object_class_by_name (*driver); + oc =module_object_class_by_name (*driver); } }
qom/qom-qmp-cmds.c +2 -1
@@ -116,6 +116,7 @@ ObjectTypeInfoList *qmp_qom_list_types(bool has_implements, {ObjectTypeInfoList *ret =NULL ; +module_load_qom_all ();object_class_foreach (qom_list_types_tramp, implements, abstract, &ret);return ret;
@@ -130,7 +131,7 @@ ObjectPropertyInfoList *qmp_device_list_properties(const char *typename,ObjectPropertyIterator iter;ObjectPropertyInfoList *prop_list =NULL ; - klass =object_class_by_name (typename); + klass =module_object_class_by_name (typename);if (klass ==NULL ) {error_set (errp,ERROR_CLASS_DEVICE_NOT_FOUND ,"Device '%s' not found" , typename);
softmmu/vl.c +2 -2
@@ -1772,8 +1772,8 @@ static bool vga_interface_available(VGAInterfaceType t)assert (t <VGA_TYPE_MAX );return !ti->class_names[0 ] || -object_class_by_name (ti->class_names[0 ]) || -object_class_by_name (ti->class_names[1 ]); +module_object_class_by_name (ti->class_names[0 ]) || +module_object_class_by_name (ti->class_names[1 ]); } static const char *
Signature · 1 line
2.18.4
[PULL 02/10] object: qom module support
In reply to Gerd HoffmannLittle helper function to load modules on demand. In most cases adding module loading support for devices and other objects is just s/object_class_by_name/module_object_class_by_name/ in the right spot.
Message-id: [email protected]
--- include/qom/object.h | 12 ++++++++++++ qom/object.c | 14 ++++++++++++++ 2 files changed, 26 insertions(+)
include/qom/object.h +12 -0
@@ -994,6 +994,18 @@ bool object_class_is_abstract(ObjectClass *klass);*/ ObjectClass *object_class_by_name (const char *typename); +/** +* module_object_class_by_name: +* @typename: The QOM typename to obtain the class for. +* +* For objects which might be provided by a module. Behaves like +* object_class_by_name, but additionally tries to load the module +* needed in case the class is not available. +* +* Returns: The class for @typename or %NULL if not found. +*/ +ObjectClass *module_object_class_by_name (const char *typename); +void object_class_foreach (void (*fn)(ObjectClass *klass,void *opaque),const char *implements_type,bool include_abstract,void *opaque);
qom/object.c +14 -0
@@ -985,6 +985,20 @@ ObjectClass *object_class_by_name(const char *typename)return type->class; } +ObjectClass *module_object_class_by_name (const char *typename) +{ +ObjectClass *oc; + + oc =object_class_by_name (typename); +#ifdef CONFIG_MODULES +if (!oc) { +module_load_qom_one (typename); + oc =object_class_by_name (typename); + } +#endif +return oc; +} +ObjectClass *object_class_get_parent (ObjectClass *class) {TypeImpl *type =type_get_parent (class->type);
Signature · 1 line
2.18.4
[PULL 04/10] build: fix device module builds
In reply to Gerd HoffmannSlightly hackish workaround, works ok as long as we don't have target-specific modules. meson will obsolete this.
See comment in the patch for the --verbose description.
Message-id: [email protected]
[ kraxel: updated comment from discussions ]
--- Makefile.target | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
Makefile.target +14 -0
@@ -179,6 +179,20 @@ endif # CONFIG_SOFTMMU dummy := $(call unnest-vars,,obj-y) all-obj-y := $(obj-y) +# +# common-obj-m has some crap here, probably as side effect from +# unnest-vars recursing into target directories to fill obj-y and not +# properly handling the -m case. +# +# Clear common-obj-m as workaround. Fixes suspious dependency errors +# when building devices as modules. A bit hackish, but should be ok +# as long as we do not have any target-specific modules. +# +# The meson-based build system currently in development doesn't need +# unnest-vars and will obsolete this workaround. +# +common-obj-m := + include $(SRC_PATH)/Makefile.objs dummy := $(call unnest-vars,.., \ authz-obj-y \
Signature · 1 line
2.18.4
[PULL 06/10] usb: build usb-redir as module
In reply to Gerd HoffmannDrops libusbredirparser.so dependency from core qemu.
Message-id: [email protected]
--- util/module.c | 1 + hw/usb/Makefile.objs | 9 ++++++--- 2 files changed, 7 insertions(+), 3 deletions(-)
util/module.c +1 -0
@@ -263,6 +263,7 @@ static struct { } const qom_modules[] = { {"ccid-card-passthru" ,"hw-" ,"usb-smartcard" }, {"ccid-card-emulated" ,"hw-" ,"usb-smartcard" }, + {"usb-redir" ,"hw-" ,"usb-redirect" }, };static bool module_loaded_qom_all;
hw/usb/Makefile.objs +6 -3
@@ -43,9 +43,12 @@ endif # usb redirection ifeq ($(CONFIG_USB),y) -common-obj-$(CONFIG_USB_REDIR) += redirect.o quirks.o -redirect.o-cflags = $(USB_REDIR_CFLAGS) -redirect.o-libs = $(USB_REDIR_LIBS) +ifeq ($(CONFIG_USB_REDIR),y) +common-obj-m += redirect.mo +redirect.mo-objs = redirect.o quirks.o +redirect.mo-cflags = $(USB_REDIR_CFLAGS) +redirect.mo-libs = $(USB_REDIR_LIBS) +endif endif # usb pass-through
Signature · 1 line
2.18.4
[PULL 10/10] chardev: enable modules, use for braille
In reply to Gerd HoffmannRemoves brlapi library dependency from core qemu.
Message-id: [email protected]
--- Makefile.objs | 1 + chardev/char.c | 2 +- util/module.c | 1 + chardev/Makefile.objs | 5 ++++- 4 files changed, 7 insertions(+), 2 deletions(-)
Makefile.objs +1 -0
@@ -71,6 +71,7 @@ common-obj-$(CONFIG_TPM) += tpm.o common-obj-y += backends/ common-obj-y += chardev/ +common-obj-m += chardev/ common-obj-$(CONFIG_SECCOMP) += qemu-seccomp.o qemu-seccomp.o-cflags := $(SECCOMP_CFLAGS)
chardev/char.c +1 -1
@@ -527,7 +527,7 @@ static const ChardevClass *char_get_class(const char *driver, Error **errp)const ChardevClass *cc;char *typename =g_strdup_printf ("chardev-%s" , driver); - oc =object_class_by_name (typename); + oc =module_object_class_by_name (typename);g_free (typename);if (!object_class_dynamic_cast (oc,TYPE_CHARDEV )) {
util/module.c +1 -0
@@ -272,6 +272,7 @@ static struct { { "vhost-user-gpu-device", "hw-", "display-virtio-gpu" }, { "vhost-user-gpu-pci", "hw-", "display-virtio-gpu" }, { "vhost-user-vga", "hw-", "display-virtio-gpu" }, + { "chardev-braille", "chardev-", "baum" }, };static bool module_loaded_qom_all;
chardev/Makefile.objs +4 -1
@@ -18,8 +18,11 @@ chardev-obj-$(CONFIG_WIN32) += char-win.o chardev-obj-$(CONFIG_WIN32) += char-win-stdio.o common-obj-y += msmouse.o wctablet.o testdev.o -common-obj-$(CONFIG_BRLAPI) += baum.o + +ifeq ($(CONFIG_BRLAPI),y) +common-obj-m += baum.o baum.o-cflags := $(SDL_CFLAGS) baum.o-libs := $(BRLAPI_LIBS) +endif common-obj-$(CONFIG_SPICE) += spice.o
Signature · 1 line
2.18.4
[PULL 09/10] vga: build virtio-gpu as module
In reply to Gerd HoffmannDrops libvirglrenderer.so dependency from core qemu.
Message-id: [email protected]
--- util/module.c | 6 ++++++ hw/display/Makefile.objs | 23 +++++++++++++---------- 2 files changed, 19 insertions(+), 10 deletions(-)
util/module.c +6 -0
@@ -266,6 +266,12 @@ static struct { { "usb-redir", "hw-", "usb-redirect" }, { "qxl-vga", "hw-", "display-qxl" }, { "qxl", "hw-", "display-qxl" }, + { "virtio-gpu-device", "hw-", "display-virtio-gpu" }, + { "virtio-gpu-pci", "hw-", "display-virtio-gpu" }, + { "virtio-vga", "hw-", "display-virtio-gpu" }, + { "vhost-user-gpu-device", "hw-", "display-virtio-gpu" }, + { "vhost-user-gpu-pci", "hw-", "display-virtio-gpu" }, + { "vhost-user-vga", "hw-", "display-virtio-gpu" }, };static bool module_loaded_qom_all;
hw/display/Makefile.objs +13 -10
@@ -49,16 +49,19 @@ common-obj-m += qxl.mo qxl.mo-objs = qxl.o qxl-logger.o qxl-render.o endif -common-obj-$(CONFIG_VIRTIO_GPU) += virtio-gpu-base.o virtio-gpu.o virtio-gpu-3d.o -common-obj-$(CONFIG_VHOST_USER_GPU) += vhost-user-gpu.o -common-obj-$(call land,$(CONFIG_VIRTIO_GPU),$(CONFIG_VIRTIO_PCI)) += virtio-gpu-pci.o -common-obj-$(call land,$(CONFIG_VHOST_USER_GPU),$(CONFIG_VIRTIO_PCI)) += vhost-user-gpu-pci.o -common-obj-$(CONFIG_VIRTIO_VGA) += virtio-vga.o -common-obj-$(CONFIG_VHOST_USER_VGA) += vhost-user-vga.o -virtio-gpu.o-cflags := $(VIRGL_CFLAGS) -virtio-gpu.o-libs += $(VIRGL_LIBS) -virtio-gpu-3d.o-cflags := $(VIRGL_CFLAGS) -virtio-gpu-3d.o-libs += $(VIRGL_LIBS) +ifeq ($(CONFIG_VIRTIO_GPU),y) +common-obj-m += virtio-gpu.mo +virtio-gpu-obj-$(CONFIG_VIRTIO_GPU) += virtio-gpu-base.o virtio-gpu.o virtio-gpu-3d.o +virtio-gpu-obj-$(CONFIG_VHOST_USER_GPU) += vhost-user-gpu.o +virtio-gpu-obj-$(call land,$(CONFIG_VIRTIO_GPU),$(CONFIG_VIRTIO_PCI)) += virtio-gpu-pci.o +virtio-gpu-obj-$(call land,$(CONFIG_VHOST_USER_GPU),$(CONFIG_VIRTIO_PCI)) += vhost-user-gpu-pci.o +virtio-gpu-obj-$(CONFIG_VIRTIO_VGA) += virtio-vga.o +virtio-gpu-obj-$(CONFIG_VHOST_USER_VGA) += vhost-user-vga.o +virtio-gpu.mo-objs := $(virtio-gpu-obj-y) +virtio-gpu.mo-cflags := $(VIRGL_CFLAGS) +virtio-gpu.mo-libs := $(VIRGL_LIBS) +endif + common-obj-$(CONFIG_DPCD) += dpcd.o common-obj-$(CONFIG_XLNX_ZYNQMP_ARM) += xlnx_dp.o
Signature · 1 line
2.18.4
[PULL 07/10] vga: build qxl as module
In reply to Gerd HoffmannFirst step in making spice support modular.
Message-id: [email protected]
--- util/module.c | 2 ++ hw/Makefile.objs | 1 + hw/display/Makefile.objs | 5 ++++- 3 files changed, 7 insertions(+), 1 deletion(-)
util/module.c +2 -0
@@ -264,6 +264,8 @@ static struct { { "ccid-card-passthru", "hw-", "usb-smartcard" }, { "ccid-card-emulated", "hw-", "usb-smartcard" }, { "usb-redir", "hw-", "usb-redirect" }, + { "qxl-vga", "hw-", "display-qxl" }, + { "qxl", "hw-", "display-qxl" }, };static bool module_loaded_qom_all;
hw/Makefile.objs +1 -0
@@ -43,5 +43,6 @@ devices-dirs-y += smbios/ endif common-obj-y += $(devices-dirs-y) +common-obj-m += display/ common-obj-m += usb/ obj-y += $(devices-dirs-y)
hw/display/Makefile.objs +4 -1
@@ -44,7 +44,10 @@ common-obj-$(CONFIG_ARTIST) += artist.o obj-$(CONFIG_VGA) += vga.o -common-obj-$(CONFIG_QXL) += qxl.o qxl-logger.o qxl-render.o +ifeq ($(CONFIG_QXL),y) +common-obj-m += qxl.mo +qxl.mo-objs = qxl.o qxl-logger.o qxl-render.o +endif obj-$(CONFIG_VIRTIO_GPU) += virtio-gpu-base.o virtio-gpu.o virtio-gpu-3d.o obj-$(CONFIG_VHOST_USER_GPU) += vhost-user-gpu.o
Signature · 1 line
2.18.4
[PULL 01/10] module: qom module support
In reply to Gerd HoffmannAdd support for qom types provided by modules. For starters use a manually maintained list which maps qom type to module and prefix.
Two load functions are added: One to load the module for a specific type, and one to load all modules (needed for object/device lists as printed by -- for example -- qemu -device help).
Message-id: [email protected]
--- include/qemu/module.h | 2 ++ util/module.c | 55 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+)
include/qemu/module.h +2 -0
@@ -70,5 +70,7 @@ void register_dso_module_init(void (*fn)(void), module_init_type type);void module_call_init (module_init_type type);bool module_load_one (const char *prefix,const char *lib_name); +void module_load_qom_one (const char *type); +void module_load_qom_all (void );#endif
util/module.c +55 -0
58 lines not on this page · raw message
Signature · 1 line
2.18.4
[PULL 08/10] vga: build virtio-gpu only once
In reply to Gerd HoffmannMessage-id: [email protected]
--- hw/display/Makefile.objs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
hw/display/Makefile.objs +6 -6
@@ -49,12 +49,12 @@ common-obj-m += qxl.mo qxl.mo-objs = qxl.o qxl-logger.o qxl-render.o endif -obj-$(CONFIG_VIRTIO_GPU) += virtio-gpu-base.o virtio-gpu.o virtio-gpu-3d.o -obj-$(CONFIG_VHOST_USER_GPU) += vhost-user-gpu.o -obj-$(call land,$(CONFIG_VIRTIO_GPU),$(CONFIG_VIRTIO_PCI)) += virtio-gpu-pci.o -obj-$(call land,$(CONFIG_VHOST_USER_GPU),$(CONFIG_VIRTIO_PCI)) += vhost-user-gpu-pci.o -obj-$(CONFIG_VIRTIO_VGA) += virtio-vga.o -obj-$(CONFIG_VHOST_USER_VGA) += vhost-user-vga.o +common-obj-$(CONFIG_VIRTIO_GPU) += virtio-gpu-base.o virtio-gpu.o virtio-gpu-3d.o +common-obj-$(CONFIG_VHOST_USER_GPU) += vhost-user-gpu.o +common-obj-$(call land,$(CONFIG_VIRTIO_GPU),$(CONFIG_VIRTIO_PCI)) += virtio-gpu-pci.o +common-obj-$(call land,$(CONFIG_VHOST_USER_GPU),$(CONFIG_VIRTIO_PCI)) += vhost-user-gpu-pci.o +common-obj-$(CONFIG_VIRTIO_VGA) += virtio-vga.o +common-obj-$(CONFIG_VHOST_USER_VGA) += vhost-user-vga.o virtio-gpu.o-cflags := $(VIRGL_CFLAGS) virtio-gpu.o-libs += $(VIRGL_LIBS) virtio-gpu-3d.o-cflags := $(VIRGL_CFLAGS)
Signature · 1 line
2.18.4
[PULL 05/10] ccid: build smartcard as module
In reply to Gerd HoffmannDrops libcacard.so dependency from core qemu.
Message-id: [email protected]
--- Makefile.objs | 1 + util/module.c | 2 ++ hw/Makefile.objs | 1 + hw/usb/Makefile.objs | 4 +++- 4 files changed, 7 insertions(+), 1 deletion(-)
Makefile.objs +1 -0
@@ -59,6 +59,7 @@ common-obj-y += migration/ common-obj-y += audio/ common-obj-m += audio/ common-obj-y += hw/ +common-obj-m += hw/ common-obj-y += replay/
util/module.c +2 -0
@@ -261,6 +261,8 @@ static struct {const char *prefix;const char *module; } const qom_modules[] = { + {"ccid-card-passthru" ,"hw-" ,"usb-smartcard" }, + {"ccid-card-emulated" ,"hw-" ,"usb-smartcard" }, };static bool module_loaded_qom_all;
hw/Makefile.objs +1 -0
@@ -43,4 +43,5 @@ devices-dirs-y += smbios/ endif common-obj-y += $(devices-dirs-y) +common-obj-m += usb/ obj-y += $(devices-dirs-y)
hw/usb/Makefile.objs +3 -1
@@ -29,11 +29,13 @@ common-obj-$(CONFIG_USB_NETWORK) += dev-network.o ifeq ($(CONFIG_USB_SMARTCARD),y) common-obj-y += dev-smartcard-reader.o -common-obj-$(CONFIG_SMARTCARD) += smartcard.mo +ifeq ($(CONFIG_SMARTCARD),y) +common-obj-m += smartcard.mo smartcard.mo-objs := ccid-card-passthru.o ccid-card-emulated.o smartcard.mo-cflags := $(SMARTCARD_CFLAGS) smartcard.mo-libs := $(SMARTCARD_LIBS) endif +endif ifeq ($(CONFIG_POSIX),y) common-obj-$(CONFIG_USB_STORAGE_MTP) += dev-mtp.o
Signature · 1 line
2.18.4
Peter Maydell
AppliedQuoted 18 lines · Gerd Hoffmann
The following changes since commit
7623b5ba017f61de5d7c2bba12c6feb3d55091b1:Merge remote-tracking branch 'remotes/vivier2/tags/linux-user-for-5.1-pull-request' into staging (2020-07-06 11:40:10 +0100)
are available in the Git repository at:
git://git.kraxel.org/qemutags/modules-20200707-pull-requestfor you to fetch changes up to
ef138c77249771081d8c2d09b8e729f7e92cdf28:chardev: enable modules, use for braille (2020-07-07 15:33:59 +0200)
----------------------------------------------------------------
qom: add support for qom objects in modules.
build some devices (qxl, virtio-gpu, ccid, usb-redir) as modules. build braille chardev as module.
Quoted 6 lines
v2: more verbose comment for "build: fix device module builds" patch.
note: qemu doesn't rebuild objects on cflags changes (specifically
-fPIC being added when code is switched from builtin to module). Workaround for resulting build errors: "make clean", rebuild.
Applied, thanks.
Please update the changelog at https://wiki.qemu.org/ChangeLog/5.1
for any user-visible changes.
-- PMM
Quoted 25 lines · Gerd Hoffmann
The following changes since commit
7623b5ba017f61de5d7c2bba12c6feb3d55091b1:Merge remote-tracking branch 'remotes/vivier2/tags/linux-user-for-5.1-pull-request' into staging (2020-07-06 11:40:10 +0100)
are available in the Git repository at:
git://git.kraxel.org/qemutags/modules-20200707-pull-requestfor you to fetch changes up to
ef138c77249771081d8c2d09b8e729f7e92cdf28:chardev: enable modules, use for braille (2020-07-07 15:33:59 +0200)
----------------------------------------------------------------
qom: add support for qom objects in modules.
build some devices (qxl, virtio-gpu, ccid, usb-redir) as modules. build braille chardev as module.v2: more verbose comment for "build: fix device module builds" patch.
note: qemu doesn't rebuild objects on cflags changes (specifically
-fPIC being added when code is switched from builtin to module). Workaround for resulting build errors: "make clean", rebuild.----------------------------------------------------------------
Quoted 11 lines
Gerd Hoffmann (10):
module: qom module support
object: qom module support
qdev: device module support
build: fix device module builds
ccid: build smartcard as module
usb: build usb-redir as module
vga: build qxl as module
vga: build virtio-gpu only once
vga: build virtio-gpu as module
chardev: enable modules, use for braille
Hi Gerd,
something in this series seems to cause a build failure on Travis:
https://travis-ci.com/github/huth/qemu/jobs/359586799#L7404
Could you please have a look?
Thanks,
Thomas
Quoted 37 lines · Gerd Hoffmann
The following changes since commit
7623b5ba017f61de5d7c2bba12c6feb3d55091b1:Merge remote-tracking branch 'remotes/vivier2/tags/linux-user-for-5.1-pull-request' into staging (2020-07-06 11:40:10 +0100)
are available in the Git repository at:
git://git.kraxel.org/qemutags/modules-20200707-pull-requestfor you to fetch changes up to
ef138c77249771081d8c2d09b8e729f7e92cdf28:chardev: enable modules, use for braille (2020-07-07 15:33:59 +0200)
----------------------------------------------------------------
qom: add support for qom objects in modules.
build some devices (qxl, virtio-gpu, ccid, usb-redir) as modules. build braille chardev as module.v2: more verbose comment for "build: fix device module builds" patch.
note: qemu doesn't rebuild objects on cflags changes (specifically
-fPIC being added when code is switched from builtin to module). Workaround for resulting build errors: "make clean", rebuild.----------------------------------------------------------------
Gerd Hoffmann (10):
module: qom module support
object: qom module support
qdev: device module support
build: fix device module builds
ccid: build smartcard as module
usb: build usb-redir as module
vga: build qxl as module
vga: build virtio-gpu only once
vga: build virtio-gpu as module
chardev: enable modules, use for braille
Quoted 17 lines
Makefile.objs | 2 ++ Makefile.target | 14 +++++++++ include/qemu/module.h | 2 ++ include/qom/object.h | 12 +++++++ chardev/char.c | 2 +- hw/core/qdev.c | 6 ++-- qdev-monitor.c | 5 +-- qom/object.c | 14 +++++++++ qom/qom-qmp-cmds.c | 3 +- softmmu/vl.c | 4 +-- util/module.c | 67 ++++++++++++++++++++++++++++++++++++++++ chardev/Makefile.objs | 5 ++- hw/Makefile.objs | 2 ++ hw/display/Makefile.objs | 28 ++++++++++------- hw/usb/Makefile.objs | 13 +++++--- 15 files changed, 155 insertions(+), 24 deletions(-)
This is making Travis-CI fail:
https://travis-ci.org/github/philmd/qemu/jobs/706941688
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))} QTEST_QEMU_BINARY=s390x-softmmu/qemu-system-s390x QTEST_QEMU_IMG=qemu-img tests/qtest/device-introspect-test -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="device-introspect-test"
Failed to open module:/home/travis/build/philmd/qemu/build/s390x-softmmu/../hw-display-qxl.so:
undefined symbol: vga_ioport_read
Failed to open module:/home/travis/build/philmd/qemu/build/s390x-softmmu/../hw-display-virtio-gpu.so:
undefined symbol: pci_std_vga_mmio_region_init
PASS 1 device-introspect-test /s390x/device/introspect/list
Failed to open module:/home/travis/build/philmd/qemu/build/s390x-softmmu/../hw-display-qxl.so:
undefined symbol: vga_ioport_read
Failed to open module:/home/travis/build/philmd/qemu/build/s390x-softmmu/../hw-display-virtio-gpu.so:
undefined symbol: pci_std_vga_mmio_region_init
PASS 2 device-introspect-test /s390x/device/introspect/list-fields PASS 3 device-introspect-test /s390x/device/introspect/none
PASS 4 device-introspect-test /s390x/device/introspect/abstract Failed to open module:/home/travis/build/philmd/qemu/build/s390x-softmmu/../hw-display-qxl.so:
undefined symbol: vga_ioport_read
Failed to open module:/home/travis/build/philmd/qemu/build/s390x-softmmu/../hw-display-virtio-gpu.so:
undefined symbol: pci_std_vga_mmio_region_init
PASS 5 device-introspect-test /s390x/device/introspect/abstract-interfaces Failed to open module:/home/travis/build/philmd/qemu/build/s390x-softmmu/../hw-display-qxl.so:
undefined symbol: vga_ioport_read
Failed to open module:/home/travis/build/philmd/qemu/build/s390x-softmmu/../hw-display-virtio-gpu.so:
undefined symbol: pci_std_vga_mmio_region_init
missing object type 'virtio-gpu-device'
Broken pipe /home/travis/build/philmd/qemu/tests/qtest/libqtest.c:175: kill_qemu() detected QEMU death from signal 6 (Aborted) (core dumped)
Aborted (core dumped)
ERROR - too few tests run (expected 6, got 5) /home/travis/build/philmd/qemu/tests/Makefile.include:648: recipe for target 'check-qtest-s390x' failed
make: *** [check-qtest-s390x] Error 1