Index: head/emulators/qemu-devel/Makefile =================================================================== --- head/emulators/qemu-devel/Makefile (revision 405026) +++ head/emulators/qemu-devel/Makefile (revision 405027) @@ -1,270 +1,204 @@ # Created by: Juergen Lock # $FreeBSD$ PORTNAME= qemu -PORTVERSION= 2.4.0 +DISTVERSION= 2.5.0 CATEGORIES= emulators -MASTER_SITES= http://wiki.qemu.org/download/:release \ - LOCAL/nox:snapshot -PKGNAMESUFFIX?= -devel -DISTFILES= ${DISTNAME}${EXTRACT_SUFX}:release -DIST_SUBDIR= qemu/${PORTVERSION} +MASTER_SITES= http://wiki.qemu.org/download/ +PKGNAMESUFFIX= -devel -MAINTAINER= ports@FreeBSD.org -COMMENT?= QEMU CPU Emulator - development version +MAINTAINER= bofh@FreeBSD.org +COMMENT= QEMU CPU Emulator - development version +LICENSE= GPLv2 + HAS_CONFIGURE= yes USES= cpe gmake pkgconfig bison perl5 python:2,build tar:bzip2 USE_PERL5= build USE_XORG= pixman USE_GNOME+= glib20 -PATCH_STRIP= -p1 MAKE_ENV+= BSD_MAKE="${MAKE}" ONLY_FOR_ARCHS= amd64 i386 powerpc powerpc64 # XXX someone wants to debug sparc64 hosts? OPTIONS_DEFINE= SAMBA X11 GTK2 OPENGL GNUTLS SASL JPEG PNG CURL \ CDROM_DMA PCAP USBREDIR GNS3 X86_TARGETS \ - STATIC_LINK DOCS + STATIC_LINK DOCS BSD_USER SAMBA_DESC= samba dependency (for -smb) GNUTLS_DESC= gnutls dependency (vnc encryption) SASL_DESC= cyrus-sasl dependency (vnc encryption) JPEG_DESC= jpeg dependency (vnc lossy compression) PNG_DESC= png dependency (vnc compression) CDROM_DMA_DESC= IDE CDROM DMA PCAP_DESC= pcap dependency (networking with bpf) USBREDIR_DESC= usb device network redirection (experimental!) GNS3_DESC= gns3 patches (promiscuous multicast) X86_TARGETS_DESC= Don't build non-x86 system targets BSD_USER_DESC= Also build bsd-user targets (for testing) STATIC_LINK_DESC= Statically link the executables -OPTIONS_DEFAULT=X11 GTK2 OPENGL GNUTLS SASL JPEG PNG CDROM_DMA CURL PCAP +OPTIONS_DEFAULT=X11 GTK2 OPENGL GNUTLS SASL JPEG PNG CDROM_DMA CURL PCAP GNS3 +OPTIONS_SUB= yes +X11_USE= SDL=sdl +X11_CONFIGURE_ON= --enable-sdl +X11_CONFIGURE_OFF= --disable-sdl +GTK2_USE= GNOME=gtk20,vte +GTK2_USES= gettext +GTK2_CONFIGURE_OFF= --disable-gtk --disable-vte +GNUTLS_LIB_DEPENDS= libgnutls.so:${PORTSDIR}/security/gnutls +GNUTLS_CONFIGURE_OFF= --disable-vnc-tls +SASL_LIB_DEPENDS= libsasl2.so:${PORTSDIR}/security/cyrus-sasl2 +SASL_CONFIGURE_OFF= --disable-vnc-sasl +JPEG_USES= jpeg +JPEG_CONFIGURE_OFF= --disable-vnc-jpeg +PNG_LIB_DEPENDS= libpng.so:${PORTSDIR}/graphics/png +PNG_CONFIGURE_OFF= --disable-vnc-png +CURL_LIB_DEPENDS= libcurl.so:${PORTSDIR}/ftp/curl +CURL_CONFIGURE_OFF= --disable-curl +OPENGL_USE= GL=yes +OPENGL_CONFIGURE_OFF= --disable-opengl +USBREDIR_BUILD_DEPENDS= usbredir>=0.6:${PORTSDIR}/net/usbredir +USBREDIR_RUN_DEPENDS= usbredir>=0.6:${PORTSDIR}/net/usbredir +USBREDIR_CONFIGURE_OFF= --disable-usb-redir +PCAP_CONFIGURE_ON= --enable-pcap +PCAP_CONFIGURE_OFF= --disable-pcap +STATIC_LINK_CONFIGURE_ON= --static +SAMBA_RUN_DEPENDS= ${LOCALBASE}/sbin/smbd:${PORTSDIR}/net/samba36 +DOCS_BUILD_DEPENDS= texi2html:${PORTSDIR}/textproc/texi2html +DOCS_USES= makeinfo +DOCS_MAKE_ARGS_OFF= NOPORTDOCS=1 + .if !defined(QEMU_USER_STATIC) -CONFLICTS_INSTALL= qemu-[0-9]* qemu-sbruno-[0-9]* +CONFLICTS_INSTALL= qemu--devel-[0-9]* qemu-sbruno-[0-9]* .endif -.include - -CONFIGURE_ARGS+= --localstatedir=/var -CONFIGURE_ARGS+= --extra-ldflags=-L\"${LOCALBASE}/lib\" -CONFIGURE_ARGS+= --disable-smartcard-nss --disable-libssh2 PORTDOCS= docs qemu-doc.html qemu-tech.html qmp-commands.txt +WITHOUT_CPU_CFLAGS=yes #to avoid problems with register allocation +CFLAGS:= ${CFLAGS:C/-fno-tree-vrp//} +CONFIGURE_ARGS+=--localstatedir=/var --extra-ldflags=-L\"${LOCALBASE}/lib\" \ + --disable-libssh2 --enable-debug \ + --prefix=${PREFIX} --cc=${CC} --enable-docs --disable-kvm \ + --disable-linux-user --disable-linux-aio --disable-xen \ + --smbd=${LOCALBASE}/sbin/smbd --enable-debug-info --python=${PYTHON_CMD} \ + --extra-cflags=-I${WRKSRC}\ -I${LOCALBASE}/include\ -DPREFIX=\\\"\"${PREFIX}\\\"\" + +.include + .if defined(QEMU_USER_STATIC) .if ${ARCH} != "amd64" CONFIGURE_ARGS+= --target-list=i386-bsd-user,sparc-bsd-user,arm-bsd-user,mips-bsd-user,mipsel-bsd-user .else CONFIGURE_ARGS+= --target-list=i386-bsd-user,x86_64-bsd-user,sparc-bsd-user,sparc64-bsd-user,arm-bsd-user,mips-bsd-user,mipsel-bsd-user,mips64-bsd-user,mips64el-bsd-user .endif .else .if ${PORT_OPTIONS:MX86_TARGETS} .if ${PORT_OPTIONS:MBSD_USER} .if ${ARCH} != "amd64" CONFIGURE_ARGS+= --target-list=i386-softmmu,x86_64-softmmu,i386-bsd-user,sparc-bsd-user,arm-bsd-user,mips-bsd-user,mipsel-bsd-user .else CONFIGURE_ARGS+= --target-list=i386-softmmu,x86_64-softmmu,i386-bsd-user,x86_64-bsd-user,sparc-bsd-user,sparc64-bsd-user,arm-bsd-user,mips-bsd-user,mipsel-bsd-user,mips64-bsd-user,mips64el-bsd-user .endif .else CONFIGURE_ARGS+= --target-list=i386-softmmu,x86_64-softmmu .endif .else .if empty(PORT_OPTIONS:MBSD_USER) CONFIGURE_ARGS+= --disable-bsd-user .else .if ${ARCH} != "amd64" CONFIGURE_ARGS+= --target-list=i386-softmmu,x86_64-softmmu,aarch64-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,mips-bsd-user,mipsel-bsd-user .endif .endif .endif .endif -.if empty(PORT_OPTIONS:MBSD_USER) -PLIST_SUB+= BSD_USER="@comment " -.else -PLIST_SUB+= BSD_USER="" -.if ${ARCH} == "sparc64" -IGNORE= bsd-user targets not tested on sparc64 +.if ${PORT_OPTIONS:MBSD_USER} && ${ARCH} == "sparc64" +IGNORE= bsd-user targets not tested on sparc64 .endif -.endif + .if empty(PORT_OPTIONS:MBSD_USER) || ${ARCH} != "amd64" PLIST_SUB+= BSD_USER64="@comment " .else PLIST_SUB+= BSD_USER64="" .endif -.if ${PORT_OPTIONS:MX86_TARGETS} -PLIST_SUB+= NONX86="@comment " -.else -PLIST_SUB+= NONX86="" -.endif - .if defined(QEMU_USER_STATIC) -PLIST_SUB+= SOFTMMU="@comment " -PLIST_SUB+= STATIC="-static" +PLIST_SUB+= SOFTMMU="@comment " STATIC="-static" .else -PLIST_SUB+= SOFTMMU="" -PLIST_SUB+= STATIC="" +PLIST_SUB+= SOFTMMU="" STATIC="" .endif -.if ${PORT_OPTIONS:MGNS3} -EXTRA_PATCHES+= ${FILESDIR}/hw_e1000_c.patch -.endif - -WITHOUT_CPU_CFLAGS=yes #to avoid problems with register allocation -CFLAGS:= ${CFLAGS:C/-fno-tree-vrp//} -CONFIGURE_ARGS+= --prefix=${PREFIX} --cc=${CC} --enable-docs \ - --disable-linux-user --disable-linux-aio \ - --disable-kvm --disable-xen \ - --smbd=${LOCALBASE}/sbin/smbd \ - --enable-debug \ - --enable-debug-info \ - --extra-cflags=-I${WRKSRC}\ -I${LOCALBASE}/include\ -DPREFIX=\\\"\"${PREFIX}\\\"\" - -.if empty(PORT_OPTIONS:MX11) -CONFIGURE_ARGS+= --disable-sdl -.else -CONFIGURE_ARGS+= --enable-sdl -USE_SDL= sdl -.endif - -.if empty(PORT_OPTIONS:MGTK2) -CONFIGURE_ARGS+= --disable-gtk --disable-vte -PLIST_SUB+= GTK2="@comment " -.else -USE_GNOME+= gtk20 vte -USES+= gettext -PLIST_SUB+= GTK2="" -.endif - -.if empty(PORT_OPTIONS:MGNUTLS) -CONFIGURE_ARGS+= --disable-vnc-tls -.else -LIB_DEPENDS+= libgnutls.so:${PORTSDIR}/security/gnutls -.endif - -.if empty(PORT_OPTIONS:MSASL) -CONFIGURE_ARGS+= --disable-vnc-sasl -.else -LIB_DEPENDS+= libsasl2.so:${PORTSDIR}/security/cyrus-sasl2 -.endif - -.if empty(PORT_OPTIONS:MJPEG) -CONFIGURE_ARGS+= --disable-vnc-jpeg -.else -USES+= jpeg -.endif - -.if empty(PORT_OPTIONS:MPNG) -CONFIGURE_ARGS+= --disable-vnc-png -.else -LIB_DEPENDS+= libpng.so:${PORTSDIR}/graphics/png -.endif - -.if empty(PORT_OPTIONS:MCURL) -CONFIGURE_ARGS+= --disable-curl -.else -LIB_DEPENDS+= libcurl.so:${PORTSDIR}/ftp/curl -.endif - -.if empty(PORT_OPTIONS:MOPENGL) -CONFIGURE_ARGS+= --disable-opengl -.else -USE_GL= yes -.endif - -.if empty(PORT_OPTIONS:MUSBREDIR) -CONFIGURE_ARGS+= --disable-usb-redir -.else -BUILD_DEPENDS+= usbredir>=0.6:${PORTSDIR}/net/usbredir -RUN_DEPENDS+= usbredir>=0.6:${PORTSDIR}/net/usbredir -.endif - -.if ${PORT_OPTIONS:MPCAP} -CONFIGURE_ARGS+= --enable-pcap -.endif - -.if ${PORT_OPTIONS:MSTATIC_LINK} -.if ${PORT_OPTIONS:MGTK2} || ${PORT_OPTIONS:MX11} +.if ${PORT_OPTIONS:MSTATIC_LINK} && (${PORT_OPTIONS:MGTK2} || ${PORT_OPTIONS:MX11}) IGNORE= X11 ui cannot be built static .endif -CONFIGURE_ARGS+= --static -.endif -.if ${PORT_OPTIONS:MSAMBA} -RUN_DEPENDS+= ${LOCALBASE}/sbin/smbd:${PORTSDIR}/net/samba36 -.endif - -.if ${PORT_OPTIONS:MDOCS} -BUILD_DEPENDS+= texi2html:${PORTSDIR}/textproc/texi2html -USES+= makeinfo -.else -MAKE_ARGS+= NOPORTDOCS=1 -.endif - .if !defined(STRIP) || ${STRIP} == "" CONFIGURE_ARGS+=--disable-strip .endif .if ${ARCH} == "amd64" MAKE_ARGS+= ARCH=x86_64 .endif .if ${ARCH} == "powerpc" MAKE_ARGS+= ARCH=ppc .endif .if ${ARCH} == "powerpc64" MAKE_ARGS+= ARCH=ppc64 .endif .if ${ARCH} == "sparc64" -CONFIGURE_ARGS+= --sparc_cpu=v9 +CONFIGURE_ARGS+= --sparc_cpu=v9 .endif -CONFIGURE_ARGS+= --python=${PYTHON_CMD} - # -lprocstat actually only _needs_ -lelf after r249666 or r250870 (MFC) # but it shouldn't matter much post-patch: @${REINPLACE_CMD} -e '/LIBS/s|-lprocstat|-lprocstat -lelf|' \ ${WRKSRC}/configure @${REINPLACE_CMD} -e '/libs_qga=/s|glib_libs|glib_libs -lintl|' ${WRKSRC}/configure -.if ${PORT_OPTIONS:MPCAP} - @cd ${WRKSRC} && ${PATCH} --quiet < ${FILESDIR}/pcap-patch -.endif -.if empty(PORT_OPTIONS:MCDROM_DMA) - @cd ${WRKSRC} && ${PATCH} --quiet < ${FILESDIR}/cdrom-dma-patch -.endif @${REINPLACE_CMD} -E \ -e "/^by Tibor .TS. S/s|Sch.*z.$$|Schuetz.|" \ ${WRKSRC}/qemu-doc.texi @${REINPLACE_CMD} -E \ -e "s|^(CFLAGS=).*|\1${CFLAGS} -fno-strict-aliasing|" \ -e "s|^(LDFLAGS=).*|\1${LDFLAGS}|" \ ${WRKSRC}/Makefile.target @${REINPLACE_CMD} -E \ -e "s|^(CFLAGS=).*|\1${CFLAGS} -fno-strict-aliasing -I.|" \ -e "s|^(LDFLAGS=).*|\1${LDFLAGS}|" \ ${WRKSRC}/Makefile @${REINPLACE_CMD} -E \ -e "1s|^(#! )/usr/bin/perl|\1${PERL}|" \ ${WRKSRC}/scripts/texi2pod.pl +post-patch-CDROM_DMA-off: + @${REINPLACE_CMD} -e '/USE_DMA_CDROM/d' ${WRKSRC}/hw/ide/internal.h + +post-patch-GNS3-on: + @${REINPLACE_CMD} -e 's|(buf\[0\] & 1) && (rctl & E1000_RCTL_MPE)|buf[0] \& 1|' \ + ${WRKSRC}/hw/net/e1000.c + +post-patch-PCAP-on: + @cd ${WRKSRC} && ${PATCH} --quiet < ${FILESDIR}/pcap-patch + # XXX need to disable usb host code on head while it's not ported to the # new usb stack yet post-configure: @${REINPLACE_CMD} -E \ -e "s|^(HOST_USB=)bsd|\1stub|" \ ${WRKSRC}/config-host.mak .if !target(post-install) post-install: -.if ${PORT_OPTIONS:MDOCS} - @(cd ${WRKSRC} && ${COPYTREE_SHARE} docs ${STAGEDIR}${DOCSDIR}/) -.endif ${INSTALL_SCRIPT} ${FILESDIR}/qemu-ifup.sample ${STAGEDIR}${PREFIX}/etc ${INSTALL_SCRIPT} ${FILESDIR}/qemu-ifdown.sample ${STAGEDIR}${PREFIX}/etc @${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/qemu-* + @${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/ivshmem-* + +post-install-DOCS-on: + @(cd ${WRKSRC} && ${COPYTREE_SHARE} docs ${STAGEDIR}${DOCSDIR}/) .endif .include Index: head/emulators/qemu-devel/distinfo =================================================================== --- head/emulators/qemu-devel/distinfo (revision 405026) +++ head/emulators/qemu-devel/distinfo (revision 405027) @@ -1,2 +1,2 @@ -SHA256 (qemu/2.4.0/qemu-2.4.0.tar.bz2) = 72b0b991bbcc540663a019e1e8c4f714053b691dda32c9b9ee80b25f367e6620 -SIZE (qemu/2.4.0/qemu-2.4.0.tar.bz2) = 25070979 +SHA256 (qemu-2.5.0.tar.bz2) = 3443887401619fe33bfa5d900a4f2d6a79425ae2b7e43d5b8c36eb7a683772d4 +SIZE (qemu-2.5.0.tar.bz2) = 25464996 Index: head/emulators/qemu-devel/files/patch-qemu-include-net-net.h =================================================================== --- head/emulators/qemu-devel/files/patch-qemu-include-net-net.h (revision 405026) +++ head/emulators/qemu-devel/files/patch-qemu-include-net-net.h (nonexistent) @@ -1,12 +0,0 @@ -Index: qemu/include/net/net.h -@@ -174,8 +174,8 @@ void net_host_device_remove(Monitor *mon - int do_netdev_add(Monitor *mon, const QDict *qdict, QObject **ret_data); - int do_netdev_del(Monitor *mon, const QDict *qdict, QObject **ret_data); - --#define DEFAULT_NETWORK_SCRIPT "/etc/qemu-ifup" --#define DEFAULT_NETWORK_DOWN_SCRIPT "/etc/qemu-ifdown" -+#define DEFAULT_NETWORK_SCRIPT PREFIX "/etc/qemu-ifup" -+#define DEFAULT_NETWORK_DOWN_SCRIPT PREFIX "/etc/qemu-ifdown" - #define DEFAULT_BRIDGE_HELPER CONFIG_QEMU_HELPERDIR "/qemu-bridge-helper" - #define DEFAULT_BRIDGE_INTERFACE "br0" - Property changes on: head/emulators/qemu-devel/files/patch-qemu-include-net-net.h ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/emulators/qemu-devel/files/cdrom-dma-patch =================================================================== --- head/emulators/qemu-devel/files/cdrom-dma-patch (revision 405026) +++ head/emulators/qemu-devel/files/cdrom-dma-patch (nonexistent) @@ -1,10 +0,0 @@ -Index: hw/ide/internal.h -@@ -27,7 +27,7 @@ - //#define DEBUG_IDE - //#define DEBUG_IDE_ATAPI - //#define DEBUG_AIO --#define USE_DMA_CDROM -+// #define USE_DMA_CDROM - - /* Bits of HD_STATUS */ - #define ERR_STAT 0x01 Property changes on: head/emulators/qemu-devel/files/cdrom-dma-patch ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/emulators/qemu-devel/files/patch-qemu-slirp-slirp_config.h =================================================================== --- head/emulators/qemu-devel/files/patch-qemu-slirp-slirp_config.h (revision 405026) +++ head/emulators/qemu-devel/files/patch-qemu-slirp-slirp_config.h (nonexistent) @@ -1,37 +0,0 @@ -Index: qemu/slirp/slirp_config.h -@@ -86,7 +86,7 @@ - #undef BAD_SPRINTF - - /* Define if you have readv */ --#undef HAVE_READV -+#define HAVE_READV - - /* Define if iovec needs to be declared */ - #undef DECLARE_IOVEC -@@ -95,7 +95,7 @@ - #undef DECLARE_SPRINTF - - /* Define if you have a POSIX.1 sys/wait.h */ --#undef HAVE_SYS_WAIT_H -+#define HAVE_SYS_WAIT_H - - /* Define if you have sys/select.h */ - #define HAVE_SYS_SELECT_H -@@ -107,7 +107,7 @@ - #define HAVE_ARPA_INET_H - - /* Define if you have sys/signal.h */ --#undef HAVE_SYS_SIGNAL_H -+#define HAVE_SYS_SIGNAL_H - - /* Define if you have sys/stropts.h */ - #undef HAVE_SYS_STROPTS_H -@@ -180,7 +180,7 @@ - #undef HAVE_GRANTPT - - /* Define if you have fchmod */ --#undef HAVE_FCHMOD -+#define HAVE_FCHMOD - - /* Define if you have */ - #undef HAVE_SYS_TYPES32_H Property changes on: head/emulators/qemu-devel/files/patch-qemu-slirp-slirp_config.h ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/emulators/qemu-devel/files/patch-vl.c-serial =================================================================== --- head/emulators/qemu-devel/files/patch-vl.c-serial (revision 405026) +++ head/emulators/qemu-devel/files/patch-vl.c-serial (nonexistent) @@ -1,17 +0,0 @@ -Index: qemu/qemu-char.c -@@ -1606,10 +1606,13 @@ - cfsetospeed(&tty, spd); - - tty.c_iflag &= ~(IGNBRK|BRKINT|PARMRK|ISTRIP -- |INLCR|IGNCR|ICRNL|IXON); -- tty.c_oflag |= OPOST; -+ |INLCR|IGNCR|ICRNL|IXON|IMAXBEL); -+ tty.c_oflag &= ~OPOST; /* Don't do any output processing! */ - tty.c_lflag &= ~(ECHO|ECHONL|ICANON|IEXTEN|ISIG); - tty.c_cflag &= ~(CSIZE|PARENB|PARODD|CRTSCTS|CSTOPB); -+#ifdef __FreeBSD__ -+ cfmakeraw(&tty); -+#endif - switch(data_bits) { - default: - case 8: Property changes on: head/emulators/qemu-devel/files/patch-vl.c-serial ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/emulators/qemu-devel/files/hw_e1000_c.patch =================================================================== --- head/emulators/qemu-devel/files/hw_e1000_c.patch (revision 405026) +++ head/emulators/qemu-devel/files/hw_e1000_c.patch (nonexistent) @@ -1,11 +0,0 @@ ---- qemu-0.14.1/hw/net/e1000.c.orig -+++ qemu-0.14.1/hw/net/e1000.c -@@ -573,7 +573,7 @@ - if (rctl & E1000_RCTL_UPE) // promiscuous - return 1; - -- if ((buf[0] & 1) && (rctl & E1000_RCTL_MPE)) // promiscuous mcast -+ if (buf[0] & 1) // promiscuous mcast - return 1; - - if ((rctl & E1000_RCTL_BAM) && !memcmp(buf, bcast, sizeof bcast)) Property changes on: head/emulators/qemu-devel/files/hw_e1000_c.patch ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/emulators/qemu-devel/files/patch-include-qemu-common.h =================================================================== --- head/emulators/qemu-devel/files/patch-include-qemu-common.h (revision 405026) +++ head/emulators/qemu-devel/files/patch-include-qemu-common.h (nonexistent) @@ -1,12 +0,0 @@ ---- a/include/qemu-common.h -+++ b/include/qemu-common.h -@@ -445,7 +445,9 @@ void qemu_hexdump(const char *buf, FILE - #define ALL_EQ(v1, v2) vec_all_eq(v1, v2) - /* altivec.h may redefine the bool macro as vector type. - * Reset it to POSIX semantics. */ -+#ifndef __cplusplus - #define bool _Bool -+#endif - #elif defined __SSE2__ - #include - #define VECTYPE __m128i Property changes on: head/emulators/qemu-devel/files/patch-include-qemu-common.h ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/emulators/qemu-devel/files/patch-disas-libvixl-a64-disasm-a64.cc =================================================================== --- head/emulators/qemu-devel/files/patch-disas-libvixl-a64-disasm-a64.cc (revision 405026) +++ head/emulators/qemu-devel/files/patch-disas-libvixl-a64-disasm-a64.cc (nonexistent) @@ -1,12 +0,0 @@ ---- a/disas/libvixl/a64/disasm-a64.cc -+++ b/disas/libvixl/a64/disasm-a64.cc -@@ -1337,7 +1337,8 @@ void Disassembler::AppendPCRelativeOffse - int64_t offset) { - USE(instr); - char sign = (offset < 0) ? '-' : '+'; -- AppendToOutput("#%c0x%" PRIx64, sign, std::abs(offset)); -+ // AppendToOutput("#%c0x%" PRIx64, sign, std::abs(offset)); -+ AppendToOutput("#%c0x%" PRIx64, sign, offset < 0 ? -offset : offset); - } - - Property changes on: head/emulators/qemu-devel/files/patch-disas-libvixl-a64-disasm-a64.cc ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/emulators/qemu-devel/files/patch-net-tap-bsd.c =================================================================== --- head/emulators/qemu-devel/files/patch-net-tap-bsd.c (revision 405026) +++ head/emulators/qemu-devel/files/patch-net-tap-bsd.c (nonexistent) @@ -1,10 +0,0 @@ ---- a/net/tap-bsd.c -+++ b/net/tap-bsd.c -@@ -29,6 +29,7 @@ - - #if defined(__NetBSD__) || defined(__FreeBSD__) - #include -+#include - #include - #include - #endif Property changes on: head/emulators/qemu-devel/files/patch-net-tap-bsd.c ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/emulators/qemu-devel/files/patch-x_keymap.c =================================================================== --- head/emulators/qemu-devel/files/patch-x_keymap.c (revision 405026) +++ head/emulators/qemu-devel/files/patch-x_keymap.c (nonexistent) @@ -1,14 +0,0 @@ -Index: qemu/ui/x_keymap.c -@@ -41,9 +41,9 @@ - 0xb5, /* 112 Divide */ - 0xb8, /* 113 Alt-R */ - 0xc6, /* 114 Break */ -- 0x0, /* 115 */ -- 0x0, /* 116 */ -- 0x0, /* 117 */ -+ 0xdb, /* 115 left windows key */ -+ 0xdc, /* 116 right windows key */ -+ 0xdd, /* 117 right menu key */ - 0x0, /* 118 */ - 0x0, /* 119 */ - 0x0, /* 120 */ Property changes on: head/emulators/qemu-devel/files/patch-x_keymap.c ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/emulators/qemu-devel/files/patch-Makefile =================================================================== --- head/emulators/qemu-devel/files/patch-Makefile (revision 405026) +++ head/emulators/qemu-devel/files/patch-Makefile (revision 405027) @@ -1,25 +1,25 @@ ---- Makefile.orig +--- Makefile.orig 2015-12-16 20:32:52 UTC +++ Makefile -@@ -83,7 +83,11 @@ LIBS+=-lz $(LIBS_TOOLS) +@@ -90,7 +90,11 @@ LIBS+=-lz $(LIBS_TOOLS) HELPERS-$(CONFIG_LINUX) = qemu-bridge-helper$(EXESUF) ifdef BUILD_DOCS +ifdef NOPORTDOCS +DOCS=qemu.1 qemu-img.1 qemu-nbd.8 +else - DOCS=qemu-doc.html qemu-tech.html qemu.1 qemu-img.1 qemu-nbd.8 qmp-commands.txt + DOCS=qemu-doc.html qemu-tech.html qemu.1 qemu-img.1 qemu-nbd.8 qemu-ga.8 +endif + DOCS+=qmp-commands.txt ifdef CONFIG_LINUX DOCS+=kvm_stat.1 - endif -@@ -362,8 +366,10 @@ endif +@@ -407,8 +411,10 @@ endif install-doc: $(DOCS) $(INSTALL_DIR) "$(DESTDIR)$(qemu_docdir)" +ifndef NOPORTDOCS $(INSTALL_DATA) qemu-doc.html qemu-tech.html "$(DESTDIR)$(qemu_docdir)" $(INSTALL_DATA) qmp-commands.txt "$(DESTDIR)$(qemu_docdir)" +endif ifdef CONFIG_POSIX $(INSTALL_DIR) "$(DESTDIR)$(mandir)/man1" $(INSTALL_DATA) qemu.1 "$(DESTDIR)$(mandir)/man1" Index: head/emulators/qemu-devel/files/patch-configure =================================================================== --- head/emulators/qemu-devel/files/patch-configure (revision 405026) +++ head/emulators/qemu-devel/files/patch-configure (revision 405027) @@ -1,73 +1,61 @@ ---- a/configure -+++ a/configure -@@ -273,7 +273,7 @@ DSOSUF=".so" +--- configure.orig 2015-12-16 20:50:32 UTC ++++ configure +@@ -276,7 +276,7 @@ DSOSUF=".so" LDFLAGS_SHARED="-shared" modules="no" prefix="/usr/local" -mandir="\${prefix}/share/man" +mandir="\${prefix}/man" datadir="\${prefix}/share" qemu_docdir="\${prefix}/share/doc/qemu" bindir="\${prefix}/bin" -@@ -2062,7 +2062,7 @@ if test "$gtk" != "no"; then - if $pkg_config --exists "$gtkx11package >= $gtkversion"; then - gtk_libs="$gtk_libs -lX11" +@@ -2241,7 +2241,7 @@ if test "$gtk" != "no"; then + gtk_cflags="$gtk_cflags $x11_cflags" + gtk_libs="$gtk_libs $x11_libs" fi - libs_softmmu="$gtk_libs $libs_softmmu" + libs_softmmu="$gtk_libs -lintl $libs_softmmu" gtk="yes" elif test "$gtk" = "yes"; then feature_not_found "gtk" "Install gtk2 or gtk3 devel" -@@ -3500,15 +3500,18 @@ if compile_prog "" "" ; then - fi +@@ -3864,14 +3864,7 @@ fi # Check if tools are available to build documentation. -+#if test "$docs" != "no" ; then -+# if has makeinfo && has pod2man; then -+# docs=yes -+# else -+# if test "$docs" = "yes" ; then -+# feature_not_found "docs" "Install texinfo and Perl/perl-podlators" -+# fi -+# docs=no -+# fi -+#fi if test "$docs" != "no" ; then - if has makeinfo && has pod2man; then -- docs=yes + docs=yes - else - if test "$docs" = "yes" ; then - feature_not_found "docs" "Install texinfo and Perl/perl-podlators" - fi - docs=no - fi -+ docs=yes fi # Search for bswap_32 function -@@ -3650,6 +3653,17 @@ fi +@@ -3999,6 +3992,17 @@ fi # check for libusb if test "$libusb" != "no" ; then + cat > $TMPC << EOF +#include + +int main(void) { return libusb_get_port_path(NULL, NULL, NULL, 0); } +EOF + if compile_prog "-Werror" "-lusb -pthread" ; then + libusb="yes" + libusb_cflags="" + libusb_libs=-lusb + libs_softmmu="$libs_softmmu $libusb_libs" + else if $pkg_config --atleast-version=1.0.13 libusb-1.0; then libusb="yes" libusb_cflags=$($pkg_config --cflags libusb-1.0) -@@ -3662,6 +3676,7 @@ if test "$libusb" != "no" ; then +@@ -4011,6 +4015,7 @@ if test "$libusb" != "no" ; then fi libusb="no" fi + fi fi # check for usbredirparser for usb network redirection support Index: head/emulators/qemu-devel/files/patch-disas_libvixl_a64_disasm-a64.cc =================================================================== --- head/emulators/qemu-devel/files/patch-disas_libvixl_a64_disasm-a64.cc (nonexistent) +++ head/emulators/qemu-devel/files/patch-disas_libvixl_a64_disasm-a64.cc (revision 405027) @@ -0,0 +1,11 @@ +--- disas/libvixl/a64/disasm-a64.cc.orig 2015-11-03 20:01:31 UTC ++++ disas/libvixl/a64/disasm-a64.cc +@@ -1362,7 +1362,7 @@ void Disassembler::AppendPCRelativeOffse + int64_t offset) { + USE(instr); + char sign = (offset < 0) ? '-' : '+'; +- AppendToOutput("#%c0x%" PRIx64, sign, std::abs(offset)); ++ AppendToOutput("#%c0x%" PRIx64, sign, offset < 0 ? -offset : offset); + } + + Property changes on: head/emulators/qemu-devel/files/patch-disas_libvixl_a64_disasm-a64.cc ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/emulators/qemu-devel/files/patch-include_net_net.h =================================================================== --- head/emulators/qemu-devel/files/patch-include_net_net.h (nonexistent) +++ head/emulators/qemu-devel/files/patch-include_net_net.h (revision 405027) @@ -0,0 +1,13 @@ +--- include/net/net.h.orig 2015-11-03 20:01:34 UTC ++++ include/net/net.h +@@ -202,8 +202,8 @@ void qmp_netdev_add(QDict *qdict, QObjec + int net_hub_id_for_client(NetClientState *nc, int *id); + NetClientState *net_hub_port_find(int hub_id); + +-#define DEFAULT_NETWORK_SCRIPT "/etc/qemu-ifup" +-#define DEFAULT_NETWORK_DOWN_SCRIPT "/etc/qemu-ifdown" ++#define DEFAULT_NETWORK_SCRIPT PREFIX "/etc/qemu-ifup" ++#define DEFAULT_NETWORK_DOWN_SCRIPT PREFIX "/etc/qemu-ifdown" + #define DEFAULT_BRIDGE_HELPER CONFIG_QEMU_HELPERDIR "/qemu-bridge-helper" + #define DEFAULT_BRIDGE_INTERFACE "br0" + Property changes on: head/emulators/qemu-devel/files/patch-include_net_net.h ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/emulators/qemu-devel/files/patch-include_qemu-common.h =================================================================== --- head/emulators/qemu-devel/files/patch-include_qemu-common.h (nonexistent) +++ head/emulators/qemu-devel/files/patch-include_qemu-common.h (revision 405027) @@ -0,0 +1,12 @@ +--- include/qemu-common.h.orig 2015-11-03 20:01:34 UTC ++++ include/qemu-common.h +@@ -469,7 +469,9 @@ void qemu_hexdump(const char *buf, FILE + #define VEC_OR(v1, v2) ((v1) | (v2)) + /* altivec.h may redefine the bool macro as vector type. + * Reset it to POSIX semantics. */ ++#ifndef __cplusplus + #define bool _Bool ++#endif + #elif defined __SSE2__ + #include + #define VECTYPE __m128i Property changes on: head/emulators/qemu-devel/files/patch-include_qemu-common.h ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/emulators/qemu-devel/files/patch-net_tap-bsd.c =================================================================== --- head/emulators/qemu-devel/files/patch-net_tap-bsd.c (nonexistent) +++ head/emulators/qemu-devel/files/patch-net_tap-bsd.c (revision 405027) @@ -0,0 +1,10 @@ +--- net/tap-bsd.c.orig 2015-11-03 20:01:34 UTC ++++ net/tap-bsd.c +@@ -29,6 +29,7 @@ + + #if defined(__NetBSD__) || defined(__FreeBSD__) + #include ++#include + #include + #include + #endif Property changes on: head/emulators/qemu-devel/files/patch-net_tap-bsd.c ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/emulators/qemu-devel/files/patch-qemu-char.c =================================================================== --- head/emulators/qemu-devel/files/patch-qemu-char.c (nonexistent) +++ head/emulators/qemu-devel/files/patch-qemu-char.c (revision 405027) @@ -0,0 +1,19 @@ +--- qemu-char.c.orig 2015-12-16 00:54:18 UTC ++++ qemu-char.c +@@ -1507,10 +1507,14 @@ static void tty_serial_init(int fd, int + cfsetospeed(&tty, spd); + + tty.c_iflag &= ~(IGNBRK|BRKINT|PARMRK|ISTRIP +- |INLCR|IGNCR|ICRNL|IXON); +- tty.c_oflag |= OPOST; ++ |INLCR|IGNCR|ICRNL|IXON|IMAXBEL); ++ tty.c_oflag &= ~OPOST; /* Don't do any output processing! */ + tty.c_lflag &= ~(ECHO|ECHONL|ICANON|IEXTEN|ISIG); + tty.c_cflag &= ~(CSIZE|PARENB|PARODD|CRTSCTS|CSTOPB); ++#ifdef __FreeBSD__ ++ cfmakeraw(&tty); ++#endif ++ + switch(data_bits) { + default: + case 8: Property changes on: head/emulators/qemu-devel/files/patch-qemu-char.c ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/emulators/qemu-devel/files/patch-qemu-doc.texi =================================================================== --- head/emulators/qemu-devel/files/patch-qemu-doc.texi (revision 405026) +++ head/emulators/qemu-devel/files/patch-qemu-doc.texi (revision 405027) @@ -1,11 +1,12 @@ -Index: qemu/qemu-doc.texi -@@ -985,7 +985,8 @@ +--- qemu-doc.texi.orig 2015-11-03 20:01:35 UTC ++++ qemu-doc.texi +@@ -355,7 +355,8 @@ Send Ctrl-a @c man begin SEEALSO The HTML documentation of QEMU for more precise information and Linux -user mode emulator invocation. +user mode emulator invocation, as well as the FreeBSD host notes in +@file{pkg-message} in the relevant qemu port directory. @c man end @c man begin AUTHOR Index: head/emulators/qemu-devel/files/patch-slirp_slirp__config.h =================================================================== --- head/emulators/qemu-devel/files/patch-slirp_slirp__config.h (nonexistent) +++ head/emulators/qemu-devel/files/patch-slirp_slirp__config.h (revision 405027) @@ -0,0 +1,38 @@ +--- slirp/slirp_config.h.orig 2015-11-03 20:01:35 UTC ++++ slirp/slirp_config.h +@@ -83,7 +83,7 @@ + //#undef HOST_WORDS_BIGENDIAN + + /* Define if you have readv */ +-#undef HAVE_READV ++#define HAVE_READV + + /* Define if iovec needs to be declared */ + #undef DECLARE_IOVEC +@@ -92,7 +92,7 @@ + #endif + + /* Define if you have a POSIX.1 sys/wait.h */ +-#undef HAVE_SYS_WAIT_H ++#define HAVE_SYS_WAIT_H + + /* Define if you have sys/select.h */ + #undef HAVE_SYS_SELECT_H +@@ -110,7 +110,7 @@ + #endif + + /* Define if you have sys/signal.h */ +-#undef HAVE_SYS_SIGNAL_H ++#define HAVE_SYS_SIGNAL_H + + /* Define if you have sys/stropts.h */ + #undef HAVE_SYS_STROPTS_H +@@ -179,7 +179,7 @@ + #undef HAVE_GRANTPT + + /* Define if you have fchmod */ +-#undef HAVE_FCHMOD ++#define HAVE_FCHMOD + + /* Define if you have */ + #undef HAVE_SYS_TYPES32_H Property changes on: head/emulators/qemu-devel/files/patch-slirp_slirp__config.h ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/emulators/qemu-devel/files/patch-ui_x__keymap.c =================================================================== --- head/emulators/qemu-devel/files/patch-ui_x__keymap.c (nonexistent) +++ head/emulators/qemu-devel/files/patch-ui_x__keymap.c (revision 405027) @@ -0,0 +1,15 @@ +--- ui/x_keymap.c.orig 2015-12-16 00:59:05 UTC ++++ ui/x_keymap.c +@@ -43,9 +43,9 @@ static const uint8_t x_keycode_to_pc_key + 0xb5, /* 112 Divide */ + 0xb8, /* 113 Alt-R */ + 0xc6, /* 114 Break */ +- 0x0, /* 115 */ +- 0x0, /* 116 */ +- 0x0, /* 117 */ ++ 0xdb, /* 115 left windows key */ ++ 0xdc, /* 116 right windows key */ ++ 0xdd, /* 117 right menu key */ + 0x0, /* 118 */ + 0x0, /* 119 */ + 0x0, /* 120 */ Property changes on: head/emulators/qemu-devel/files/patch-ui_x__keymap.c ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/emulators/qemu-devel/files/pcap-patch =================================================================== --- head/emulators/qemu-devel/files/pcap-patch (revision 405026) +++ head/emulators/qemu-devel/files/pcap-patch (revision 405027) @@ -1,391 +1,446 @@ ---- configure.orig 2015-08-11 19:11:05 UTC -+++ configure -@@ -338,6 +338,9 @@ libssh2="" +configure +--- configure 2015-12-17 04:04:48.000000000 +0600 ++++ configure 2015-12-25 01:32:09.000000000 +0600 +@@ -342,6 +342,10 @@ + tpm="yes" + libssh2="" vhdx="" - numa="" - tcmalloc="no" ++quorum="no" +pcap="no" +pcap_create="no" +bpf="no" - - # parse CC options first - for opt do -@@ -896,6 +899,10 @@ for opt do + numa="" + tcmalloc="no" + jemalloc="no" +@@ -602,7 +606,7 @@ + audio_drv_list="oss" + audio_possible_drivers="oss sdl pa" + # needed for kinfo_getvmmap(3) in libutil.h +- LIBS="-lutil $LIBS" ++ LIBS="-lprocstat -lkvm -lelf -lutil $LIBS" + netmap="" # enable netmap autodetect + HOST_VARIANT_DIR="freebsd" + ;; +@@ -905,6 +909,10 @@ ;; --enable-vnc-png) vnc_png="yes" ;; + --enable-pcap) pcap="yes" + ;; + --disable-pcap) pcap="no" + ;; --disable-slirp) slirp="no" ;; --disable-uuid) uuid="no" -@@ -2354,6 +2361,51 @@ EOF - fi +@@ -2427,6 +2435,14 @@ + ########################################## ++# getifaddrs (for tests/test-io-channel-socket ) ++ ++have_ifaddrs_h=yes ++if ! check_include "ifaddrs.h" ; then ++ have_ifaddrs_h=no ++fi ++ ++########################################## + # VTE probe + + if test "$vte" != "no"; then +@@ -2569,6 +2585,50 @@ + fi + fi + ++########################################## +# pcap probe + +if test "$pcap" = "yes" -a "$pcap" != "no"; then + cat > $TMPC << EOF +#include +int main(void) { return (pcap_lib_version() == (char *)0 ? 1 : 0); } +EOF + if test "$mingw32" = "no" ; then + libpcap=-lpcap + else + libpcap=-lwpcap + fi + if compile_prog "" "$libpcap" ; then + : + else + echo + echo "Error: Could not find pcap" + echo "Make sure to have the pcap libs and headers installed." + echo + exit 1 + fi + cat > $TMPC << EOF +#include +int main(void) +{ + char errbuf[PCAP_ERRBUF_SIZE]; + return (pcap_create("foo", errbuf) == (pcap_t *)0 ? 1 : 0); +} +EOF + if compile_prog "" "$libpcap" ; then + pcap_create="yes" + fi + cat > $TMPC << EOF +#define PCAP_DONT_INCLUDE_PCAP_BPF_H +#include +#include +int main(void) { return (BPF_MAJOR_VERSION); } +EOF + if compile_prog ; then + bpf="yes" + fi + libs_softmmu="$libpcap $libs_softmmu" +fi # test "$pcap" -+ -+########################################## - # VNC TLS/WS detection - if test "$vnc" = "yes" -a "$vnc_tls" != "no" ; then - cat > $TMPC <> $config_host_mak fi +if test "$pcap" = "yes" ; then + echo "CONFIG_PCAP=y" >> $config_host_mak + if test "$pcap_create" = "yes" ; then + echo "CONFIG_PCAP_CREATE=y" >> $config_host_mak + fi + if test "$bpf" = "yes" ; then + echo "CONFIG_BPF=y" >> $config_host_mak + fi +fi if test "$slirp" = "yes" ; then echo "CONFIG_SLIRP=y" >> $config_host_mak echo "CONFIG_SMBD_COMMAND=\"$smbd\"" >> $config_host_mak ---- net/clients.h.orig 2015-08-11 19:11:09 UTC -+++ net/clients.h -@@ -49,6 +49,12 @@ int net_init_bridge(const NetClientOptio - - int net_init_l2tpv3(const NetClientOptions *opts, const char *name, +@@ -5137,6 +5226,9 @@ + if test "$tasn1" = "yes" ; then + echo "CONFIG_TASN1=y" >> $config_host_mak + fi ++if test "$have_ifaddrs_h" = "yes" ; then ++ echo "HAVE_IFADDRS_H=y" >> $config_host_mak ++fi + if test "$vte" = "yes" ; then + echo "CONFIG_VTE=y" >> $config_host_mak + echo "VTE_CFLAGS=$vte_cflags" >> $config_host_mak +diff -ruN net/clients.h net/clients.h +--- net/clients.h 2015-12-17 04:04:50.000000000 +0600 ++++ net/clients.h 2015-12-25 01:32:09.000000000 +0600 +@@ -47,6 +47,11 @@ + int net_init_bridge(const NetClientOptions *opts, const char *name, NetClientState *peer, Error **errp); -+ + +#ifdef CONFIG_PCAP +int net_init_pcap(const NetClientOptions *opts, const char *name, -+ NetClientState *peer); ++ NetClientState *peer, Error **errp); +#endif + + int net_init_l2tpv3(const NetClientOptions *opts, const char *name, + NetClientState *peer, Error **errp); #ifdef CONFIG_VDE - int net_init_vde(const NetClientOptions *opts, const char *name, - NetClientState *peer, Error **errp); ---- net/hub.c.orig 2015-08-11 19:11:09 UTC -+++ net/hub.c -@@ -322,6 +322,7 @@ void net_hub_check_clients(void) +diff -ruN net/hub.c net/hub.c +--- net/hub.c 2015-12-17 04:04:50.000000000 +0600 ++++ net/hub.c 2015-12-25 01:32:09.000000000 +0600 +@@ -322,6 +322,7 @@ case NET_CLIENT_OPTIONS_KIND_SOCKET: case NET_CLIENT_OPTIONS_KIND_VDE: case NET_CLIENT_OPTIONS_KIND_VHOST_USER: + case NET_CLIENT_OPTIONS_KIND_PCAP: has_host_dev = 1; break; default: ---- net/net.c.orig 2015-08-11 19:11:09 UTC -+++ net/net.c -@@ -45,6 +45,11 @@ - #include "qapi/dealloc-visitor.h" +diff -ruN net/net.c net/net.c +--- net/net.c 2015-12-17 04:04:50.000000000 +0600 ++++ net/net.c 2015-12-25 01:32:09.000000000 +0600 +@@ -46,6 +46,11 @@ #include "sysemu/sysemu.h" + #include "net/filter.h" +#include +#ifdef __FreeBSD__ +#include +#endif + /* Net bridge is currently not supported for W32. */ #if !defined(_WIN32) # define CONFIG_NET_BRIDGE -@@ -880,6 +885,221 @@ static int net_init_nic(const NetClientO +@@ -942,8 +947,224 @@ return idx; } +#if defined(CONFIG_PCAP) +#if defined(CONFIG_BPF) +#define PCAP_DONT_INCLUDE_PCAP_BPF_H +#include +#endif +#include + +struct PCAPState { + NetClientState nc; + pcap_t *handle; + int max_eth_frame_size; +}; + +static ssize_t pcap_receive(NetClientState *nc, const uint8_t *buf, size_t size) +{ + struct PCAPState *s = DO_UPCAST(struct PCAPState, nc, nc); + + return pcap_inject(s->handle, (u_char*)buf, size); +} + +static void pcap_callback(u_char *user, struct pcap_pkthdr *phdr, u_char *pdata + ) +{ + NetClientState *nc = (NetClientState *)user; + + int len = phdr->len; +#ifdef __FreeBSD__ + struct PCAPState *s = DO_UPCAST(struct PCAPState, nc, nc); + int max_eth_frame_size = s->max_eth_frame_size; + + if (len > max_eth_frame_size) { + fprintf(stderr, + "pcap_send: packet size > %d (%d), truncating\n", + max_eth_frame_size, len); + len = max_eth_frame_size; + } +#endif + qemu_send_packet(nc, pdata, len); +} + +static void pcap_send(void *opaque) +{ + struct PCAPState *s = (struct PCAPState *)opaque; + + for (;;) { + if (pcap_dispatch(s->handle, 0, (pcap_handler)&pcap_callback, (u_char *)&s->nc) >= 0) + break; + } +} + +static void pcap_cleanup(NetClientState *nc) +{ + struct PCAPState *s = DO_UPCAST(struct PCAPState, nc, nc); + + qemu_purge_queued_packets(nc); + pcap_close(s->handle); +} + +static NetClientInfo net_pcap_info = { + .type = NET_CLIENT_OPTIONS_KIND_PCAP, + .size = sizeof(struct PCAPState), + .receive = pcap_receive, +// .receive_raw = pcap_receive_raw, +// .receive_iov = pcap_receive_iov, +// .poll = pcap_poll, + .cleanup = pcap_cleanup, +}; +/* + * ... -net pcap,ifname="..." + */ + -+int net_init_pcap(const NetClientOptions *opts, const char *name, NetClientState *peer) ++int net_init_pcap(const NetClientOptions *opts, ++ const char *name, NetClientState *peer, Error **errp) +{ -+ const NetdevPcapOptions *pcap_opts = opts->pcap; ++ const NetdevPcapOptions *pcap_opts = opts->u.pcap; + NetClientState *nc; + struct PCAPState *s; + const char *ifname; + char errbuf[PCAP_ERRBUF_SIZE]; +#if defined(_WIN32) + HANDLE h; +#endif + int i; + + if (!pcap_opts->has_ifname) + return -1; + + ifname = pcap_opts->ifname; + + /* create the object */ + nc = qemu_new_net_client(&net_pcap_info, peer, "pcap", ifname); + s = DO_UPCAST(struct PCAPState, nc, nc); + + if (ifname == NULL && (ifname = pcap_lookupdev(errbuf)) == NULL) { + fprintf(stderr, "qemu: pcap_create: %s\n", errbuf); + goto fail; + } + +#ifdef __FreeBSD__ + /* + * We want to avoid passing oversize packets to the guest, which + * at least on FreeBSD can happen if the host interface uses tso + * (seen with an em(4) in this case) - so find out the host + * interface's mtu and assume the guest is configured the same. + */ + s->max_eth_frame_size = 1514; + i = socket(AF_INET, SOCK_DGRAM, 0); + if (i >= 0) { + struct ifreq ifr; + + (void) memset(&ifr, 0, sizeof(ifr)); + strncpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name)); + if (ioctl(i, SIOCGIFMTU, &ifr) != -1) + s->max_eth_frame_size = ifr.ifr_mtu + 14; + close(i); + } +#endif + +#if defined(CONFIG_PCAP_CREATE) || defined(_WIN32) + /* + * Create pcap handle for the device, set promiscuous mode and activate. + */ + s->handle = (void *)pcap_create(ifname, errbuf); + if (!s->handle) { + fprintf(stderr, "qemu: pcap_create: %s\n", errbuf); + goto fail; + } + if (pcap_set_promisc(s->handle, 1) != 0) { + pcap_perror(s->handle, (char *)"qemu: pcap_set_promisc:"); + goto fail; + } + if (pcap_activate(s->handle) != 0) { + pcap_perror(s->handle, (char *)"qemu: pcap_activate:"); + goto fail; + } +#else + /* Attempt to connect device. */ + s->handle = (void *)pcap_open_live(ifname, 65535, 1, 0, errbuf); + if (!s->handle) { + fprintf(stderr, "qemu: pcap_open_live: %s\n", errbuf); + goto fail; + } +#endif + + /* Set non-blocking mode. */ + if (pcap_setnonblock(s->handle, 1, errbuf) < 0) { + fprintf(stderr, "qemu: pcap_setnonblock: %s\n", errbuf); + goto fail; + } + +#if defined(_WIN32) + /* + * Tell the kernel that the packet has to be seen immediately. + */ + if (pcap_setmintocopy(s->handle, 0) < 0) { + fprintf(stderr, "qemu: pcap failed to set immediate mode\n"); + goto fail; + } +#else /* !_WIN32 */ +#if defined(CONFIG_BPF) +#if defined(BIOCIMMEDIATE) + /* + * Tell the kernel that the packet has to be seen immediately. + */ + { + unsigned int one = 1; + if (ioctl(pcap_fileno(s->handle), BIOCIMMEDIATE, &one) < 0) { + fprintf(stderr, "qemu: pcap failed to set immediate mode\n"); + goto fail; + } + } +#endif /* BIOCIMMEDIATE */ +#if defined(BIOCFEEDBACK) + /* + * Tell the kernel that the sent packet has to be fed back. + * This is necessary to connect host and guest. + */ + { + unsigned int one = 1; + if (ioctl(pcap_fileno(s->handle), BIOCFEEDBACK, &one) < 0) { + fprintf(stderr, "qemu: pcap failed to set feedback mode\n"); + goto fail; + } + } +#endif /* BIOCFEEDBACK */ +#endif /* CONFIG_BPF */ +#endif /* _WIN32 */ + + snprintf(s->nc.info_str, sizeof(s->nc.info_str), "pcap redirector"); + +#if defined(_WIN32) + if ((h = pcap_getevent(s->handle)) == NULL) { + fprintf(stderr, "qemu: pcap_getevent failed\n"); + goto fail; + } + qemu_add_wait_object(h, pcap_send, s); +#else /* !_WIN32 */ + if ((i = pcap_get_selectable_fd(s->handle)) < 0) { + fprintf(stderr, "qemu: pcap_get_selectable_fd failed\n"); + goto fail; + } + qemu_set_fd_handler(i, pcap_send, NULL, s); +#endif /* _WIN32 */ + + return 0; + +fail: + if (s) { + if (s->handle) + pcap_close(s->handle); + } + + return -1; +} + +#endif - static int (* const net_client_init_fun[NET_CLIENT_OPTIONS_KIND_MAX])( +-static int (* const net_client_init_fun[NET_CLIENT_OPTIONS_KIND_MAX])( ++static int (* const net_client_init_fun[NET_CLIENT_OPTIONS_KIND_MAX])( const NetClientOptions *opts, -@@ -901,6 +1121,9 @@ static int (* const net_client_init_fun[ + const char *name, + NetClientState *peer, Error **errp) = { +@@ -963,6 +1184,9 @@ #ifdef CONFIG_NET_BRIDGE [NET_CLIENT_OPTIONS_KIND_BRIDGE] = net_init_bridge, #endif +#ifdef CONFIG_PCAP + [NET_CLIENT_OPTIONS_KIND_PCAP] = net_init_pcap, +#endif [NET_CLIENT_OPTIONS_KIND_HUBPORT] = net_init_hubport, #ifdef CONFIG_VHOST_NET_USED [NET_CLIENT_OPTIONS_KIND_VHOST_USER] = net_init_vhost_user, ---- qapi-schema.json.orig 2015-08-11 19:11:09 UTC -+++ qapi-schema.json -@@ -2423,6 +2423,10 @@ +diff -ruN qapi-schema.json qapi-schema.json +--- qapi-schema.json 2015-12-17 04:04:50.000000000 +0600 ++++ qapi-schema.json 2015-12-25 01:32:09.000000000 +0600 +@@ -2538,6 +2538,10 @@ '*br': 'str', '*helper': 'str' } } +{ 'struct': 'NetdevPcapOptions', + 'data': { + '*ifname': 'str' } } + ## # @NetdevHubPortOptions # -@@ -2490,6 +2494,7 @@ +@@ -2608,6 +2612,7 @@ + 'nic': 'NetLegacyNicOptions', 'user': 'NetdevUserOptions', 'tap': 'NetdevTapOptions', - 'l2tpv3': 'NetdevL2TPv3Options', + 'pcap': 'NetdevPcapOptions', + 'l2tpv3': 'NetdevL2TPv3Options', 'socket': 'NetdevSocketOptions', 'vde': 'NetdevVdeOptions', - 'dump': 'NetdevDumpOptions', Index: head/emulators/qemu-devel/pkg-plist =================================================================== --- head/emulators/qemu-devel/pkg-plist (revision 405026) +++ head/emulators/qemu-devel/pkg-plist (revision 405027) @@ -1,133 +1,136 @@ +%%SOFTMMU%%bin/ivshmem-server +%%SOFTMMU%%bin/ivshmem-client %%SOFTMMU%%bin/qemu-ga %%SOFTMMU%%bin/qemu-img %%SOFTMMU%%bin/qemu-io %%SOFTMMU%%bin/qemu-nbd -%%NONX86%%bin/qemu-system-aarch64 -%%NONX86%%bin/qemu-system-alpha -%%NONX86%%bin/qemu-system-arm -%%NONX86%%bin/qemu-system-cris +%%X86_TARGETS%%bin/qemu-system-aarch64 +%%X86_TARGETS%%bin/qemu-system-alpha +%%X86_TARGETS%%bin/qemu-system-arm +%%X86_TARGETS%%bin/qemu-system-cris %%SOFTMMU%%bin/qemu-system-i386 -%%NONX86%%bin/qemu-system-lm32 -%%NONX86%%bin/qemu-system-m68k -%%NONX86%%bin/qemu-system-microblaze -%%NONX86%%bin/qemu-system-microblazeel -%%NONX86%%bin/qemu-system-mips -%%NONX86%%bin/qemu-system-mips64 -%%NONX86%%bin/qemu-system-mips64el -%%NONX86%%bin/qemu-system-mipsel -%%NONX86%%bin/qemu-system-moxie -%%NONX86%%bin/qemu-system-or32 -%%NONX86%%bin/qemu-system-ppc -%%NONX86%%bin/qemu-system-ppc64 -%%NONX86%%bin/qemu-system-ppcemb -%%NONX86%%bin/qemu-system-s390x -%%NONX86%%bin/qemu-system-sh4 -%%NONX86%%bin/qemu-system-sh4eb -%%NONX86%%bin/qemu-system-sparc -%%NONX86%%bin/qemu-system-sparc64 -%%NONX86%%bin/qemu-system-tricore -%%NONX86%%bin/qemu-system-unicore32 +%%X86_TARGETS%%bin/qemu-system-lm32 +%%X86_TARGETS%%bin/qemu-system-m68k +%%X86_TARGETS%%bin/qemu-system-microblaze +%%X86_TARGETS%%bin/qemu-system-microblazeel +%%X86_TARGETS%%bin/qemu-system-mips +%%X86_TARGETS%%bin/qemu-system-mips64 +%%X86_TARGETS%%bin/qemu-system-mips64el +%%X86_TARGETS%%bin/qemu-system-mipsel +%%X86_TARGETS%%bin/qemu-system-moxie +%%X86_TARGETS%%bin/qemu-system-or32 +%%X86_TARGETS%%bin/qemu-system-ppc +%%X86_TARGETS%%bin/qemu-system-ppc64 +%%X86_TARGETS%%bin/qemu-system-ppcemb +%%X86_TARGETS%%bin/qemu-system-s390x +%%X86_TARGETS%%bin/qemu-system-sh4 +%%X86_TARGETS%%bin/qemu-system-sh4eb +%%X86_TARGETS%%bin/qemu-system-sparc +%%X86_TARGETS%%bin/qemu-system-sparc64 +%%X86_TARGETS%%bin/qemu-system-tricore +%%X86_TARGETS%%bin/qemu-system-unicore32 %%BSD_USER%%bin/qemu-arm%%STATIC%% %%BSD_USER%%bin/qemu-i386%%STATIC%% %%BSD_USER%%bin/qemu-mips%%STATIC%% %%BSD_USER64%%bin/qemu-mips64%%STATIC%% %%BSD_USER64%%bin/qemu-mips64el%%STATIC%% %%BSD_USER%%bin/qemu-mipsel%%STATIC%% %%BSD_USER%%bin/qemu-sparc%%STATIC%% %%BSD_USER64%%bin/qemu-sparc64%%STATIC%% %%BSD_USER64%%bin/qemu-x86_64%%STATIC%% %%SOFTMMU%%bin/qemu-system-x86_64 -%%NONX86%%bin/qemu-system-xtensa -%%NONX86%%bin/qemu-system-xtensaeb +%%X86_TARGETS%%bin/qemu-system-xtensa +%%X86_TARGETS%%bin/qemu-system-xtensaeb %%SOFTMMU%%man/man1/qemu.1.gz %%SOFTMMU%%man/man1/qemu-img.1.gz +%%SOFTMMU%%man/man8/qemu-ga.8.gz %%SOFTMMU%%man/man8/qemu-nbd.8.gz %%SOFTMMU%%@sample etc/qemu-ifup.sample %%SOFTMMU%%@sample etc/qemu-ifdown.sample %%SOFTMMU%%%%DATADIR%%/QEMU,tcx.bin %%SOFTMMU%%%%DATADIR%%/QEMU,cgthree.bin %%SOFTMMU%%%%DATADIR%%/acpi-dsdt.aml %%SOFTMMU%%%%DATADIR%%/q35-acpi-dsdt.aml %%SOFTMMU%%%%DATADIR%%/bios-256k.bin %%SOFTMMU%%%%DATADIR%%/bios.bin %%SOFTMMU%%%%DATADIR%%/efi-e1000.rom %%SOFTMMU%%%%DATADIR%%/efi-eepro100.rom %%SOFTMMU%%%%DATADIR%%/efi-ne2k_pci.rom %%SOFTMMU%%%%DATADIR%%/efi-pcnet.rom %%SOFTMMU%%%%DATADIR%%/efi-rtl8139.rom %%SOFTMMU%%%%DATADIR%%/efi-virtio.rom %%SOFTMMU%%%%DATADIR%%/s390-ccw.img %%SOFTMMU%%%%DATADIR%%/vgabios.bin %%SOFTMMU%%%%DATADIR%%/vgabios-cirrus.bin %%SOFTMMU%%%%DATADIR%%/vgabios-qxl.bin %%SOFTMMU%%%%DATADIR%%/vgabios-stdvga.bin %%SOFTMMU%%%%DATADIR%%/vgabios-virtio.bin %%SOFTMMU%%%%DATADIR%%/vgabios-vmware.bin %%SOFTMMU%%%%DATADIR%%/palcode-clipper %%SOFTMMU%%%%DATADIR%%/ppc_rom.bin %%SOFTMMU%%%%DATADIR%%/openbios-ppc %%SOFTMMU%%%%DATADIR%%/openbios-sparc32 %%SOFTMMU%%%%DATADIR%%/openbios-sparc64 %%SOFTMMU%%%%DATADIR%%/pxe-e1000.rom %%SOFTMMU%%%%DATADIR%%/pxe-eepro100.rom %%SOFTMMU%%%%DATADIR%%/pxe-ne2k_pci.rom %%SOFTMMU%%%%DATADIR%%/pxe-rtl8139.rom %%SOFTMMU%%%%DATADIR%%/pxe-pcnet.rom %%SOFTMMU%%%%DATADIR%%/pxe-virtio.rom %%SOFTMMU%%%%DATADIR%%/petalogix-ml605.dtb %%SOFTMMU%%%%DATADIR%%/spapr-rtas.bin %%SOFTMMU%%%%DATADIR%%/slof.bin %%SOFTMMU%%%%DATADIR%%/s390-zipl.rom %%SOFTMMU%%%%DATADIR%%/linuxboot.bin %%SOFTMMU%%%%DATADIR%%/multiboot.bin %%SOFTMMU%%%%DATADIR%%/sgabios.bin %%SOFTMMU%%%%DATADIR%%/petalogix-s3adsp1800.dtb %%SOFTMMU%%%%DATADIR%%/bamboo.dtb %%SOFTMMU%%%%DATADIR%%/kvmvapic.bin %%SOFTMMU%%%%DATADIR%%/qemu-icon.bmp %%SOFTMMU%%%%DATADIR%%/qemu_logo_no_text.svg %%SOFTMMU%%%%DATADIR%%/trace-events %%SOFTMMU%%%%DATADIR%%/u-boot.e500 %%SOFTMMU%%%%DATADIR%%/keymaps/ar %%SOFTMMU%%%%DATADIR%%/keymaps/bepo %%SOFTMMU%%%%DATADIR%%/keymaps/common %%SOFTMMU%%%%DATADIR%%/keymaps/cz %%SOFTMMU%%%%DATADIR%%/keymaps/da %%SOFTMMU%%%%DATADIR%%/keymaps/de %%SOFTMMU%%%%DATADIR%%/keymaps/de-ch %%SOFTMMU%%%%DATADIR%%/keymaps/en-gb %%SOFTMMU%%%%DATADIR%%/keymaps/en-us %%SOFTMMU%%%%DATADIR%%/keymaps/es %%SOFTMMU%%%%DATADIR%%/keymaps/et %%SOFTMMU%%%%DATADIR%%/keymaps/fi %%SOFTMMU%%%%DATADIR%%/keymaps/fo %%SOFTMMU%%%%DATADIR%%/keymaps/fr %%SOFTMMU%%%%DATADIR%%/keymaps/fr-be %%SOFTMMU%%%%DATADIR%%/keymaps/fr-ca %%SOFTMMU%%%%DATADIR%%/keymaps/fr-ch %%SOFTMMU%%%%DATADIR%%/keymaps/hr %%SOFTMMU%%%%DATADIR%%/keymaps/hu %%SOFTMMU%%%%DATADIR%%/keymaps/is %%SOFTMMU%%%%DATADIR%%/keymaps/it %%SOFTMMU%%%%DATADIR%%/keymaps/ja %%SOFTMMU%%%%DATADIR%%/keymaps/lt %%SOFTMMU%%%%DATADIR%%/keymaps/lv %%SOFTMMU%%%%DATADIR%%/keymaps/mk %%SOFTMMU%%%%DATADIR%%/keymaps/modifiers %%SOFTMMU%%%%DATADIR%%/keymaps/nl %%SOFTMMU%%%%DATADIR%%/keymaps/nl-be %%SOFTMMU%%%%DATADIR%%/keymaps/no %%SOFTMMU%%%%DATADIR%%/keymaps/pl %%SOFTMMU%%%%DATADIR%%/keymaps/pt %%SOFTMMU%%%%DATADIR%%/keymaps/pt-br %%SOFTMMU%%%%DATADIR%%/keymaps/ru %%SOFTMMU%%%%DATADIR%%/keymaps/sl %%SOFTMMU%%%%DATADIR%%/keymaps/sv %%SOFTMMU%%%%DATADIR%%/keymaps/th %%SOFTMMU%%%%DATADIR%%/keymaps/tr %%GTK2%%share/locale/de_DE/LC_MESSAGES/qemu.mo %%GTK2%%share/locale/fr_FR/LC_MESSAGES/qemu.mo %%GTK2%%share/locale/it/LC_MESSAGES/qemu.mo %%GTK2%%share/locale/hu/LC_MESSAGES/qemu.mo %%GTK2%%share/locale/tr/LC_MESSAGES/qemu.mo %%GTK2%%share/locale/zh_CN/LC_MESSAGES/qemu.mo