Index: head/emulators/qemu-devel/Makefile =================================================================== --- head/emulators/qemu-devel/Makefile +++ head/emulators/qemu-devel/Makefile @@ -2,29 +2,27 @@ # $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) @@ -37,19 +35,55 @@ 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 @@ -78,128 +112,25 @@ .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 -.endif +.if ${PORT_OPTIONS:MBSD_USER} && ${ARCH} == "sparc64" +IGNORE= bsd-user targets not tested on sparc64 .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 @@ -218,23 +149,15 @@ .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 @@ -250,6 +173,16 @@ -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: @@ -259,12 +192,13 @@ .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 +++ head/emulators/qemu-devel/distinfo @@ -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/cdrom-dma-patch =================================================================== --- head/emulators/qemu-devel/files/cdrom-dma-patch +++ head/emulators/qemu-devel/files/cdrom-dma-patch @@ -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 Index: head/emulators/qemu-devel/files/hw_e1000_c.patch =================================================================== --- head/emulators/qemu-devel/files/hw_e1000_c.patch +++ head/emulators/qemu-devel/files/hw_e1000_c.patch @@ -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)) Index: head/emulators/qemu-devel/files/patch-Makefile =================================================================== --- head/emulators/qemu-devel/files/patch-Makefile +++ head/emulators/qemu-devel/files/patch-Makefile @@ -1,18 +1,18 @@ ---- 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)" Index: head/emulators/qemu-devel/files/patch-configure =================================================================== --- head/emulators/qemu-devel/files/patch-configure +++ head/emulators/qemu-devel/files/patch-configure @@ -1,6 +1,6 @@ ---- 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" @@ -9,43 +9,31 @@ 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 @@ -63,7 +51,7 @@ 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 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 +++ head/emulators/qemu-devel/files/patch-disas-libvixl-a64-disasm-a64.cc @@ -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); - } - - 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 +++ head/emulators/qemu-devel/files/patch-disas_libvixl_a64_disasm-a64.cc @@ -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); + } + + Index: head/emulators/qemu-devel/files/patch-include-qemu-common.h =================================================================== --- head/emulators/qemu-devel/files/patch-include-qemu-common.h +++ head/emulators/qemu-devel/files/patch-include-qemu-common.h @@ -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 Index: head/emulators/qemu-devel/files/patch-include_net_net.h =================================================================== --- head/emulators/qemu-devel/files/patch-include_net_net.h +++ head/emulators/qemu-devel/files/patch-include_net_net.h @@ -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" + Index: head/emulators/qemu-devel/files/patch-include_qemu-common.h =================================================================== --- head/emulators/qemu-devel/files/patch-include_qemu-common.h +++ head/emulators/qemu-devel/files/patch-include_qemu-common.h @@ -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 Index: head/emulators/qemu-devel/files/patch-net-tap-bsd.c =================================================================== --- head/emulators/qemu-devel/files/patch-net-tap-bsd.c +++ head/emulators/qemu-devel/files/patch-net-tap-bsd.c @@ -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 Index: head/emulators/qemu-devel/files/patch-net_tap-bsd.c =================================================================== --- head/emulators/qemu-devel/files/patch-net_tap-bsd.c +++ head/emulators/qemu-devel/files/patch-net_tap-bsd.c @@ -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 Index: head/emulators/qemu-devel/files/patch-qemu-char.c =================================================================== --- head/emulators/qemu-devel/files/patch-qemu-char.c +++ head/emulators/qemu-devel/files/patch-qemu-char.c @@ -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: Index: head/emulators/qemu-devel/files/patch-qemu-doc.texi =================================================================== --- head/emulators/qemu-devel/files/patch-qemu-doc.texi +++ head/emulators/qemu-devel/files/patch-qemu-doc.texi @@ -1,5 +1,6 @@ -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 Index: head/emulators/qemu-devel/files/patch-qemu-include-net-net.h =================================================================== --- head/emulators/qemu-devel/files/patch-qemu-include-net-net.h +++ head/emulators/qemu-devel/files/patch-qemu-include-net-net.h @@ -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" - Index: head/emulators/qemu-devel/files/patch-qemu-slirp-slirp_config.h =================================================================== --- head/emulators/qemu-devel/files/patch-qemu-slirp-slirp_config.h +++ head/emulators/qemu-devel/files/patch-qemu-slirp-slirp_config.h @@ -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 Index: head/emulators/qemu-devel/files/patch-slirp_slirp__config.h =================================================================== --- head/emulators/qemu-devel/files/patch-slirp_slirp__config.h +++ head/emulators/qemu-devel/files/patch-slirp_slirp__config.h @@ -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 Index: head/emulators/qemu-devel/files/patch-ui_x__keymap.c =================================================================== --- head/emulators/qemu-devel/files/patch-ui_x__keymap.c +++ head/emulators/qemu-devel/files/patch-ui_x__keymap.c @@ -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 */ Index: head/emulators/qemu-devel/files/patch-vl.c-serial =================================================================== --- head/emulators/qemu-devel/files/patch-vl.c-serial +++ head/emulators/qemu-devel/files/patch-vl.c-serial @@ -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: Index: head/emulators/qemu-devel/files/patch-x_keymap.c =================================================================== --- head/emulators/qemu-devel/files/patch-x_keymap.c +++ head/emulators/qemu-devel/files/patch-x_keymap.c @@ -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 */ Index: head/emulators/qemu-devel/files/pcap-patch =================================================================== --- head/emulators/qemu-devel/files/pcap-patch +++ head/emulators/qemu-devel/files/pcap-patch @@ -1,16 +1,27 @@ ---- 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" ;; @@ -21,10 +32,26 @@ --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 @@ -68,20 +95,31 @@ + 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 @@ -97,24 +135,35 @@ 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: @@ -122,11 +171,12 @@ 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__ @@ -136,7 +186,7 @@ /* 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; } @@ -211,9 +261,10 @@ + * ... -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; @@ -356,9 +407,12 @@ + +#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 @@ -368,9 +422,10 @@ [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' } } @@ -381,11 +436,11 @@ ## # @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 +++ head/emulators/qemu-devel/pkg-plist @@ -1,32 +1,34 @@ +%%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%% @@ -37,10 +39,11 @@ %%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