# This is a shell archive. Save it in a file, remove anything before # this line, and then unpack it by entering "sh file". Note, it may # create directories; files and directories will be owned by you and # have default permissions. # # This archive contains: # # qemu-devel/ # qemu-devel/Makefile # qemu-devel/distinfo # qemu-devel/pkg-descr # qemu-devel/pkg-message # qemu-devel/pkg-plist # qemu-devel/files/ # qemu-devel/files/cdrom-dma-patch # qemu-devel/files/hw_e1000_c.patch # qemu-devel/files/patch-90_security # qemu-devel/files/patch-9999-ed-maste-configure-changes.patch # qemu-devel/files/patch-Makefile # qemu-devel/files/patch-bf # qemu-devel/files/patch-bg # qemu-devel/files/patch-bsd-user-8fix # qemu-devel/files/patch-configure # qemu-devel/files/patch-hw-usb-host-libusb.c # qemu-devel/files/patch-qemu-doc.texi # qemu-devel/files/patch-tapclose # qemu-devel/files/patch-tcg-i386-tcg-target.c # qemu-devel/files/patch-ui-gtk.c # qemu-devel/files/patch-vl.c-serial # qemu-devel/files/patch-x_keymap.c # qemu-devel/files/pcap-patch # qemu-devel/files/qemu-ifdown.sample # qemu-devel/files/qemu-ifup.sample # echo c - qemu-devel/ mkdir -p qemu-devel/ > /dev/null 2>&1 echo x - qemu-devel/Makefile sed 's/^X//' >qemu-devel/Makefile << '7dfd4c0d0b3d5cbe45480e2bbf1a89f1' X# Created by: Juergen Lock X# $FreeBSD: head/emulators/qemu-devel/Makefile 319450 2013-05-30 19:35:25Z nox $ X XPORTNAME= qemu XPORTVERSION= 1.5.50.s20130618 XCATEGORIES= emulators XMASTER_SITES= GH GHC \ X LOCAL/nox:dtc \ X http://people.freebsd.org/~nox/tmp/distfiles/:dtc \ X http://people.freebsd.org/~nox/tmp/distfiles/ XPKGNAMESUFFIX= -devel XDISTFILES= ${DISTNAME}${EXTRACT_SUFX} \ X dtc-v1.4.0${EXTRACT_SUFX}:dtc XDIST_SUBDIR= qemu/${PORTVERSION} X XMAINTAINER= nox@FreeBSD.org XCOMMENT= QEMU CPU Emulator - development version X XLIB_DEPENDS= pixman-1:${PORTSDIR}/x11/pixman \ X curl:${PORTSDIR}/ftp/curl XBUILD_DEPENDS= bison:${PORTSDIR}/devel/bison X XUSE_GITHUB= yes XGH_ACCOUNT= staceyson XGH_PROJECT= qemu-bsd-user XGH_COMMIT= 3cda8a0 XGH_TAGNAME= ${GH_COMMIT} XWRKSRC= ${WRKDIR}/${GH_ACCOUNT}-${GH_PROJECT}-${GH_COMMIT} X XHAS_CONFIGURE= yes XUSE_GMAKE= yes XUSE_PERL5_BUILD= yes XUSE_PYTHON_BUILD= yes XUSE_GNOME+= glib20 XPATCH_STRIP= -p1 XMAKE_ENV+= BSD_MAKE="${MAKE}" XMAN1= qemu.1 qemu-img.1 XMAN8= qemu-nbd.8 XONLY_FOR_ARCHS= amd64 i386 powerpc # XXX someone wants to debug sparc64 hosts? XCONFLICTS_INSTALL= qemu-[0-9]* XMAKE_JOBS_SAFE= yes X XOPTIONS_DEFINE= SAMBA X11 OPENGL GNUTLS SASL JPEG PNG CDROM_DMA PCAP \ X USBREDIR GNS3 X86_TARGETS BSD_USER \ X STATIC_LINK DOCS XSAMBA_DESC= samba dependency (for -smb) XGNUTLS_DESC= gnutls dependency (vnc encryption) XSASL_DESC= cyrus-sasl dependency (vnc encryption) XJPEG_DESC= jpeg dependency (vnc lossy compression) XPNG_DESC= png dependency (vnc compression) XCDROM_DMA_DESC= IDE CDROM DMA XPCAP_DESC= pcap dependency (networking with bpf) XSEABIOS_GIT_DESC= add seabios snapshot (-bios bios.bin-1.6.3.1) XUSBREDIR_DESC= usb device network redirection (experimental!) XGNS3_DESC= gns3 patches (promiscuous multicast) XX86_TARGETS_DESC= Don't build non-x86 system targets XBSD_USER_DESC= Also build bsd-user targets (for testing) XSTATIC_LINK_DESC= Statically link the executables XOPTIONS_DEFAULT=X11 OPENGL GNUTLS SASL JPEG PNG CDROM_DMA PCAP BSD_USER X X.include X XCONFIGURE_ARGS+= --extra-ldflags=-L${LOCALBASE}/lib XPORTDOCS= docs qemu-doc.html qemu-tech.html qmp-commands.txt X X.if ${PORT_OPTIONS:MX86_TARGETS} X.if ${PORT_OPTIONS:MBSD_USER} X.if ${ARCH} != "amd64" XCONFIGURE_ARGS+= --enable-nptl --target-list=i386-softmmu,x86_64-softmmu,i386-bsd-user,sparc-bsd-user,arm-bsd-user,armeb-bsd-user,mips-bsd-user,mipsel-bsd-user X.else XCONFIGURE_ARGS+= --enable-nptl --target-list=i386-softmmu,x86_64-softmmu,i386-bsd-user,x86_64-bsd-user,sparc-bsd-user,sparc64-bsd-user,arm-bsd-user,armeb-bsd-user,mips-bsd-user,mipsel-bsd-user,mips64-bsd-user,mips64el-bsd-user X.endif X.else XCONFIGURE_ARGS+= --target-list=i386-softmmu,x86_64-softmmu X.endif X.else X.if empty(PORT_OPTIONS:MBSD_USER) XCONFIGURE_ARGS+= --disable-bsd-user X.else XCONFIGURE_ARGS+= --enable-nptl X.if ${ARCH} != "amd64" XCONFIGURE_ARGS+= --target-list=i386-softmmu,x86_64-softmmu,alpha-softmmu,arm-softmmu,cris-softmmu,lm32-softmmu,m68k-softmmu,microblaze-softmmu,microblazeel-softmmu,mips-softmmu,mipsel-softmmu,mips64-softmmu,mips64el-softmmu,or32-softmmu,ppc-softmmu,ppcemb-softmmu,ppc64-softmmu,sh4-softmmu,sh4eb-softmmu,sparc-softmmu,sparc64-softmmu,s390x-softmmu,xtensa-softmmu,xtensaeb-softmmu,unicore32-softmmu,moxie-softmmu,i386-bsd-user,sparc-bsd-user,arm-bsd-user,armeb-bsd-user,mips-bsd-user,mipsel-bsd-user X.endif X.endif X.endif X X.if empty(PORT_OPTIONS:MBSD_USER) XPLIST_SUB+= BSD_USER="@comment " X.else XPLIST_SUB+= BSD_USER="" X.if ${ARCH} == "sparc64" XIGNORE= bsd-user targets not tested on sparc64 X.endif X.endif X.if empty(PORT_OPTIONS:MBSD_USER) || ${ARCH} != "amd64" XPLIST_SUB+= BSD_USER64="@comment " X.else XPLIST_SUB+= BSD_USER64="" X.endif X X.if ${PORT_OPTIONS:MX86_TARGETS} XPLIST_SUB+= NONX86="@comment " X.else XPLIST_SUB+= NONX86="" X.endif X X.if ${PORT_OPTIONS:MGNS3} XEXTRA_PATCHES+= ${FILESDIR}/hw_e1000_c.patch X.endif X XWITHOUT_CPU_CFLAGS=yes #to avoid problems with register allocation XCFLAGS:= ${CFLAGS:C/-fno-tree-vrp//} XCONFIGURE_ARGS+= --prefix=${PREFIX} --cc=${CC} --enable-docs \ X --disable-linux-user --disable-linux-aio \ X --disable-kvm --disable-xen \ X --smbd=${LOCALBASE}/sbin/smbd \ X --enable-debug \ X --enable-debug-info \ X --extra-cflags=-I${WRKSRC}\ -I${LOCALBASE}/include\ -DPREFIX=\\\"${PREFIX}\\\" X X.if empty(PORT_OPTIONS:MX11) XCONFIGURE_ARGS+= --disable-gtk XCONFIGURE_ARGS+= --disable-sdl XPLIST_SUB+= GTK="@comment " X.else XUSE_SDL= sdl XUSE_GNOME+= gtk20 vte XUSES+= gettext XPLIST_SUB+= GTK="" X.endif X X.if empty(PORT_OPTIONS:MGNUTLS) XCONFIGURE_ARGS+= --disable-vnc-tls X.else XLIB_DEPENDS+= gnutls:${PORTSDIR}/security/gnutls X.endif X X.if empty(PORT_OPTIONS:MSASL) XCONFIGURE_ARGS+= --disable-vnc-sasl X.else XLIB_DEPENDS+= sasl2:${PORTSDIR}/security/cyrus-sasl2 X.endif X X.if empty(PORT_OPTIONS:MJPEG) XCONFIGURE_ARGS+= --disable-vnc-jpeg X.else XLIB_DEPENDS+= jpeg:${PORTSDIR}/graphics/jpeg X.endif X X.if empty(PORT_OPTIONS:MPNG) XCONFIGURE_ARGS+= --disable-vnc-png X.else XLIB_DEPENDS+= png15:${PORTSDIR}/graphics/png X.endif X X.if empty(PORT_OPTIONS:MOPENGL) XCONFIGURE_ARGS+= --disable-glx X.else XUSE_GL= yes X.endif X X.if empty(PORT_OPTIONS:MUSBREDIR) XCONFIGURE_ARGS+= --disable-usb-redir X.else XBUILD_DEPENDS+= usbredir>=0.6:${PORTSDIR}/net/usbredir XRUN_DEPENDS+= usbredir>=0.6:${PORTSDIR}/net/usbredir X.endif X X.if ${PORT_OPTIONS:MPCAP} XCONFIGURE_ARGS+= --enable-pcap X.endif X X.if ${PORT_OPTIONS:MSTATIC_LINK} XCONFIGURE_ARGS+= --static X.endif X X.if ${PORT_OPTIONS:MSAMBA} XRUN_DEPENDS+= ${LOCALBASE}/sbin/smbd:${PORTSDIR}/net/samba36 X.endif X X.if ${PORT_OPTIONS:MSEABIOS_GIT} XRUN_DEPENDS+= seabios-devel>=1.6.3.1:${PORTSDIR}/emulators/seabios-devel X.endif X X.if defined(NOPORTDOCS) XMAKE_ARGS+= NOPORTDOCS=1 X.else XBUILD_DEPENDS+= texi2html:${PORTSDIR}/textproc/texi2html X.endif X X.if !defined(STRIP) || ${STRIP} == "" XCONFIGURE_ARGS+=--disable-strip X.endif X X.if ${ARCH} == "amd64" XMAKE_ARGS+= ARCH=x86_64 X.endif X X.if ${ARCH} == "powerpc" XMAKE_ARGS+= ARCH=ppc X.endif X X.if ${ARCH} == "sparc64" XCONFIGURE_ARGS+= --sparc_cpu=v9 X.endif X X.if ${OSVERSION} < 900033 XBUILD_DEPENDS+= ${LOCALBASE}/bin/as:${PORTSDIR}/devel/binutils XCONFIGURE_ENV+= LD=${LOCALBASE}/bin/ld XCONFIGURE_ENV+= COMPILER_PATH=${LOCALBASE}/bin XMAKE_ENV+= COMPILER_PATH=${LOCALBASE}/bin X.endif X Xpost-patch: X @${MV} ${WRKDIR}/dtc ${WRKSRC} X.if ${OSVERSION} < 900000 X @${REINPLACE_CMD} -e '/LIBS/s|-lprocstat||' ${WRKSRC}/configure X.endif X.if ${PORT_OPTIONS:MPCAP} X @cd ${WRKSRC} && ${PATCH} --quiet < ${FILESDIR}/pcap-patch X.endif X.if empty(PORT_OPTIONS:MCDROM_DMA) X @cd ${WRKSRC} && ${PATCH} --quiet < ${FILESDIR}/cdrom-dma-patch X.endif X @${REINPLACE_CMD} -E \ X -e "s|^(CFLAGS=).*|\1${CFLAGS} -fno-strict-aliasing|" \ X -e "s|^(LDFLAGS=).*|\1${LDFLAGS}|" \ X ${WRKSRC}/Makefile.target X @${REINPLACE_CMD} -E \ X -e "s|^(CFLAGS=).*|\1${CFLAGS} -fno-strict-aliasing -I.|" \ X -e "s|^(LDFLAGS=).*|\1${LDFLAGS}|" \ X ${WRKSRC}/Makefile X @${REINPLACE_CMD} -E \ X -e "1s|^(#! )/usr/bin/perl|\1${PERL}|" \ X ${WRKSRC}/scripts/texi2pod.pl X X.if ${OSVERSION} >= 800091 X# XXX need to disable usb host code on head while it's not ported to the X# new usb stack yet Xpost-configure: X @${REINPLACE_CMD} -E \ X -e "s|^(HOST_USB=)bsd|\1stub|" \ X ${WRKSRC}/config-host.mak X.endif X Xpost-install: X.if ${PORT_OPTIONS:MDOCS} X @(cd ${WRKSRC} && ${COPYTREE_SHARE} docs ${DOCSDIR}/) X.endif X @${INSTALL_SCRIPT} ${FILESDIR}/qemu-ifup.sample ${PREFIX}/etc X @${INSTALL_SCRIPT} ${FILESDIR}/qemu-ifdown.sample ${PREFIX}/etc X @if [ ! -f ${PREFIX}/etc/qemu-ifup ]; then \ X ${CP} -p ${PREFIX}/etc/qemu-ifup.sample ${PREFIX}/etc/qemu-ifup ; \ X fi X @if [ ! -f ${PREFIX}/etc/qemu-ifdown ]; then \ X ${CP} -p ${PREFIX}/etc/qemu-ifdown.sample ${PREFIX}/etc/qemu-ifdown ; \ X fi X @${CAT} ${PKGMESSAGE} X X.include 7dfd4c0d0b3d5cbe45480e2bbf1a89f1 echo x - qemu-devel/distinfo sed 's/^X//' >qemu-devel/distinfo << '33bd2e48c6257b45e0920aa43a62f7ab' XSHA256 (qemu/1.5.50.s20130618/qemu-1.5.50.s20130618.tar.gz) = e27f9fb9fe957d2ab0aa0042cf3ffcad62f6ec6fac8afe32a6c4bcabfe92260f XSIZE (qemu/1.5.50.s20130618/qemu-1.5.50.s20130618.tar.gz) = 8870486 XSHA256 (qemu/1.5.50.s20130618/dtc-v1.4.0.tar.gz) = 39d0713efd82a27adc065ecb9ef36401c53d5ee87ae1764e2bb243fcd97488e3 XSIZE (qemu/1.5.50.s20130618/dtc-v1.4.0.tar.gz) = 131893 33bd2e48c6257b45e0920aa43a62f7ab echo x - qemu-devel/pkg-descr sed 's/^X//' >qemu-devel/pkg-descr << '035debc45d3ce7a58234833270c3c910' XQEMU is a FAST! processor emulator using dynamic translation to achieve Xgood emulation speed. XQEMU has two operating modes: X X * Full system emulation. In this mode, QEMU emulates a full system X(for example a PC), including a processor and various peripherials. XIt can be used to launch different Operating Systems without rebooting Xthe PC or to debug system code. X * User mode emulation (Linux host only). In this mode, QEMU can launch XLinux processes compiled for one CPU on another CPU. It can be used to Xlaunch the Wine Windows API emulator or to ease cross-compilation and Xcross-debugging. X XAs QEMU requires no host kernel patches to run, it is very safe and easy to use. X XSee also the preconfigured system images on http://oszoo.org/ XMany live cd isos also work. X XWWW: http://wiki.qemu.org/Main_Page 035debc45d3ce7a58234833270c3c910 echo x - qemu-devel/pkg-message sed 's/^X//' >qemu-devel/pkg-message << 'f1deb0182de1bb2473fde145fdf3c66c' XFreeBSD host notes X================== X X- Needs to set net.link.tap.user_open sysctl in order to use /dev/tap* X networking as non-root. Don't forget to adjust device node permissions in X /etc/devfs.rules. X X- slirp (usermode networking) is fixed now in cvs, on FreeSBIE 1.0 guests you X still have to manually do: echo nameserver 10.0.2.3 >/etc/resolv.conf but X i've been told that that's normal. (fixed on FreeSBIE 1.1.) And you have X to wait a bit for dhclient to do its thing; traffic to address 10.0.2.2 is X routed to 127.1 on the host. X X- Expect timer problems when guest kernel HZ is > hosts, for example time X sleep 1 takes 49 seconds and booting sleeps for minutes at the acd0 probe X with a FreeSBIE 1.0 guest, thats because its kernel is built with HZ=5000, X and FreeBSD's default is 100... (no longer a problem with FreeSBIE 1.1.) X The linux 2.6 kernel uses 1000 by default btw. (changed to 250 later, and X recent linux kernels now no longer have a fixed HZ, aka `tickless X kernel'...) Enabling /dev/rtc doesn't seem to help either (not included X since it needs a patch to emulators/rtc.) X X- Update: the above problem has gotten worse with FreeBSD guests X somewhere before 8.0, mainly since the kernel now usually wants X double or even quadruple number of timer irqs compared to HZ if X it detects an apic (and at least early versions of FreeBSD 8 had X a bug that essentially halved qemu's clock rate too); the only X reason you usually don't see symptoms of this with FreeBSD 8 X guests is they automatically reduce their HZ to 100 when running X in a VM while the default for the host kernel is still HZ=1000. X Workaround: you can disable the apic clock in the guest by setting X X hint.apic.0.clock="0" X X in loader.conf(5) (or manually at the loader prompt), if that X doesn't work the only things you can do is either reduce the X guest's HZ to, say, 100 by setting e.g. X X kern.hz="100" X X from the loader as above (which usually is a good idea in a VM X anyway and FreeBSD 8 now does by itself as mentioned), or otherwise X increase the host's HZ to 2000 or even 4000 from the loader in X the same way. X X- The -smb option (smb-export local dir to guest using the default X slirp networking) needs the net/samba36 port/package installed X in addition to qemu. (SAMBA knob.) X X- If you want to use usb devices connected to the host in the guest X yot need either recent 10-current (not tested yet much) or you can X use usbredir over the network (see below); also unless you are X running qemu as root you then need to fix permissions for /dev/ugen* X device nodes: if you are on 5.x or later (devfs) put a rule in X /etc/devfs.rules, activate it in /etc/rc.conf and run /etc/rc.d/devfs X restart. Example devfs.rules: X X [ugen_ruleset=20] X add path 'ugen*' mode 660 group operator X X corresponding rc.conf line: X X devfs_system_ruleset="ugen_ruleset" X X- If you want to test the new (in 0.15.0) usb network redirection (USBREDIR X option) see this thread by Hans de Goede redhat.com>: X X http://thread.gmane.org/gmane.comp.emulators.qemu/110176/focus=110183 X X Quote: X X Example usage: X X 1) Start usbredirserver for a usb device: X sudo usbredirserver 045e:0772 X 2) Start qemu with usb2 support + a chardev talking to usbredirserver + X a usb-redir device using this chardev: X qemu -usb \ X -readconfig docs/ich9-ehci-uhci.cfg \ X -chardev socket,id=usbredirchardev,host=localhost,port=4000 \ X -device usb-redir,chardev=usbredirchardev,id=usbredirdev ... X X [you would replace docs/ich9-ehci-uhci.cfg with e.g. X /usr/local/share/doc/qemu/docs/ich9-ehci-uhci.cfg, but turns out X ehci was broken for me here with FreeBSD guests and the previous X qemu version at least, I got: X X FETCHENTRY: entry at 22C5484 is of type 2 which is not supported yet Xprocessing error - resetting ehci HC X Assertion failed: (0), function ehci_advance_state, file /data/ports/emulators/qemu-devel/work/qemu-0.15.0/hw/usb-ehci.c, line 2045. X X The new qemu version works better tho.] X X- Still usb: since the hub is no longer attached to the uchi controller and X the wakeup mechanism, resume interrupt is not implemented yet linux guests X will suspend the bus, i.e. they wont see devices usb_add'ed after its X (linux') uhci module got loaded. Workaround: either add devices before X linux loads the module or rmmod and modprobe it afterwards. [Not sure X if this still applies to the new libusb host code used on recent X 10-current.] X X- If you get repeated `atapi_poll called!' console messages with FreeBSD X guests or other weird cdrom problems then thats probably because the guest X has atapicam loaded, which for reasons still to be determined has problems X with qemu's now by default enabled cdrom dma. You can build the port with X CDROM_DMA disabled to disable it. [Looks like this is fixed in recent X FreeBSD guest versions.] X X- If you build qemu wihout SDL and then get crashes running it try passing it X -nographic. This should probably be default in that case... X X- qemu's network boot roms (-boot n) have a bug when bootfiles sizes are a X multiple of blksize, if this affects you (like with FreeBSD's /boot/pxeboot) X you can do like X X cp /boot/pxeboot pxeboot-qemu && chmod +w pxeboot-qemu && echo >>pxeboot-qemu X X and then use pxeboot-qemu. Actually you need recent btx code X (from after 7.0 was released) because of the real mode boot X problem, so use at least pxeboot from there. And I just did that X for the pxeboot extracted out of X X ftp://ftp.freebsd.org/pub/FreeBSD/snapshots/200805/7.0-STABLE-200805-i386-bootonly.iso X X and placed it here: X X http://people.freebsd.org/~nox/qemu/pxeboot-qemu X X- If you use slirp (usernet, the default) and want to mount nfs into the guest X and you are not running qemu as root, then mountd(8) on the exporting box X needs to be run with -n in order to accept requests from ports >= 1024. X X- (not FreeBSD-specific:) There have been reports of qcow2 corruption with (at X least) win2k guests on recent kvm (which uses similar qcow2 code than qemu X now, see this thread: X X http://lists.gnu.org/archive/html/qemu-devel/2009-02/msg00713.html - X X the consensus on that thread seems to be that qcow(2) code has always been X experimental and you should use raw images if you want reliability; raw is X also usually faster.) You should be able to migrate existing images to raw X using qemu-img(1)'s convert function; raw doesn't support advanced features X like snapshots tho. [a few important qcow2 bugfixed have been committed in X the meantime so this _might_ be less of an issue now; and meanwhile there X also is the new qed format - I don't know how stable that one is.] X X- (also not FreeBSD-specific:) It is recommended to pass raw images using the X new -drive syntax, specifying format=raw explicitly in order to avoid X malicious guests being able to exploit the format autodetection thats X otherwise getting used. (Not that you should run malicious guests anyway, X but this eleminates at least a known attack vector.) X X- qemu now has improved physical cdrom support, but still there still is at X least one known problem: you need to have the guest eject the disc if you X want to change it/take it out, or otherwise the guest may continue using X state (like size) of the old disc. (You can also do like `change ide1-cd0 X /dev/acd0' in the monitor after taking out the disc if a guest cannot eject X it itself.) X X- The default configuration location (qemu-ifup script etc.) has been changed X from /etc to PREFIX/etc (usually /usr/local/etc). Move your files X accordingly. X X- The pcap code (-net nic... -net pcap,ifname=...) should work properly now, X with only one exception: Advanced features like TSO used on the host X interface can cause oversize packets which now do get truncated to avoid X confusing/panicing guests but of course still will cause retransmissions. X So if you see slow throughput and `pcap_send: packet size > ..., truncating' X messages on qemu's tty try disabling TSO etc on the host interface at least X while using pcap. X X- kqemu is no longer supported in qemu upstream after the 0.11 branch X was created, which means also not in this version. (Linux has moved X on to kvm now for qemu(-like) virtualization needs, so if you want qemu X to go faster and don't want to switch to virtualbox or stick to the older X emulators/qemu port which is at 0.11.1 atm and as such still supports X kqemu you should help getting the FreeBSD kvm port updated and X completed: X X http://wiki.freebsd.org/FabioChecconi/PortingLinuxKVMToFreeBSD X X ) f1deb0182de1bb2473fde145fdf3c66c echo x - qemu-devel/pkg-plist sed 's/^X//' >qemu-devel/pkg-plist << '930b43c848ba711e30f30724ff455e10' Xbin/qemu-ga Xbin/qemu-img Xbin/qemu-io Xbin/qemu-nbd X%%NONX86%%bin/qemu-system-alpha X%%NONX86%%bin/qemu-system-arm X%%NONX86%%bin/qemu-system-cris Xbin/qemu-system-i386 X%%NONX86%%bin/qemu-system-lm32 X%%NONX86%%bin/qemu-system-m68k X%%NONX86%%bin/qemu-system-microblaze X%%NONX86%%bin/qemu-system-microblazeel X%%NONX86%%bin/qemu-system-mips X%%NONX86%%bin/qemu-system-mips64 X%%NONX86%%bin/qemu-system-mips64el X%%NONX86%%bin/qemu-system-mipsel X%%NONX86%%bin/qemu-system-moxie X%%NONX86%%bin/qemu-system-or32 X%%NONX86%%bin/qemu-system-ppc X%%NONX86%%bin/qemu-system-ppc64 X%%NONX86%%bin/qemu-system-ppcemb X%%NONX86%%bin/qemu-system-s390x X%%NONX86%%bin/qemu-system-sh4 X%%NONX86%%bin/qemu-system-sh4eb X%%NONX86%%bin/qemu-system-sparc X%%NONX86%%bin/qemu-system-sparc64 X%%NONX86%%bin/qemu-system-unicore32 X%%BSD_USER%%bin/qemu-arm X%%BSD_USER%%bin/qemu-armeb X%%BSD_USER%%bin/qemu-i386 X%%BSD_USER%%bin/qemu-mips X%%BSD_USER64%%bin/qemu-mips64 X%%BSD_USER64%%bin/qemu-mips64el X%%BSD_USER%%bin/qemu-mipsel X%%BSD_USER%%bin/qemu-sparc X%%BSD_USER64%%bin/qemu-sparc64 X%%BSD_USER64%%bin/qemu-x86_64 Xbin/qemu-system-x86_64 X%%NONX86%%bin/qemu-system-xtensa X%%NONX86%%bin/qemu-system-xtensaeb X@unexec if cmp -s %D/etc/qemu-ifup.sample %D/etc/qemu-ifup; then rm -f %D/etc/qemu-ifup; fi Xetc/qemu-ifup.sample X@exec if [ ! -f %D/etc/qemu-ifup ] ; then cp -p %D/%F %B/qemu-ifup; fi X@unexec if cmp -s %D/etc/qemu-ifdown.sample %D/etc/qemu-ifdown; then rm -f %D/etc/qemu-ifdown; fi Xetc/qemu-ifdown.sample X@exec if [ ! -f %D/etc/qemu-ifdown ] ; then cp -p %D/%F %B/qemu-ifdown; fi X@unexec if cmp -s %D/etc/qemu/target-x86_64.conf.sample %D/etc/qemu/target-x86_64.conf; then rm -f %D/etc/qemu/target-x86_64.conf; fi Xetc/qemu/target-x86_64.conf.sample X@exec if [ ! -f %D/etc/qemu/target-x86_64.conf ] ; then cp -p %D/%F %D/etc/qemu/target-x86_64.conf; fi X@dirrmtry etc/qemu X%%DATADIR%%/acpi-dsdt.aml X%%DATADIR%%/q35-acpi-dsdt.aml X%%DATADIR%%/bios.bin X%%DATADIR%%/efi-e1000.rom X%%DATADIR%%/efi-eepro100.rom X%%DATADIR%%/efi-ne2k_pci.rom X%%DATADIR%%/efi-pcnet.rom X%%DATADIR%%/efi-rtl8139.rom X%%DATADIR%%/efi-virtio.rom X%%DATADIR%%/s390-ccw.img X%%DATADIR%%/vgabios.bin X%%DATADIR%%/vgabios-cirrus.bin X%%DATADIR%%/vgabios-qxl.bin X%%DATADIR%%/vgabios-stdvga.bin X%%DATADIR%%/vgabios-vmware.bin X%%DATADIR%%/palcode-clipper X%%DATADIR%%/ppc_rom.bin X%%DATADIR%%/openbios-ppc X%%DATADIR%%/openbios-sparc32 X%%DATADIR%%/openbios-sparc64 X%%DATADIR%%/pxe-e1000.rom X%%DATADIR%%/pxe-eepro100.rom X%%DATADIR%%/pxe-ne2k_pci.rom X%%DATADIR%%/pxe-rtl8139.rom X%%DATADIR%%/pxe-pcnet.rom X%%DATADIR%%/pxe-virtio.rom X%%DATADIR%%/petalogix-ml605.dtb X%%DATADIR%%/spapr-rtas.bin X%%DATADIR%%/slof.bin X%%DATADIR%%/s390-zipl.rom X%%DATADIR%%/linuxboot.bin X%%DATADIR%%/multiboot.bin X%%DATADIR%%/sgabios.bin X%%DATADIR%%/petalogix-s3adsp1800.dtb X%%DATADIR%%/bamboo.dtb X%%DATADIR%%/kvmvapic.bin X%%DATADIR%%/qemu-icon.bmp X%%DATADIR%%/qemu_logo_no_text.svg X%%DATADIR%%/keymaps/ar X%%DATADIR%%/keymaps/bepo X%%DATADIR%%/keymaps/common X%%DATADIR%%/keymaps/da X%%DATADIR%%/keymaps/de X%%DATADIR%%/keymaps/de-ch X%%DATADIR%%/keymaps/en-gb X%%DATADIR%%/keymaps/en-us X%%DATADIR%%/keymaps/es X%%DATADIR%%/keymaps/et X%%DATADIR%%/keymaps/fi X%%DATADIR%%/keymaps/fo X%%DATADIR%%/keymaps/fr X%%DATADIR%%/keymaps/fr-be X%%DATADIR%%/keymaps/fr-ca X%%DATADIR%%/keymaps/fr-ch X%%DATADIR%%/keymaps/hr X%%DATADIR%%/keymaps/hu X%%DATADIR%%/keymaps/is X%%DATADIR%%/keymaps/it X%%DATADIR%%/keymaps/ja X%%DATADIR%%/keymaps/lt X%%DATADIR%%/keymaps/lv X%%DATADIR%%/keymaps/mk X%%DATADIR%%/keymaps/modifiers X%%DATADIR%%/keymaps/nl X%%DATADIR%%/keymaps/nl-be X%%DATADIR%%/keymaps/no X%%DATADIR%%/keymaps/pl X%%DATADIR%%/keymaps/pt X%%DATADIR%%/keymaps/pt-br X%%DATADIR%%/keymaps/ru X%%DATADIR%%/keymaps/sl X%%DATADIR%%/keymaps/sv X%%DATADIR%%/keymaps/th X%%DATADIR%%/keymaps/tr X%%GTK%%share/locale/de_DE/LC_MESSAGES/qemu.mo X%%GTK%%share/locale/fr_FR/LC_MESSAGES/qemu.mo X%%GTK%%share/locale/it/LC_MESSAGES/qemu.mo X%%GTK%%share/locale/hu/LC_MESSAGES/qemu.mo X%%GTK%%share/locale/tr/LC_MESSAGES/qemu.mo X@dirrm %%DATADIR%%/keymaps X%%GTK%%@dirrmtry share/locale/de_DE/LC_MESSAGES X%%GTK%%@dirrmtry share/locale/de_DE X@dirrmtry %%DATADIR%% X@dirrmtry %%DOCSDIR%% 930b43c848ba711e30f30724ff455e10 echo c - qemu-devel/files/ mkdir -p qemu-devel/files/ > /dev/null 2>&1 echo x - qemu-devel/files/cdrom-dma-patch sed 's/^X//' >qemu-devel/files/cdrom-dma-patch << '062df0636034fb4e7733f7caae0dc066' XIndex: hw/ide/internal.h X@@ -27,7 +27,7 @@ X //#define DEBUG_IDE X //#define DEBUG_IDE_ATAPI X //#define DEBUG_AIO X-#define USE_DMA_CDROM X+// #define USE_DMA_CDROM X X /* Bits of HD_STATUS */ X #define ERR_STAT 0x01 062df0636034fb4e7733f7caae0dc066 echo x - qemu-devel/files/hw_e1000_c.patch sed 's/^X//' >qemu-devel/files/hw_e1000_c.patch << 'c8aeca025fd58eae0bbb10714a05ffb3' X--- qemu-0.14.1/hw/net/e1000.c.orig X+++ qemu-0.14.1/hw/net/e1000.c X@@ -573,7 +573,7 @@ X if (rctl & E1000_RCTL_UPE) // promiscuous X return 1; X X- if ((buf[0] & 1) && (rctl & E1000_RCTL_MPE)) // promiscuous mcast X+ if (buf[0] & 1) // promiscuous mcast X return 1; X X if ((rctl & E1000_RCTL_BAM) && !memcmp(buf, bcast, sizeof bcast)) c8aeca025fd58eae0bbb10714a05ffb3 echo x - qemu-devel/files/patch-90_security sed 's/^X//' >qemu-devel/files/patch-90_security << '98b470dc711860c6a968b099d4b32055' XIndex: qemu/hw/dma/i8257.c X@@ -344,9 +344,11 @@ static void channel_run (int ncont, int X } X #endif X X- n = r->transfer_handler (r->opaque, ichan + (ncont << 2), X- r->now[COUNT], (r->base[COUNT] + 1) << ncont); X- r->now[COUNT] = n; X+ if (r->transfer_handler) { X+ n = r->transfer_handler (r->opaque, ichan + (ncont << 2), X+ r->now[COUNT], (r->base[COUNT] + 1) << ncont); X+ r->now[COUNT] = n; X+ } X ldebug ("dma_pos %d size %d\n", n, (r->base[COUNT] + 1) << ncont); X } X XIndex: qemu/hw/block/fdc.c X@@ -1445,7 +1445,8 @@ static uint32_t fdctrl_read_data(FDCtrl X fd_sector(cur_drv)); X return 0; X } X- if (bdrv_read(cur_drv->bs, fd_sector(cur_drv), fdctrl->fifo, 1) < 0) { X+ if (cur_drv->bs == NULL || X+ bdrv_read(cur_drv->bs, fd_sector(cur_drv), fdctrl->fifo, 1) < 0) { X FLOPPY_DPRINTF("error getting sector %d\n", X fd_sector(cur_drv)); X /* Sure, image size is too small... */ X@@ -1905,7 +1906,8 @@ static void fdctrl_write_data(FDCtrl *fd X if (pos == FD_SECTOR_LEN - 1 || X fdctrl->data_pos == fdctrl->data_len) { X cur_drv = get_cur_drv(fdctrl); X- if (bdrv_write(cur_drv->bs, fd_sector(cur_drv), fdctrl->fifo, 1) < 0) { X+ if (cur_drv->bs == NULL || X+ bdrv_write(cur_drv->bs, fd_sector(cur_drv), fdctrl->fifo, 1) < 0) { X FLOPPY_DPRINTF("error writing sector %d\n", X fd_sector(cur_drv)); X return; XIndex: qemu-0.8.2/hw/audio/sb16.c X@@ -1235,8 +1235,10 @@ static int SB_read_DMA (void *opaque, in X s->block_size); X #endif X X- while (s->left_till_irq <= 0) { X- s->left_till_irq = s->block_size + s->left_till_irq; X+ if (s->block_size) { X+ while (s->left_till_irq <= 0) { X+ s->left_till_irq = s->block_size + s->left_till_irq; X+ } X } X X return dma_pos; XIndex: qemu/hw/intc/i8259.c X@@ -291,7 +291,8 @@ static void pic_ioport_write(void *opaqu X s->init4 = val & 1; X s->single_mode = val & 2; X if (val & 0x08) { X- hw_error("level sensitive irq not supported"); X+ /* hw_error("level sensitive irq not supported"); */ X+ return; X } X } else if (val & 0x08) { X if (val & 0x04) { 98b470dc711860c6a968b099d4b32055 echo x - qemu-devel/files/patch-9999-ed-maste-configure-changes.patch sed 's/^X//' >qemu-devel/files/patch-9999-ed-maste-configure-changes.patch << '0f965046e3f0ae3f6ff2dcae29ab6a30' Xdiff --git a/configure b/configure Xindex 90167f8..bacd36d 100755 X--- a/configure X+++ b/configure X@@ -460,7 +460,7 @@ FreeBSD) X audio_possible_drivers="oss sdl esd pa" X # -lutil needed for kinfo_getvmmap(3) in libutil.h X # -lprocstat needed for procstat_*(3) in bsd-user/main.c X- LIBS="-lprocstat -lutil $LIBS" X+ LIBS="-lprocstat -lintl -lutil $LIBS" X HOST_ABI_DIR="freebsd" X ;; X DragonFly) X@@ -4089,9 +4089,9 @@ if test "$gcov" = "yes" ; then X echo "GCOV=$gcov_tool" >> $config_host_mak X fi X X-# generate list of library paths for linker script X-$ld --verbose -v 2> /dev/null | grep SEARCH_DIR > config-host.ld X- X+## generate list of library paths for linker script X+#$ld --verbose -v 2> /dev/null | grep SEARCH_DIR > config-host.ld X+# X # use included Linux headers X if test "$linux" = "yes" ; then X mkdir -p linux-headers X@@ -4458,21 +4458,42 @@ if test "$gprof" = "yes" ; then X fi X fi X X-if test "$ARCH" = "tci"; then X- linker_script="" X-else X- linker_script="-Wl,-T../config-host.ld -Wl,-T,\$(SRC_PATH)/ldscripts/\$(ARCH).ld" X-fi X+#if test "$ARCH" = "tci"; then X+# linker_script="" X+#else X+# linker_script="-Wl,-T../config-host.ld -Wl,-T,\$(SRC_PATH)/ldscripts/\$(ARCH).ld" X+#fi X X if test "$target_linux_user" = "yes" -o "$target_bsd_user" = "yes" ; then X+ textseg_addr= X case "$ARCH" in X- alpha | s390x | aarch64) X- # The default placement of the application is fine. X+ arm | hppa | i386 | ia64 | m68k | ppc | ppc64 | s390 | sparc | sparc64 | x86_64) X+ default_textseg_addr=0x400000 X+ textseg_addr=0x60000000 X ;; X- *) X- ldflags="$linker_script $ldflags" X+ mips) X+ default_textseg_addr=0x120000000 X+ textseg_addr=0x400000 X ;; X esac X+ if [ -n "$textseg_addr" ]; then X+cat > $TMPC < config-host.ld X+ ldflags="$ldflags -Wl,-T../config-host.ld" X+ fi X+ fi X fi X X echo "LDFLAGS+=$ldflags" >> $config_target_mak Xdiff --git a/util/aes.c b/util/aes.c Xindex 91e97fa..207de01 100644 X--- a/util/aes.c X+++ b/util/aes.c X@@ -877,6 +877,7 @@ int AES_set_decrypt_key(const unsigned char *userKey, const int bits, X return 0; X } X X+#if 0 X #ifndef AES_ASM X /* X * Encrypt a single block X@@ -1312,3 +1313,4 @@ void AES_cbc_encrypt(const unsigned char *in, unsigned char *out, X } X } X } X+#endif 0f965046e3f0ae3f6ff2dcae29ab6a30 echo x - qemu-devel/files/patch-Makefile sed 's/^X//' >qemu-devel/files/patch-Makefile << '84dfd695309825a8b7c2b649e7e82e77' XIndex: qemu/Makefile X@@ -53,7 +53,11 @@ LIBS+=-lz $(LIBS_TOOLS) X HELPERS-$(CONFIG_LINUX) = qemu-bridge-helper$(EXESUF) X X ifdef BUILD_DOCS X+ifdef NOPORTDOCS X+DOCS=qemu.1 qemu-img.1 qemu-nbd.8 X+else X DOCS=qemu-doc.html qemu-tech.html qemu.1 qemu-img.1 qemu-nbd.8 QMP/qmp-commands.txt X+endif X ifdef CONFIG_VIRTFS X DOCS+=fsdev/virtfs-proxy-helper.1 X endif X@@ -311,8 +315,10 @@ endif X X install-doc: $(DOCS) X $(INSTALL_DIR) "$(DESTDIR)$(qemu_docdir)" X+ifndef NOPORTDOCS X $(INSTALL_DATA) qemu-doc.html qemu-tech.html "$(DESTDIR)$(qemu_docdir)" X $(INSTALL_DATA) QMP/qmp-commands.txt "$(DESTDIR)$(qemu_docdir)" X+endif X ifdef CONFIG_POSIX X $(INSTALL_DIR) "$(DESTDIR)$(mandir)/man1" X $(INSTALL_DATA) qemu.1 qemu-img.1 "$(DESTDIR)$(mandir)/man1" X@@ -331,7 +337,10 @@ install-confdir: X $(INSTALL_DIR) "$(DESTDIR)$(qemu_confdir)" X X install-sysconfig: install-datadir install-confdir X- $(INSTALL_DATA) $(SRC_PATH)/sysconfigs/target/target-x86_64.conf "$(DESTDIR)$(qemu_confdir)" X+ $(INSTALL_DATA) $(SRC_PATH)/sysconfigs/target/target-x86_64.conf "$(DESTDIR)$(qemu_confdir)/target-x86_64.conf.sample" X+ if [ ! -f "$(qemu_confdir)/target-x86_64.conf" ]; then \ X+ $(INSTALL_DATA) $(SRC_PATH)/sysconfigs/target/target-x86_64.conf "$(qemu_confdir)"; \ X+ fi X X install: all $(if $(BUILD_DOCS),install-doc) install-sysconfig install-datadir X $(INSTALL_DIR) "$(DESTDIR)$(bindir)" 84dfd695309825a8b7c2b649e7e82e77 echo x - qemu-devel/files/patch-bf sed 's/^X//' >qemu-devel/files/patch-bf << '3f590533f5abb97696ef7d1d2986b90e' XIndex: qemu/slirp/slirp_config.h X@@ -86,7 +86,7 @@ X #undef BAD_SPRINTF X X /* Define if you have readv */ X-#undef HAVE_READV X+#define HAVE_READV X X /* Define if iovec needs to be declared */ X #undef DECLARE_IOVEC X@@ -95,7 +95,7 @@ X #undef DECLARE_SPRINTF X X /* Define if you have a POSIX.1 sys/wait.h */ X-#undef HAVE_SYS_WAIT_H X+#define HAVE_SYS_WAIT_H X X /* Define if you have sys/select.h */ X #define HAVE_SYS_SELECT_H X@@ -107,7 +107,7 @@ X #define HAVE_ARPA_INET_H X X /* Define if you have sys/signal.h */ X-#undef HAVE_SYS_SIGNAL_H X+#define HAVE_SYS_SIGNAL_H X X /* Define if you have sys/stropts.h */ X #undef HAVE_SYS_STROPTS_H X@@ -180,7 +180,7 @@ X #undef HAVE_GRANTPT X X /* Define if you have fchmod */ X-#undef HAVE_FCHMOD X+#define HAVE_FCHMOD X X /* Define if you have */ X #undef HAVE_SYS_TYPES32_H 3f590533f5abb97696ef7d1d2986b90e echo x - qemu-devel/files/patch-bg sed 's/^X//' >qemu-devel/files/patch-bg << 'e1d0da9b7e9ede5e6fc04cf2dcbb2483' XIndex: qemu/include/net/net.h X@@ -174,8 +174,8 @@ void net_host_device_remove(Monitor *mon X int do_netdev_add(Monitor *mon, const QDict *qdict, QObject **ret_data); X int do_netdev_del(Monitor *mon, const QDict *qdict, QObject **ret_data); X X-#define DEFAULT_NETWORK_SCRIPT "/etc/qemu-ifup" X-#define DEFAULT_NETWORK_DOWN_SCRIPT "/etc/qemu-ifdown" X+#define DEFAULT_NETWORK_SCRIPT PREFIX "/etc/qemu-ifup" X+#define DEFAULT_NETWORK_DOWN_SCRIPT PREFIX "/etc/qemu-ifdown" X #define DEFAULT_BRIDGE_HELPER CONFIG_QEMU_HELPERDIR "/qemu-bridge-helper" X #define DEFAULT_BRIDGE_INTERFACE "br0" X XIndex: qemu/net/tap_int.h X@@ -29,8 +29,8 @@ X #include "qemu-common.h" X #include "qemu-option.h" X X-#define DEFAULT_NETWORK_SCRIPT "/etc/qemu-ifup" X-#define DEFAULT_NETWORK_DOWN_SCRIPT "/etc/qemu-ifdown" X+#define DEFAULT_NETWORK_SCRIPT PREFIX "/etc/qemu-ifup" X+#define DEFAULT_NETWORK_DOWN_SCRIPT PREFIX "/etc/qemu-ifdown" X X int net_init_tap(QemuOpts *opts, Monitor *mon, const char *name, VLANState *vlan); X e1d0da9b7e9ede5e6fc04cf2dcbb2483 echo x - qemu-devel/files/patch-bsd-user-8fix sed 's/^X//' >qemu-devel/files/patch-bsd-user-8fix << '4272980af8ea1e676fc4391b35da38c4' X--- a/bsd-user/freebsd/os-stat.c X+++ b/bsd-user/freebsd/os-stat.c X@@ -217,11 +217,15 @@ abi_long target_to_host_fcntl_cmd(int cm X case TARGET_F_RDAHEAD: X return F_RDAHEAD; X X+#ifdef F_DUPFD_CLOEXEC X case TARGET_F_DUPFD_CLOEXEC: X return F_DUPFD_CLOEXEC; X+#endif X X+#ifdef F_DUP2FD_CLOEXEC X case TARGET_F_DUP2FD_CLOEXEC: X return F_DUP2FD_CLOEXEC; X+#endif X X default: X return -TARGET_EINVAL; 4272980af8ea1e676fc4391b35da38c4 echo x - qemu-devel/files/patch-configure sed 's/^X//' >qemu-devel/files/patch-configure << '4b1fd297110c38b595108a3402834a36' X--- a/configure X+++ a/configure X@@ -154,7 +154,7 @@ bigendian="no" X mingw32="no" X EXESUF="" X prefix="/usr/local" X-mandir="\${prefix}/share/man" X+mandir="\${prefix}/man" X datadir="\${prefix}/share" X qemu_docdir="\${prefix}/share/doc/qemu" X bindir="\${prefix}/bin" X@@ -1756,7 +1756,7 @@ if test "$gtk" != "no"; then X gtk_libs=`$pkg_config --libs $gtkpackage 2>/dev/null` X vte_cflags=`$pkg_config --cflags $vtepackage 2>/dev/null` X vte_libs=`$pkg_config --libs $vtepackage 2>/dev/null` X- libs_softmmu="$gtk_libs $vte_libs $libs_softmmu" X+ libs_softmmu="$gtk_libs -lintl $vte_libs $libs_softmmu" X gtk="yes" X else X if test "$gtk" = "yes" ; then X@@ -2511,15 +2511,18 @@ if compile_prog "" "" ; then X fi X X # Check if tools are available to build documentation. X+#if test "$docs" != "no" ; then X+# if has makeinfo && has pod2man; then X+# docs=yes X+# else X+# if test "$docs" = "yes" ; then X+# feature_not_found "docs" X+# fi X+# docs=no X+# fi X+#fi X if test "$docs" != "no" ; then X- if has makeinfo && has pod2man; then X- docs=yes X- else X- if test "$docs" = "yes" ; then X- feature_not_found "docs" X- fi X- docs=no X- fi X+ docs=yes X fi X X # Search for bswap_32 function X@@ -3134,18 +3134,29 @@ fi X X # check for libusb X if test "$libusb" != "no" ; then X- if $pkg_config --atleast-version=1.0.13 libusb-1.0 >/dev/null 2>&1 ; then X- libusb="yes" X- usb="libusb" X- libusb_cflags=$($pkg_config --cflags libusb-1.0 2>/dev/null) X- libusb_libs=$($pkg_config --libs libusb-1.0 2>/dev/null) X- QEMU_CFLAGS="$QEMU_CFLAGS $libusb_cflags" X+ cat > $TMPC << EOF X+#include X+ X+int main(void) { return libusb_get_port_path(NULL, NULL, NULL, 0); } X+EOF X+ if compile_prog "-Werror" "-lusb" ; then X+ libusb_cflags="" X+ libusb_libs=-lusb X libs_softmmu="$libs_softmmu $libusb_libs" X else X- if test "$libusb" = "yes"; then X- feature_not_found "libusb" X+ if $pkg_config --atleast-version=1.0.13 libusb-1.0 >/dev/null 2>&1 ; then X+ libusb="yes" X+ usb="libusb" X+ libusb_cflags=$($pkg_config --cflags libusb-1.0 2>/dev/null) X+ libusb_libs=$($pkg_config --libs libusb-1.0 2>/dev/null) X+ QEMU_CFLAGS="$QEMU_CFLAGS $libusb_cflags" X+ libs_softmmu="$libs_softmmu $libusb_libs" X+ else X+ if test "$libusb" = "yes"; then X+ feature_not_found "libusb" X+ fi X+ libusb="no" X fi X- libusb="no" X fi X fi X 4b1fd297110c38b595108a3402834a36 echo x - qemu-devel/files/patch-hw-usb-host-libusb.c sed 's/^X//' >qemu-devel/files/patch-hw-usb-host-libusb.c << '17c99caef121bee8195690e4e5724313' X--- a/hw/usb/host-libusb.c X+++ b/hw/usb/host-libusb.c X@@ -1324,8 +1324,12 @@ static Property usb_host_dev_properties[ X DEFINE_PROP_UINT32("isobufs", USBHostDevice, iso_urb_count, 4), X DEFINE_PROP_UINT32("isobsize", USBHostDevice, iso_urb_frames, 32), X DEFINE_PROP_INT32("bootindex", USBHostDevice, bootindex, -1), X+#ifdef LIBUSB_LOG_LEVEL_WARNING X DEFINE_PROP_UINT32("loglevel", USBHostDevice, loglevel, X LIBUSB_LOG_LEVEL_WARNING), X+#else X+ DEFINE_PROP_UINT32("loglevel", USBHostDevice, loglevel, 0), X+#endif X DEFINE_PROP_BIT("pipeline", USBHostDevice, options, X USB_HOST_OPT_PIPELINE, true), X DEFINE_PROP_END_OF_LIST(), 17c99caef121bee8195690e4e5724313 echo x - qemu-devel/files/patch-qemu-doc.texi sed 's/^X//' >qemu-devel/files/patch-qemu-doc.texi << '0e74811c62d51065f3777e696c0ccf65' XIndex: qemu/qemu-doc.texi X@@ -985,7 +985,8 @@ X X @c man begin SEEALSO X The HTML documentation of QEMU for more precise information and Linux X-user mode emulator invocation. X+user mode emulator invocation, as well as the FreeBSD host notes in X+@file{pkg-message} in the relevant qemu port directory. X @c man end X X @c man begin AUTHOR 0e74811c62d51065f3777e696c0ccf65 echo x - qemu-devel/files/patch-tapclose sed 's/^X//' >qemu-devel/files/patch-tapclose << '1de0172b01bf928c302141c791630b05' XIndex: qemu/net/tap.c X@@ -286,12 +286,13 @@ static void tap_cleanup(NetClientState * X X qemu_purge_queued_packets(nc); X X- if (s->down_script[0]) X- launch_script(s->down_script, s->down_script_arg, s->fd); X- X tap_read_poll(s, false); X tap_write_poll(s, false); X close(s->fd); X+ X+ if (s->down_script[0]) X+ launch_script(s->down_script, s->down_script_arg, s->fd); X+ X s->fd = -1; X } X 1de0172b01bf928c302141c791630b05 echo x - qemu-devel/files/patch-tcg-i386-tcg-target.c sed 's/^X//' >qemu-devel/files/patch-tcg-i386-tcg-target.c << '3c3060cab0531d3f164bc1d5205e5d2e' X--- a/tcg/i386/tcg-target.c X+++ b/tcg/i386/tcg-target.c X@@ -104,6 +104,10 @@ static const int tcg_target_call_oarg_re X # define have_cmov 1 X #elif defined(CONFIG_CPUID_H) X #include X+#ifndef bit_CMOV X+/* clang's doesn't define bit_* */ X+#define bit_CMOV (1 << 15) X+#endif X static bool have_cmov; X #else X # define have_cmov 0 3c3060cab0531d3f164bc1d5205e5d2e echo x - qemu-devel/files/patch-ui-gtk.c sed 's/^X//' >qemu-devel/files/patch-ui-gtk.c << '07c6cebb3a709f1138548b506d985b9c' X--- a/ui/gtk.c X+++ b/ui/gtk.c X@@ -714,7 +718,11 @@ static gboolean gd_key_event(GtkWidget * X } else if (gdk_keycode < 97) { X qemu_keycode = gdk_keycode - 8; X } else if (gdk_keycode < 158) { X+#if 0 X qemu_keycode = translate_evdev_keycode(gdk_keycode - 97); X+#else X+ qemu_keycode = translate_xfree86_keycode(gdk_keycode - 97); X+#endif X } else if (gdk_keycode == 208) { /* Hiragana_Katakana */ X qemu_keycode = 0x70; X } else if (gdk_keycode == 211) { /* backslash */ 07c6cebb3a709f1138548b506d985b9c echo x - qemu-devel/files/patch-vl.c-serial sed 's/^X//' >qemu-devel/files/patch-vl.c-serial << 'bdfd643573fe671ff5248ba8068e80b4' XIndex: qemu/qemu-char.c X@@ -1606,10 +1606,13 @@ X cfsetospeed(&tty, spd); X X tty.c_iflag &= ~(IGNBRK|BRKINT|PARMRK|ISTRIP X- |INLCR|IGNCR|ICRNL|IXON); X- tty.c_oflag |= OPOST; X+ |INLCR|IGNCR|ICRNL|IXON|IMAXBEL); X+ tty.c_oflag &= ~OPOST; /* Don't do any output processing! */ X tty.c_lflag &= ~(ECHO|ECHONL|ICANON|IEXTEN|ISIG); X tty.c_cflag &= ~(CSIZE|PARENB|PARODD|CRTSCTS|CSTOPB); X+#ifdef __FreeBSD__ X+ cfmakeraw(&tty); X+#endif X switch(data_bits) { X default: X case 8: bdfd643573fe671ff5248ba8068e80b4 echo x - qemu-devel/files/patch-x_keymap.c sed 's/^X//' >qemu-devel/files/patch-x_keymap.c << '7a62da4b0802ab543e8e6376ba0a52ba' XIndex: qemu/ui/x_keymap.c X@@ -41,9 +41,9 @@ X 0xb5, /* 112 Divide */ X 0xb8, /* 113 Alt-R */ X 0xc6, /* 114 Break */ X- 0x0, /* 115 */ X- 0x0, /* 116 */ X- 0x0, /* 117 */ X+ 0xdb, /* 115 left windows key */ X+ 0xdc, /* 116 right windows key */ X+ 0xdd, /* 117 right menu key */ X 0x0, /* 118 */ X 0x0, /* 119 */ X 0x0, /* 120 */ 7a62da4b0802ab543e8e6376ba0a52ba echo x - qemu-devel/files/pcap-patch sed 's/^X//' >qemu-devel/files/pcap-patch << '081dd6a60e7cc75f202d76e31dfad7d9' X--- configure.orig X+++ configure X@@ -241,6 +241,9 @@ gtk="" X gtkabi="2.0" X tpm="no" X libssh2="" X+pcap="no" X+pcap_create="no" X+bpf="no" X X # parse CC options first X for opt do X@@ -748,6 +751,10 @@ for opt do X ;; X --enable-vnc-ws) vnc_ws="yes" X ;; X+ --enable-pcap) pcap="yes" X+ ;; X+ --disable-pcap) pcap="no" X+ ;; X --disable-slirp) slirp="no" X ;; X --disable-uuid) uuid="no" X@@ -1843,6 +1850,51 @@ EOF X fi X X ########################################## X+# pcap probe X+ X+if test "$pcap" = "yes" -a "$pcap" != "no"; then X+ cat > $TMPC << EOF X+#include X+int main(void) { return (pcap_lib_version() == (char *)0 ? 1 : 0); } X+EOF X+ if test "$mingw32" = "no" ; then X+ libpcap=-lpcap X+ else X+ libpcap=-lwpcap X+ fi X+ if compile_prog "$libpcap" ; then X+ : X+ else X+ echo X+ echo "Error: Could not find pcap" X+ echo "Make sure to have the pcap libs and headers installed." X+ echo X+ exit 1 X+ fi X+ cat > $TMPC << EOF X+#include X+int main(void) X+{ X+ char errbuf[PCAP_ERRBUF_SIZE]; X+ return (pcap_create("foo", errbuf) == (pcap_t *)0 ? 1 : 0); X+} X+EOF X+ if compile_prog "$libpcap" ; then X+ pcap_create="yes" X+ fi X+ cat > $TMPC << EOF X+#define PCAP_DONT_INCLUDE_PCAP_BPF_H X+#include X+#include X+int main(void) { return (BPF_MAJOR_VERSION); } X+EOF X+ if compile_prog ; then X+ bpf="yes" X+ fi X+ libs_softmmu="$libpcap $libs_softmmu" X+fi # test "$pcap" X+ X+########################################## X # VNC TLS/WS detection X if test "$vnc" = "yes" -a \( "$vnc_tls" != "no" -o "$vnc_ws" != "no" \) ; then X cat > $TMPC <> $config_host_mak X fi X+if test "$pcap" = "yes" ; then X+ echo "CONFIG_PCAP=y" >> $config_host_mak X+ if test "$pcap_create" = "yes" ; then X+ echo "CONFIG_PCAP_CREATE=y" >> $config_host_mak X+ fi X+ if test "$bpf" = "yes" ; then X+ echo "CONFIG_BPF=y" >> $config_host_mak X+ fi X+fi X if test "$slirp" = "yes" ; then X echo "CONFIG_SLIRP=y" >> $config_host_mak X echo "CONFIG_SMBD_COMMAND=\"$smbd\"" >> $config_host_mak XIndex: net/clients.h X@@ -47,6 +47,11 @@ int net_init_tap(const NetClientOptions X int net_init_bridge(const NetClientOptions *opts, const char *name, X NetClientState *peer); X X+#ifdef CONFIG_PCAP X+int net_init_pcap(const NetClientOptions *opts, const char *name, X+ NetClientState *peer); X+#endif X+ X #ifdef CONFIG_VDE X int net_init_vde(const NetClientOptions *opts, const char *name, X NetClientState *peer); XIndex: net/net.c X@@ -40,6 +40,11 @@ X #include "qapi/opts-visitor.h" X #include "qapi/dealloc-visitor.h" X X+#include X+#ifdef __FreeBSD__ X+#include X+#endif X+ X /* Net bridge is currently not supported for W32. */ X #if !defined(_WIN32) X # define CONFIG_NET_BRIDGE X@@ -704,6 +709,221 @@ static int net_init_nic(const NetClientO X return idx; X } X X+#if defined(CONFIG_PCAP) X+#if defined(CONFIG_BPF) X+#define PCAP_DONT_INCLUDE_PCAP_BPF_H X+#include X+#endif X+#include X+ X+struct PCAPState { X+ NetClientState nc; X+ pcap_t *handle; X+ int max_eth_frame_size; X+}; X+ X+static ssize_t pcap_receive(NetClientState *nc, const uint8_t *buf, size_t size) X+{ X+ struct PCAPState *s = DO_UPCAST(struct PCAPState, nc, nc); X+ X+ return pcap_inject(s->handle, (u_char*)buf, size); X+} X+ X+static void pcap_callback(u_char *user, struct pcap_pkthdr *phdr, u_char *pdata X+ ) X+{ X+ NetClientState *nc = (NetClientState *)user; X+ X+ int len = phdr->len; X+#ifdef __FreeBSD__ X+ struct PCAPState *s = DO_UPCAST(struct PCAPState, nc, nc); X+ int max_eth_frame_size = s->max_eth_frame_size; X+ X+ if (len > max_eth_frame_size) { X+ fprintf(stderr, X+ "pcap_send: packet size > %d (%d), truncating\n", X+ max_eth_frame_size, len); X+ len = max_eth_frame_size; X+ } X+#endif X+ qemu_send_packet(nc, pdata, len); X+} X+ X+static void pcap_send(void *opaque) X+{ X+ struct PCAPState *s = (struct PCAPState *)opaque; X+ X+ for (;;) { X+ if (pcap_dispatch(s->handle, 0, (pcap_handler)&pcap_callback, (u_char *)&s->nc) >= 0) X+ break; X+ } X+} X+ X+static void pcap_cleanup(NetClientState *nc) X+{ X+ struct PCAPState *s = DO_UPCAST(struct PCAPState, nc, nc); X+ X+ qemu_purge_queued_packets(nc); X+ pcap_close(s->handle); X+} X+ X+static NetClientInfo net_pcap_info = { X+ .type = NET_CLIENT_OPTIONS_KIND_PCAP, X+ .size = sizeof(struct PCAPState), X+ .receive = pcap_receive, X+// .receive_raw = pcap_receive_raw, X+// .receive_iov = pcap_receive_iov, X+// .poll = pcap_poll, X+ .cleanup = pcap_cleanup, X+}; X+/* X+ * ... -net pcap,ifname="..." X+ */ X+ X+int net_init_pcap(const NetClientOptions *opts, const char *name, NetClientState *peer) X+{ X+ const NetdevPcapOptions *pcap_opts = opts->pcap; X+ NetClientState *nc; X+ struct PCAPState *s; X+ const char *ifname; X+ char errbuf[PCAP_ERRBUF_SIZE]; X+#if defined(_WIN32) X+ HANDLE h; X+#endif X+ int i; X+ X+ if (!pcap_opts->has_ifname) X+ return -1; X+ X+ ifname = pcap_opts->ifname; X+ X+ /* create the object */ X+ nc = qemu_new_net_client(&net_pcap_info, peer, "pcap", ifname); X+ s = DO_UPCAST(struct PCAPState, nc, nc); X+ X+ if (ifname == NULL && (ifname = pcap_lookupdev(errbuf)) == NULL) { X+ fprintf(stderr, "qemu: pcap_create: %s\n", errbuf); X+ goto fail; X+ } X+ X+#ifdef __FreeBSD__ X+ /* X+ * We want to avoid passing oversize packets to the guest, which X+ * at least on FreeBSD can happen if the host interface uses tso X+ * (seen with an em(4) in this case) - so find out the host X+ * interface's mtu and assume the guest is configured the same. X+ */ X+ s->max_eth_frame_size = 1514; X+ i = socket(AF_INET, SOCK_DGRAM, 0); X+ if (i >= 0) { X+ struct ifreq ifr; X+ X+ (void) memset(&ifr, 0, sizeof(ifr)); X+ strncpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name)); X+ if (ioctl(i, SIOCGIFMTU, &ifr) != -1) X+ s->max_eth_frame_size = ifr.ifr_mtu + 14; X+ close(i); X+ } X+#endif X+ X+#if defined(CONFIG_PCAP_CREATE) || defined(_WIN32) X+ /* X+ * Create pcap handle for the device, set promiscuous mode and activate. X+ */ X+ s->handle = (void *)pcap_create(ifname, errbuf); X+ if (!s->handle) { X+ fprintf(stderr, "qemu: pcap_create: %s\n", errbuf); X+ goto fail; X+ } X+ if (pcap_set_promisc(s->handle, 1) != 0) { X+ pcap_perror(s->handle, (char *)"qemu: pcap_set_promisc:"); X+ goto fail; X+ } X+ if (pcap_activate(s->handle) != 0) { X+ pcap_perror(s->handle, (char *)"qemu: pcap_activate:"); X+ goto fail; X+ } X+#else X+ /* Attempt to connect device. */ X+ s->handle = (void *)pcap_open_live(ifname, 65535, 1, 0, errbuf); X+ if (!s->handle) { X+ fprintf(stderr, "qemu: pcap_open_live: %s\n", errbuf); X+ goto fail; X+ } X+#endif X+ X+ /* Set non-blocking mode. */ X+ if (pcap_setnonblock(s->handle, 1, errbuf) < 0) { X+ fprintf(stderr, "qemu: pcap_setnonblock: %s\n", errbuf); X+ goto fail; X+ } X+ X+#if defined(_WIN32) X+ /* X+ * Tell the kernel that the packet has to be seen immediately. X+ */ X+ if (pcap_setmintocopy(s->handle, 0) < 0) { X+ fprintf(stderr, "qemu: pcap failed to set immediate mode\n"); X+ goto fail; X+ } X+#else /* !_WIN32 */ X+#if defined(CONFIG_BPF) X+#if defined(BIOCIMMEDIATE) X+ /* X+ * Tell the kernel that the packet has to be seen immediately. X+ */ X+ { X+ unsigned int one = 1; X+ if (ioctl(pcap_fileno(s->handle), BIOCIMMEDIATE, &one) < 0) { X+ fprintf(stderr, "qemu: pcap failed to set immediate mode\n"); X+ goto fail; X+ } X+ } X+#endif /* BIOCIMMEDIATE */ X+#if defined(BIOCFEEDBACK) X+ /* X+ * Tell the kernel that the sent packet has to be fed back. X+ * This is necessary to connect host and guest. X+ */ X+ { X+ unsigned int one = 1; X+ if (ioctl(pcap_fileno(s->handle), BIOCFEEDBACK, &one) < 0) { X+ fprintf(stderr, "qemu: pcap failed to set feedback mode\n"); X+ goto fail; X+ } X+ } X+#endif /* BIOCFEEDBACK */ X+#endif /* CONFIG_BPF */ X+#endif /* _WIN32 */ X+ X+ snprintf(s->nc.info_str, sizeof(s->nc.info_str), "pcap redirector"); X+ X+#if defined(_WIN32) X+ if ((h = pcap_getevent(s->handle)) == NULL) { X+ fprintf(stderr, "qemu: pcap_getevent failed\n"); X+ goto fail; X+ } X+ qemu_add_wait_object(h, pcap_send, s); X+#else /* !_WIN32 */ X+ if ((i = pcap_get_selectable_fd(s->handle)) < 0) { X+ fprintf(stderr, "qemu: pcap_get_selectable_fd failed\n"); X+ goto fail; X+ } X+ qemu_set_fd_handler(i, pcap_send, NULL, s); X+#endif /* _WIN32 */ X+ X+ return 0; X+ X+fail: X+ if (s) { X+ if (s->handle) X+ pcap_close(s->handle); X+ } X+ X+ return -1; X+} X+ X+#endif X X static int (* const net_client_init_fun[NET_CLIENT_OPTIONS_KIND_MAX])( X const NetClientOptions *opts, X@@ -722,6 +944,9 @@ static int (* const net_client_init_fun[ X #ifdef CONFIG_NET_BRIDGE X [NET_CLIENT_OPTIONS_KIND_BRIDGE] = net_init_bridge, X #endif X+#ifdef CONFIG_PCAP X+ [NET_CLIENT_OPTIONS_KIND_PCAP] = net_init_pcap, X+#endif X [NET_CLIENT_OPTIONS_KIND_HUBPORT] = net_init_hubport, X }; X X--- qapi-schema.json.orig X+++ qapi-schema.json X@@ -2622,6 +2622,10 @@ X '*br': 'str', X '*helper': 'str' } } X X+{ 'type': 'NetdevPcapOptions', X+ 'data': { X+ '*ifname': 'str' } } X+ X ## X # @NetdevHubPortOptions X # X@@ -2648,6 +2652,7 @@ X 'nic': 'NetLegacyNicOptions', X 'user': 'NetdevUserOptions', X 'tap': 'NetdevTapOptions', X+ 'pcap': 'NetdevPcapOptions', X 'socket': 'NetdevSocketOptions', X 'vde': 'NetdevVdeOptions', X 'dump': 'NetdevDumpOptions', X--- net/hub.c.orig X+++ net/hub.c X@@ -322,6 +322,7 @@ void net_hub_check_clients(void) X case NET_CLIENT_OPTIONS_KIND_TAP: X case NET_CLIENT_OPTIONS_KIND_SOCKET: X case NET_CLIENT_OPTIONS_KIND_VDE: X+ case NET_CLIENT_OPTIONS_KIND_PCAP: X has_host_dev = 1; X break; X default: 081dd6a60e7cc75f202d76e31dfad7d9 echo x - qemu-devel/files/qemu-ifdown.sample sed 's/^X//' >qemu-devel/files/qemu-ifdown.sample << 'c5610f3ee4253c789af1c99e526e3467' X#!/bin/sh Xexec true c5610f3ee4253c789af1c99e526e3467 echo x - qemu-devel/files/qemu-ifup.sample sed 's/^X//' >qemu-devel/files/qemu-ifup.sample << 'cf66960d5c644b03896af578336bf752' X#!/bin/sh Xexec true cf66960d5c644b03896af578336bf752 exit