emulators/qemu: build fail on current amd64

Daichi GOTO daichi at ongs.co.jp
Fri Feb 13 17:14:12 PST 2009


Juergen Lock wrote:
>> 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'.

Exactly yes, slirp is cause of that.

(gdb) bt
#0  tcp_close (tp=0x802167f80) at slirp/tcp_subr.c:278
#1  0x000000000046d773 in tcp_input (m=0x80211b600, iphlen=8760, inso=0x0)
     at slirp/tcp_input.c:1260
#2  0x0000000000408bf1 in qemu_send_packet (vc1=0x8021377c0,
     buf=0x81b5e3876 "RT", size=60)
     at /usr/ports/emulators/qemu/work/qemu-0.9.1/vl.c:3747
#3  0x000000000041d618 in ne2000_ioport_write (opaque=0x81b5df228, addr=8760,
     val=4) at /usr/ports/emulators/qemu/work/qemu-0.9.1/hw/ne2000.c:347
#4  0x0000000001f14a0c in code_gen_buffer ()
#5  0x0000000000000000 in ?? ()
#6  0x0000000000488e6d in cpu_x86_exec (env1=0x802167f80)
     at /usr/ports/emulators/qemu/work/qemu-0.9.1/cpu-exec.c:679
#7  0x000000000040ef8c in main (argc=13, argv=0xc100)
     at /usr/ports/emulators/qemu/work/qemu-0.9.1/vl.c:7599
(gdb)

>  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.)

I have tried to use tap and bridge network, and qemu looks like
well working ;-)

 From my reseach, current amd64 cannot destroy tap and and bridge
interface, do "ifconfig tap0 destroy", "kldunload if_tap" or
"ifconfig bridge0 destroy" leads system stop. So I have created
attached script to use qemu with tap/bridge interface.

Thanks

>  Good luck,
> 	Juergen

-- 
   Daichi GOTO, http://people.freebsd.org/~daichi

-------------- next part --------------
#!/bin/sh

# default configuration
nicname="re0"
bridgename="bridge0"
basedir="${HOME}/Library/qemu"
debugmode="on"

# debug mode
case "${debugmode}" in
off)
    ulimit -c 0
esac

# setting up bridge network 
if ! ifconfig "${bridgename}" > /dev/null 2>&1
then
    ifconfig "${bridgename}" create
    ifconfig "${bridgename}" addm "${nicname}" up
fi

# setting up tap interface
for target in $(ls /dev/ | grep -E "^tap[0-9]")
do
    case "$(fstat /dev/"${target}" | wc -l | awk '{print $1}')" in
    1)
        tapname="${target}"
        ifconfig "${tapname}" up
        ifconfig "${bridgename}" addm "${tapname}"
        break
        ;;
    esac
done

if [ -z "${tapname}" ]
then
    tapname=$(ifconfig tap create)
    ifconfig "${tapname}" up
    ifconfig "${bridgename}" addm "${tapname}"
fi

# start up qemu
qemu \
-net nic -net tap,ifname="${tapname}" \
-localtime \
-m 1024 \
-soundhw es1370 \
-usb -usbdevice tablet \
-hda ${basedir}/DISK0_YOURDISK_HERE \
-hdb ${basedir}/DISK1_YOURDISK_HERE

# free tap interface
ifconfig "${bridgename}" deletem "${tapname}"


More information about the freebsd-emulation mailing list