Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 12 Feb 2009 19:17:13 +0100
From:      Juergen Lock <nox@jelal.kn-bremen.de>
To:        Daichi GOTO <daichi@ongs.co.jp>
Cc:        freebsd-emulation@freebsd.org
Subject:   Re: emulators/qemu: build fail on current amd64
Message-ID:  <20090212181713.GA13229@saturn.kn-bremen.de>
In-Reply-To: <499419DC.1050102@ongs.co.jp>
References:  <498A5F90.1030004@ongs.co.jp> <20090206214916.GA14653@saturn.kn-bremen.de> <200902102257.n1AMvF9v013733@saturn.kn-bremen.de> <4992924E.4090604@ongs.co.jp> <18834.42024.739091.493218@gromit.timing.com> <499419DC.1050102@ongs.co.jp>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Feb 12, 2009 at 09:45:16PM +0900, Daichi GOTO wrote:
> John Hein wrote:
>> Daichi GOTO wrote at 17:54 +0900 on Feb 11, 2009:
>>  > Juergen Lock wrote:
>>  > > In article <4990EF3E.5090908@ongs.co.jp> you write:
>>  > >> After some days, I have tried to build qemu and kqemu with
>>  > >> latest amd64 current system, and I have gottten it success :)
>>  > >>
>>  > >> FYI, qemu works well but without kqemu.
>>  > >>
>>  > >> # /usr/local/etc/rc.d/kqemu start
>>  > >> kldload: can't load kqemu: Exec format error
>>  > >> /usr/local/etc/rc.d/kqemu: WARNING: kqemu module failed to load.
>>  > >> #
>>  > >  > > Oh?  Is there anything in dmesg, like a missing symbol?  Or did 
>> you
>>  > > update your world/kernel after building kqemu?  In that case you should
>>  > > rebuild your kqemu port...
>>  >  > # uname -a
>>  > FreeBSD parancell.ongs.co.jp 8.0-CURRENT FreeBSD 8.0-CURRENT #3: Mon 
>> Feb  9 14:18:09 JST 2009  > 
>> root@parancell.ongs.co.jp:/usr/obj/usr/src/sys/PARANCELL  amd64
>>  > # dmesg
>>  > (snip)
>>  > link_elf_obj: symbol unit2minor undefined
>>  > kldload: /boot/modules/kqemu.ko: Unsupported file type
>>  > (snip)
>> 
>> unit2minor was removed recently.
>> See recent commit to sys/sys/conf.h
>> Any in-tree drivers left that used unit2minor were fixed at the same time.
>> 
>> For kqemu-kmod, try this...
>> 
>> --- kqemu-1.3.0pre11/kqemu-freebsd.c.orig	2007-02-06 14:02:00.000000000 -0700
>> +++ kqemu-1.3.0pre11/kqemu-freebsd.c	2009-02-11 03:04:50.000000000 -0700
>> @@ -296,7 +296,11 @@
>>       r = clone_create(&kqemuclones, &kqemu_cdevsw, &unit, dev, 0);
>>      if (r) {
>> +#if __FreeBSD_version > 800061
>> +	*dev = make_dev(&kqemu_cdevsw, unit,
>> +#else
>>  	*dev = make_dev(&kqemu_cdevsw, unit2minor(unit),
>> +#endif
>>  	    UID_ROOT, GID_WHEEL, 0660, "kqemu%d", unit);
>>  	if (*dev != NULL) {
>>  	    dev_ref(*dev);
> 
> Adove patch works well :)  Now I can load kqemu and run
> qemu with it!  I guess it should be under files dir of
> emulators/kqemu-kmod.
> 
Yeah I just committed ports/131603 which contains the same fix, just written
a little different.

> And another problem comming X-(
> After startup WinXP on qemu+kqemu, at user logs in,
> qemu gets Segmentation fault.  It looks like fails
> at the same point always.
> Any one have any ideas?  Someone have the same situation?

 A backtrace could be useful here, do something like
	gdb /usr/ports/emulators/qemu/work/qemu-0.9.1/i386-softmmu/qemu qemu.core
and then in gdb `bt'.

 My crystal ball :) tells me you are using slirp on amd64 (-net user which
is the default nat-kinda networking) and the guest may be trying to access
the network when you login (slirp is unstable on 64 bit hosts in the qemu
versions in ports which is also documented in the pkg-message.s)  If its
that you could either try using tuntap networking instead, or try qemu svn,
a snapshot of which I posted a qemu-devel port update for here:
	http://lists.freebsd.org/pipermail/freebsd-emulation/2009-February/005650.html
(qemu-devel uses the kqemu-kmod-devel port which CONFLICTS with kqemu-kmod,
so if you are upgrading from qemu 0.9.1 pkg_delete the old kqemu first.)

 Good luck,
	Juergen



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090212181713.GA13229>