qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@redhat.com>
To: Fam Zheng <famz@redhat.com>
Cc: kwolf@redhat.com, pbonzini@redhat.com,
	peter.crosthwaite@xilinx.com, mjt@tls.msk.ru,
	qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v2 0/7] build-sys: Fix iscsi module loading failure
Date: Fri, 22 Aug 2014 14:35:19 +0100	[thread overview]
Message-ID: <20140822133519.GC14126@stefanha-thinkpad.redhat.com> (raw)
In-Reply-To: <1408704863-12343-1-git-send-email-famz@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1206 bytes --]

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

[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]

  parent reply	other threads:[~2014-08-22 13:35 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-22 10:54 [Qemu-devel] [PATCH v2 0/7] build-sys: Fix iscsi module loading failure Fam Zheng
2014-08-22 10:54 ` [Qemu-devel] [PATCH v2 1/7] build-sys: Move fifo8.c to hw/misc Fam Zheng
2014-08-22 12:20   ` Peter Crosthwaite
2014-08-22 10:54 ` [Qemu-devel] [PATCH v2 2/7] configure: Add -lutil to libs_qga if necessary Fam Zheng
2014-08-22 10:54 ` [Qemu-devel] [PATCH v2 3/7] stubs: Add iohandler.c Fam Zheng
2014-08-22 10:54 ` [Qemu-devel] [PATCH v2 4/7] stubs: Merge set-fd-handler.c into iohandler.c Fam Zheng
2014-08-22 10:54 ` [Qemu-devel] [PATCH v2 5/7] util: Move throttle.c out to top level Fam Zheng
2014-08-25 13:22   ` Paolo Bonzini
2014-08-22 10:54 ` [Qemu-devel] [PATCH v2 6/7] build-sys: Change libqemuutil.a to qemuutil.o and link whole object Fam Zheng
2014-08-22 10:54 ` [Qemu-devel] [PATCH v2 7/7] iscsi: Move iqn generation code to util Fam Zheng
2014-08-22 13:35 ` Stefan Hajnoczi [this message]
2014-08-22 13:42   ` [Qemu-devel] [PATCH v2 0/7] build-sys: Fix iscsi module loading failure Paolo Bonzini
2014-08-25  2:27   ` Fam Zheng
2014-08-28 11:17     ` Stefan Hajnoczi
2014-08-28 12:12       ` Fam Zheng
2014-08-28 12:20         ` Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140822133519.GC14126@stefanha-thinkpad.redhat.com \
    --to=stefanha@redhat.com \
    --cc=famz@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mjt@tls.msk.ru \
    --cc=pbonzini@redhat.com \
    --cc=peter.crosthwaite@xilinx.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).