On Fri, Aug 22, 2014 at 06:54:16PM +0800, Fam Zheng wrote: > The iscsi driver doesn't work if built with --enable-modules: > > $ ~/build/last/qemu-img > Failed to open module: /home/fam/build/master/block-iscsi.so: undefined symbol: qmp_query_uuid > qemu-img: Not enough arguments > Try 'qemu-img --help' for more information > > This fixes it by completely linking libqemuutil.a (now qemuutil.o) rather than > on demand. > > A few stub functions are added into libqemustub to make linker happy. > > Lastly, iqn generation code is moved from iscsi.c to util, so that > qmp_query_uuid or its stub is not missed. Did you try ld --just-symbols=filename to include module symbol dependencies when linking the QEMU binary? The advantage is that the QEMU binary stays smaller. And (depending on whether you consider this a feature or not) it discourages people from building out-of-tree modules. Did you compare the before/after binary size with your patch? Please use size(1). It's unfortunate to bloat the binary, not just from a code size perspective, but also from a security perspective less code is better (cannot be abused in return-oriented-programming). Stefan