diff mbox

qemu-ga: Fix linux build with trace backend

Message ID 1314640005-4278-1-git-send-email-weil@mail.berlios.de
State Superseded
Headers show

Commit Message

Stefan Weil Aug. 29, 2011, 5:46 p.m. UTC
Builds with configure --enable-trace-backend=simple failed on linux
because qemu-ga then uses simpletrace.c which needs get_clock which
needs use_rt_clock which was unresolved.

Adding qemu-timer-common.o fixes this. It adds a little overhead
(about 150 byte).

Cc: Michael Roth <mdroth@linux.vnet.ibm.com>
Cc: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
---
 Makefile |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Comments

=?utf-8?Q?Llu=C3=ADs?= Aug. 29, 2011, 6:32 p.m. UTC | #1
Stefan Weil writes:

> Builds with configure --enable-trace-backend=simple failed on linux
> because qemu-ga then uses simpletrace.c which needs get_clock which
> needs use_rt_clock which was unresolved.

> Adding qemu-timer-common.o fixes this. It adds a little overhead
> (about 150 byte).

There are a couple of threads associated to this very same topic:

http://lists.gnu.org/archive/html/qemu-devel/2011-08/msg02915.html
http://lists.gnu.org/archive/html/qemu-devel/2011-08/msg03302.html


Lluis
Stefan Weil Aug. 29, 2011, 7:20 p.m. UTC | #2
Am 29.08.2011 20:32, schrieb Lluís:
> Stefan Weil writes:
>> Builds with configure --enable-trace-backend=simple failed on linux
>> because qemu-ga then uses simpletrace.c which needs get_clock which
>> needs use_rt_clock which was unresolved.
>> Adding qemu-timer-common.o fixes this. It adds a little overhead
>> (about 150 byte).
>
> There are a couple of threads associated to this very same topic:
>
> http://lists.gnu.org/archive/html/qemu-devel/2011-08/msg02915.html
> http://lists.gnu.org/archive/html/qemu-devel/2011-08/msg03302.html
>
> Lluis

Thanks for the links. So we now have three patch sets for one problem,
and it will be fixed by a maintainer commit soon :-)

I personally prefer Blue Swirl's patch (which avoids the overhead)
or my own patch (which adds a little overhead but is the simplest
of all three patches). Sorting lists of object files and removing
duplicates looks strange in my opinion (and might also be bad when
related code no longer shares the same memory page).

With my patch, qemu-ga and the other tools (qemu-io, qemu-img, ...)
also use similar object lists.

Kind regards,
Stefan
Michael Roth Aug. 29, 2011, 7:33 p.m. UTC | #3
On 08/29/2011 02:20 PM, Stefan Weil wrote:
> Am 29.08.2011 20:32, schrieb Lluís:
>> Stefan Weil writes:
>>> Builds with configure --enable-trace-backend=simple failed on linux
>>> because qemu-ga then uses simpletrace.c which needs get_clock which
>>> needs use_rt_clock which was unresolved.
>>> Adding qemu-timer-common.o fixes this. It adds a little overhead
>>> (about 150 byte).
>>
>> There are a couple of threads associated to this very same topic:
>>
>> http://lists.gnu.org/archive/html/qemu-devel/2011-08/msg02915.html
>> http://lists.gnu.org/archive/html/qemu-devel/2011-08/msg03302.html
>>
>> Lluis
>
> Thanks for the links. So we now have three patch sets for one problem,
> and it will be fixed by a maintainer commit soon :-)
>

4, actually :) An alternative proposal from Blue was setting 
CONFIG_QEMU_TIMER based on whether or not qemu-timer-common.o was needed 
for a particular dependency, so anyone dependent on, say, trace-obj-y 
could just have:

blah-obj-$(CONFIG_QEMU_TIMER) += qemu-timer-common.o

I CC'd you on the patch.

> I personally prefer Blue Swirl's patch (which avoids the overhead)
> or my own patch (which adds a little overhead but is the simplest
> of all three patches). Sorting lists of object files and removing
> duplicates looks strange in my opinion (and might also be bad when
> related code no longer shares the same memory page).
>

I actually preferred the sorted list approach, I think it mirrors how 
most projects handle duplicate header includes and allows for defining a 
self-sufficient group of objects without needed to worry whether 2 
groups list the same object as a dependency. This allows results in one 
group being underspecified and any subsequent user of that group to be 
aware of what's missing.

> With my patch, qemu-ga and the other tools (qemu-io, qemu-img, ...)
> also use similar object lists.
>
> Kind regards,
> Stefan
>
>
>
diff mbox

Patch

diff --git a/Makefile b/Makefile
index 8606849..63cc07f 100644
--- a/Makefile
+++ b/Makefile
@@ -197,7 +197,7 @@  QGALIB_GEN=$(addprefix $(qapi-dir)/, qga-qapi-types.c qga-qapi-types.h qga-qapi-
 $(QGALIB_GEN): $(GENERATED_HEADERS)
 $(qga-obj-y) qemu-ga.o: $(QGALIB_GEN)
 
-qemu-ga$(EXESUF): qemu-ga.o $(qga-obj-y) $(qapi-obj-y) $(trace-obj-y) $(qobject-obj-y) $(version-obj-y) $(addprefix $(qapi-dir)/, qga-qapi-visit.o qga-qapi-types.o qga-qmp-marshal.o)
+qemu-ga$(EXESUF): qemu-ga.o $(qga-obj-y) $(qapi-obj-y) $(trace-obj-y) qemu-timer-common.o $(qobject-obj-y) $(version-obj-y) $(addprefix $(qapi-dir)/, qga-qapi-visit.o qga-qapi-types.o qga-qmp-marshal.o)
 
 QEMULIBS=libhw32 libhw64 libuser libdis libdis-user