svn commit: r494122 - in head/emulators/qemu-devel: . files

Muhammad Moinur Rahman bofh at FreeBSD.org
Thu Feb 28 01:52:20 UTC 2019


Author: bofh
Date: Thu Feb 28 01:52:17 2019
New Revision: 494122
URL: https://svnweb.freebsd.org/changeset/ports/494122

Log:
  emulators/qemu-devel: Update version 2.6.0=>3.1.0
  
  PR:		229324
  Reported by:	bcran
  Relnotes:	https://www.qemu.org/2018/12/12/qemu-3-1-0/

Added:
  head/emulators/qemu-devel/files/pcap-patch-net_clients.h   (contents, props changed)
  head/emulators/qemu-devel/files/pcap-patch-qapi_net.json   (contents, props changed)
Deleted:
  head/emulators/qemu-devel/files/patch-qemu-char.c
  head/emulators/qemu-devel/files/patch-slirp_slirp__config.h
  head/emulators/qemu-devel/files/patch-ui_x__keymap.c
  head/emulators/qemu-devel/files/pcap-patch
Modified:
  head/emulators/qemu-devel/Makefile
  head/emulators/qemu-devel/distinfo
  head/emulators/qemu-devel/files/patch-Makefile
  head/emulators/qemu-devel/files/patch-configure
  head/emulators/qemu-devel/files/patch-include_qemu_atomic.h
  head/emulators/qemu-devel/files/pcap-patch-net_net.c
  head/emulators/qemu-devel/pkg-plist

Modified: head/emulators/qemu-devel/Makefile
==============================================================================
--- head/emulators/qemu-devel/Makefile	Thu Feb 28 01:24:25 2019	(r494121)
+++ head/emulators/qemu-devel/Makefile	Thu Feb 28 01:52:17 2019	(r494122)
@@ -2,28 +2,41 @@
 # $FreeBSD$
 
 PORTNAME=	qemu
-DISTVERSION=	2.6.0
-PORTREVISION=	7
+PORTVERSION=	3.1.0
 CATEGORIES=	emulators
-MASTER_SITES=	http://wiki.qemu.org/download/
+MASTER_SITES=	https://download.qemu.org/
 PKGNAMESUFFIX=	-devel
+DIST_SUBDIR=	qemu/${PORTVERSION}
 
 MAINTAINER=	bofh at FreeBSD.org
 COMMENT=	QEMU CPU Emulator - development version
 
 LICENSE=	GPLv2
 
-HAS_CONFIGURE=	yes
-USES=		cpe gmake pkgconfig bison perl5 python:2.7,build ssl tar:bzip2
+ONLY_FOR_ARCHS=	amd64 i386 powerpc powerpc64
+
+LIB_DEPENDS=	libnettle.so:security/nettle \
+		libfontconfig.so:x11-fonts/fontconfig \
+		libfreetype.so:print/freetype2 \
+		libepoxy.so:graphics/libepoxy \
+		libpcre2-8.so:devel/pcre2
+
+USES=		cpe gl gmake gnome pkgconfig bison perl5 python:2.7,build tar:xz
+USE_GNOME=	cairo glib20 libxml2
 USE_PERL5=	build
 USE_XORG=	pixman
-USE_GNOME+=	cairo glib20
-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
+#BROKEN_powerpc64=	fails to compile: In function aio_bh_poll: internal compiler error: Segmentation fault
+
+#.if !defined(PKGNAMESUFFIX) || (${PKGNAMESUFFIX} != "-utils" && ${PKGNAMESUFFIX} != "-guest-agent")
+#.endif
+
+HAS_CONFIGURE=	yes
+MAKE_ENV+=	BSD_MAKE="${MAKE}" V=1
+
+OPTIONS_DEFINE=	SAMBA X11 GTK3 OPENGL GNUTLS SASL JPEG PNG CURL \
+		VDE CDROM_DMA PCAP USBREDIR GNS3 X86_TARGETS \
+		STATIC_LINK DOCS NCURSES
 SAMBA_DESC=		samba dependency (for -smb)
 GNUTLS_DESC=		gnutls dependency (vnc encryption)
 SASL_DESC=		cyrus-sasl dependency (vnc encryption)
@@ -35,14 +48,16 @@ USBREDIR_DESC=		usb device network redirection (experi
 GNS3_DESC=		gns3 patches (promiscuous multicast)
 X86_TARGETS_DESC=	Build only x86 system targets
 STATIC_LINK_DESC=	Statically link the executables
-OPTIONS_DEFAULT=X11 GTK2 OPENGL GNUTLS SASL JPEG PNG CDROM_DMA CURL PCAP GNS3
+VDE_DESC=		vde dependency (for vde networking)
+OPTIONS_DEFAULT=X11 GTK3 OPENGL GNUTLS SASL JPEG PNG CDROM_DMA CURL PCAP GNS3 NCURSES VDE
 OPTIONS_SUB=	yes
 X11_USE=	SDL=sdl XORG=x11,xext GNOME=gdkpixbuf2
-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
+X11_USES=	sdl
+X11_CONFIGURE_ENABLE=	sdl
+GTK3_LIB_DEPENDS=	libxkbcommon.so:x11/libxkbcommon
+GTK3_USE=	GNOME=gdkpixbuf2,gtk30,vte3 XORG=x11,xext
+GTK3_USES=	gettext
+GTK3_CONFIGURE_OFF=	--disable-gtk --disable-vte
 GNUTLS_LIB_DEPENDS=	libgnutls.so:security/gnutls
 GNUTLS_CONFIGURE_OFF=	--disable-gnutls
 SASL_LIB_DEPENDS=	libsasl2.so:security/cyrus-sasl2
@@ -53,37 +68,38 @@ PNG_LIB_DEPENDS=	libpng.so:graphics/png
 PNG_CONFIGURE_OFF=	--disable-vnc-png
 CURL_LIB_DEPENDS=	libcurl.so:ftp/curl
 CURL_CONFIGURE_OFF=	--disable-curl
-OPENGL_USE=	GL=yes
+OPENGL_USE=	GL=gl
 OPENGL_CONFIGURE_OFF=	--disable-opengl
 USBREDIR_BUILD_DEPENDS=	usbredir>=0.6:net/usbredir
 USBREDIR_RUN_DEPENDS=	usbredir>=0.6:net/usbredir
 USBREDIR_CONFIGURE_OFF=	--disable-usb-redir
 PCAP_CONFIGURE_ON=	--enable-pcap
-PCAP_EXTRA_PATCHES=	${FILESDIR}/pcap-patch ${FILESDIR}/pcap-patch-net_net.c
+PCAP_EXTRA_PATCHES=	${FILESDIR}/pcap-patch-qapi_net.json ${FILESDIR}/pcap-patch-net_net.c \
+			${FILESDIR}/pcap-patch-net_clients.h
+VDE_LIB_DEPENDS=	libvdeplug.so:net/vde2
+VDE_CONFIGURE_OFF=	--disable-vde
 STATIC_LINK_CONFIGURE_ON=	--static
-STATIC_LINK_PREVENTS=		GTK2 X11
+STATIC_LINK_PREVENTS=		GTK3 X11
 STATIC_LINK_PREVENTS_MSG=	X11 ui cannot be built static
+NCURSES_USES=		ncurses:base
 SAMBA_USES=		samba:run # smbd
+SAMBA_CONFIGURE_ON=	--smbd=${LOCALBASE}/sbin/smbd
 DOCS_BUILD_DEPENDS=	texi2html:textproc/texi2html
 DOCS_USES=		makeinfo
 DOCS_MAKE_ARGS_OFF=	NOPORTDOCS=1
 
-PORTDOCS=	docs qemu-doc.html qemu-tech.html qmp-commands.txt
+PORTDOCS=	docs qemu-doc.html qemu-doc.txt qemu-ga-ref.html qemu-ga-ref.txt \
+	       	qemu-qmp-ref.html qemu-qmp-ref.txt
 
 WITHOUT_CPU_CFLAGS=yes	#to avoid problems with register allocation
 CFLAGS:=	${CFLAGS:C/-fno-tree-vrp//}
-LDFLAGS+=	-L${OPENSSLLIB} -lcrypto
-CONFIGURE_ARGS+=--localstatedir=/var --extra-ldflags=-L\"${LOCALBASE}/lib\" \
-		--disable-libssh2 --enable-debug \
-		--prefix=${PREFIX} --cc=${CC} --enable-docs --disable-kvm \
+CONFIGURE_ARGS=	--localstatedir=/var --extra-ldflags=-L\"/usr/lib\" \
+		--extra-ldflags=-L\"${LOCALBASE}/lib\" --disable-libssh2 --enable-debug \
+		--prefix=${PREFIX} --cc=${CC} --enable-netmap --enable-docs --disable-kvm \
 		--disable-linux-user --disable-linux-aio --disable-xen \
-		--smbd=${LOCALBASE}/sbin/smbd --enable-debug-info --python=${PYTHON_CMD} \
+		--enable-debug-info --python=${PYTHON_CMD} \
 		--extra-cflags=-I${WRKSRC}\ -I${LOCALBASE}/include\ -DPREFIX=\\\"\"${PREFIX}\\\"\"
 
-LIB_DEPENDS+=	libnettle.so:security/nettle \
-		libfontconfig.so:x11-fonts/fontconfig \
-		libfreetype.so:print/freetype2
-
 .include <bsd.port.options.mk>
 
 .if !defined(STRIP) || ${STRIP} == ""
@@ -106,6 +122,8 @@ MAKE_ARGS+=	ARCH=ppc64
 CONFIGURE_ARGS+=	--sparc_cpu=v9
 .endif
 
+PLIST_SUB+=	LINUXBOOT_DMA=""
+
 # -lprocstat actually only _needs_ -lelf after r249666 or r250870 (MFC)
 # but it shouldn't matter much
 post-patch:
@@ -129,7 +147,7 @@ post-patch:
 		${WRKSRC}/scripts/texi2pod.pl
 
 post-patch-CDROM_DMA-off:
-	@${REINPLACE_CMD} -e '/USE_DMA_CDROM/d' ${WRKSRC}/hw/ide/internal.h
+	@${REINPLACE_CMD} -e '/USE_DMA_CDROM/d' ${WRKSRC}/include/hw/ide/internal.h
 
 post-patch-GNS3-on:
 	@${REINPLACE_CMD} -e 's|(buf\[0\] & 1) && (rctl & E1000_RCTL_MPE)|buf[0] \& 1|' \
@@ -147,7 +165,6 @@ post-install:
 	${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}/)

Modified: head/emulators/qemu-devel/distinfo
==============================================================================
--- head/emulators/qemu-devel/distinfo	Thu Feb 28 01:24:25 2019	(r494121)
+++ head/emulators/qemu-devel/distinfo	Thu Feb 28 01:52:17 2019	(r494122)
@@ -1,3 +1,3 @@
-TIMESTAMP = 1464473023
-SHA256 (qemu-2.6.0.tar.bz2) = c9ac4a651b273233d21b8bec32e30507cb9cce7900841febc330956a1a8434ec
-SIZE (qemu-2.6.0.tar.bz2) = 25755267
+TIMESTAMP = 1551235571
+SHA256 (qemu/3.1.0/qemu-3.1.0.tar.xz) = 6a0508df079a0a33c2487ca936a56c12122f105b8a96a44374704bef6c69abfc
+SIZE (qemu/3.1.0/qemu-3.1.0.tar.xz) = 36070104

Modified: head/emulators/qemu-devel/files/patch-Makefile
==============================================================================
--- head/emulators/qemu-devel/files/patch-Makefile	Thu Feb 28 01:24:25 2019	(r494121)
+++ head/emulators/qemu-devel/files/patch-Makefile	Thu Feb 28 01:52:17 2019	(r494122)
@@ -1,25 +1,42 @@
---- Makefile.orig	2016-04-14 20:19:53 UTC
+--- Makefile.orig	2018-12-11 17:44:34 UTC
 +++ Makefile
-@@ -90,7 +90,11 @@ LIBS+=-lz $(LIBS_TOOLS)
- HELPERS-$(CONFIG_LINUX) = qemu-bridge-helper$(EXESUF)
+@@ -353,9 +353,14 @@ LIBS+=-lz $(LIBS_TOOLS)
+ HELPERS-$(call land,$(CONFIG_SOFTMMU),$(CONFIG_LINUX)) = qemu-bridge-helper$(EXESUF)
  
  ifdef BUILD_DOCS
 +ifdef NOPORTDOCS
 +DOCS=qemu.1 qemu-img.1 qemu-nbd.8 qemu-ga.8
++DOCS+=docs/interop/qemu-qmp-ref.7 docs/interop/qemu-ga-ref.7
 +else
- DOCS=qemu-doc.html qemu-tech.html qemu.1 qemu-img.1 qemu-nbd.8 qemu-ga.8
+ DOCS=qemu-doc.html qemu-doc.txt qemu.1 qemu-img.1 qemu-nbd.8 qemu-ga.8
+ DOCS+=docs/interop/qemu-qmp-ref.html docs/interop/qemu-qmp-ref.txt docs/interop/qemu-qmp-ref.7
+ DOCS+=docs/interop/qemu-ga-ref.html docs/interop/qemu-ga-ref.txt docs/interop/qemu-ga-ref.7
 +endif
- DOCS+=qmp-commands.txt
- ifdef CONFIG_LINUX
- DOCS+=kvm_stat.1
-@@ -410,8 +414,10 @@ endif
+ DOCS+=docs/qemu-block-drivers.7
+ DOCS+=docs/qemu-cpu-models.7
+ ifdef CONFIG_VIRTFS
+@@ -823,11 +828,13 @@ BLOBS=
+ 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)"
+ 	$(INSTALL_DIR) "$(DESTDIR)$(qemu_docdir)"
+ 	$(INSTALL_DATA) qemu-doc.html "$(DESTDIR)$(qemu_docdir)"
+ 	$(INSTALL_DATA) qemu-doc.txt "$(DESTDIR)$(qemu_docdir)"
+ 	$(INSTALL_DATA) docs/interop/qemu-qmp-ref.html "$(DESTDIR)$(qemu_docdir)"
+ 	$(INSTALL_DATA) docs/interop/qemu-qmp-ref.txt "$(DESTDIR)$(qemu_docdir)"
 +endif
  ifdef CONFIG_POSIX
  	$(INSTALL_DIR) "$(DESTDIR)$(mandir)/man1"
  	$(INSTALL_DATA) qemu.1 "$(DESTDIR)$(mandir)/man1"
+@@ -842,8 +849,10 @@ ifneq ($(TOOLS),)
+ endif
+ ifneq (,$(findstring qemu-ga,$(TOOLS)))
+ 	$(INSTALL_DATA) qemu-ga.8 "$(DESTDIR)$(mandir)/man8"
++ifndef NOPORTDOCS
+ 	$(INSTALL_DATA) docs/interop/qemu-ga-ref.html "$(DESTDIR)$(qemu_docdir)"
+ 	$(INSTALL_DATA) docs/interop/qemu-ga-ref.txt "$(DESTDIR)$(qemu_docdir)"
++endif
+ 	$(INSTALL_DATA) docs/interop/qemu-ga-ref.7 "$(DESTDIR)$(mandir)/man7"
+ endif
+ endif

Modified: head/emulators/qemu-devel/files/patch-configure
==============================================================================
--- head/emulators/qemu-devel/files/patch-configure	Thu Feb 28 01:24:25 2019	(r494121)
+++ head/emulators/qemu-devel/files/patch-configure	Thu Feb 28 01:52:17 2019	(r494122)
@@ -1,35 +1,25 @@
---- configure.orig	2016-04-14 20:19:53 UTC
+--- configure.orig	2018-12-11 17:44:34 UTC
 +++ configure
-@@ -245,7 +245,7 @@ DSOSUF=".so"
+@@ -393,7 +393,7 @@ DSOSUF=".so"
  LDFLAGS_SHARED="-shared"
  modules="no"
  prefix="/usr/local"
 -mandir="\${prefix}/share/man"
 +mandir="\${prefix}/man"
  datadir="\${prefix}/share"
+ firmwarepath="\${prefix}/share/qemu-firmware"
  qemu_docdir="\${prefix}/share/doc/qemu"
- bindir="\${prefix}/bin"
-@@ -316,6 +316,10 @@ virglrenderer=""
- tpm="yes"
- libssh2=""
- vhdx=""
-+quorum="no"
+@@ -469,6 +469,9 @@ numa=""
+ tcmalloc="no"
+ jemalloc="no"
+ replication="yes"
 +pcap="no"
 +pcap_create="no"
 +bpf="no"
- numa=""
- tcmalloc="no"
- jemalloc="no"
-@@ -575,7 +579,7 @@ FreeBSD)
-   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"
- ;;
-@@ -878,6 +882,10 @@ for opt do
+ vxhs=""
+ bochs="yes"
+ cloop="yes"
+@@ -1097,6 +1100,10 @@ for opt do
    ;;
    --enable-vnc-png) vnc_png="yes"
    ;;
@@ -39,17 +29,8 @@
 +  ;;
    --disable-slirp) slirp="no"
    ;;
-   --disable-uuid) uuid="no"
-@@ -2157,7 +2165,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"
-@@ -2384,6 +2392,14 @@ if ! check_include "ifaddrs.h" ; then
+   --disable-vde) vde="no"
+@@ -2860,6 +2867,14 @@ if ! check_include "ifaddrs.h" ; then
  fi
  
  ##########################################
@@ -64,13 +45,25 @@
  # VTE probe
  
  if test "$vte" != "no"; then
-@@ -2526,6 +2542,50 @@ EOF
+@@ -4466,11 +4481,6 @@ fi
+ 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
  
+@@ -4984,7 +4994,51 @@ if test "$debug_stack_usage" = "yes"; then
+   fi
+ fi
+ 
 +##########################################
 +# pcap probe
-+
+ 
 +if test "$pcap" = "yes" -a "$pcap" != "no"; then
 +  cat > $TMPC << EOF
 +#include <pcap.h>
@@ -112,33 +105,19 @@
 +  fi
 +  libs_softmmu="$libpcap $libs_softmmu"
 +fi # test "$pcap"
- 
++
  ##########################################
- # VNC SASL detection
-@@ -3857,14 +3917,7 @@ fi
+ # check if we have open_by_handle_at
  
- # 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
- 
- # Search for bswap_32 function
-@@ -4769,6 +4834,7 @@ echo "Audio drivers     $audio_drv_list"
+@@ -6005,6 +6059,7 @@ echo "Audio drivers     $audio_drv_list"
  echo "Block whitelist (rw) $block_drv_rw_whitelist"
  echo "Block whitelist (ro) $block_drv_ro_whitelist"
  echo "VirtFS support    $virtfs"
 +echo "pcap support      $pcap"
+ echo "Multipath support $mpath"
  echo "VNC support       $vnc"
  if test "$vnc" = "yes" ; then
-     echo "VNC SASL support  $vnc_sasl"
-@@ -4950,6 +5016,15 @@ fi
+@@ -6240,6 +6295,15 @@ fi
  if test "$profiler" = "yes" ; then
    echo "CONFIG_PROFILER=y" >> $config_host_mak
  fi
@@ -154,13 +133,13 @@
  if test "$slirp" = "yes" ; then
    echo "CONFIG_SLIRP=y" >> $config_host_mak
    echo "CONFIG_SMBD_COMMAND=\"$smbd\"" >> $config_host_mak
-@@ -5153,6 +5228,9 @@ fi
- if test "$have_ifaddrs_h" = "yes" ; then
-     echo "HAVE_IFADDRS_H=y" >> $config_host_mak
- fi
+@@ -6470,6 +6534,9 @@ fi
+ # if this macro is set.
+ if test "$have_fsxattr" = "yes" ; then
+     echo "HAVE_FSXATTR=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
+ fi
+ if test "$have_copy_file_range" = "yes" ; then
+     echo "HAVE_COPY_FILE_RANGE=y" >> $config_host_mak

Modified: head/emulators/qemu-devel/files/patch-include_qemu_atomic.h
==============================================================================
--- head/emulators/qemu-devel/files/patch-include_qemu_atomic.h	Thu Feb 28 01:24:25 2019	(r494121)
+++ head/emulators/qemu-devel/files/patch-include_qemu_atomic.h	Thu Feb 28 01:52:17 2019	(r494122)
@@ -1,6 +1,6 @@
---- include/qemu/atomic.h.orig	2016-06-02 18:20:47 UTC
+--- include/qemu/atomic.h.orig	2017-04-20 14:57:00 UTC
 +++ include/qemu/atomic.h
-@@ -136,10 +136,12 @@
+@@ -182,10 +182,12 @@
  /* Provide shorter names for GCC atomic builtins, return old value */
  #define atomic_fetch_inc(ptr)  __atomic_fetch_add(ptr, 1, __ATOMIC_SEQ_CST)
  #define atomic_fetch_dec(ptr)  __atomic_fetch_sub(ptr, 1, __ATOMIC_SEQ_CST)
@@ -10,19 +10,45 @@
  #define atomic_fetch_and(ptr, n) __atomic_fetch_and(ptr, n, __ATOMIC_SEQ_CST)
  #define atomic_fetch_or(ptr, n)  __atomic_fetch_or(ptr, n, __ATOMIC_SEQ_CST)
 +#endif
+ #define atomic_fetch_xor(ptr, n) __atomic_fetch_xor(ptr, n, __ATOMIC_SEQ_CST)
  
+ #define atomic_inc_fetch(ptr)    __atomic_add_fetch(ptr, 1, __ATOMIC_SEQ_CST)
+@@ -199,10 +201,12 @@
  /* And even shorter names that return void.  */
  #define atomic_inc(ptr)    ((void) __atomic_fetch_add(ptr, 1, __ATOMIC_SEQ_CST))
-@@ -330,10 +332,12 @@
- /* Provide shorter names for GCC atomic builtins.  */
- #define atomic_fetch_inc(ptr)  __sync_fetch_and_add(ptr, 1)
- #define atomic_fetch_dec(ptr)  __sync_fetch_and_add(ptr, -1)
+ #define atomic_dec(ptr)    ((void) __atomic_fetch_sub(ptr, 1, __ATOMIC_SEQ_CST))
 +#ifndef __cplusplus
- #define atomic_fetch_add       __sync_fetch_and_add
- #define atomic_fetch_sub       __sync_fetch_and_sub
- #define atomic_fetch_and       __sync_fetch_and_and
- #define atomic_fetch_or        __sync_fetch_and_or
+ #define atomic_add(ptr, n) ((void) __atomic_fetch_add(ptr, n, __ATOMIC_SEQ_CST))
+ #define atomic_sub(ptr, n) ((void) __atomic_fetch_sub(ptr, n, __ATOMIC_SEQ_CST))
+ #define atomic_and(ptr, n) ((void) __atomic_fetch_and(ptr, n, __ATOMIC_SEQ_CST))
+ #define atomic_or(ptr, n)  ((void) __atomic_fetch_or(ptr, n, __ATOMIC_SEQ_CST))
 +#endif
- #define atomic_cmpxchg         __sync_val_compare_and_swap
+ #define atomic_xor(ptr, n) ((void) __atomic_fetch_xor(ptr, n, __ATOMIC_SEQ_CST))
  
+ #else /* __ATOMIC_RELAXED */
+@@ -370,10 +374,12 @@
+ 
+ #define atomic_inc_fetch(ptr)  __sync_add_and_fetch(ptr, 1)
+ #define atomic_dec_fetch(ptr)  __sync_add_and_fetch(ptr, -1)
++#ifndef __cplusplus
+ #define atomic_add_fetch(ptr, n) __sync_add_and_fetch(ptr, n)
+ #define atomic_sub_fetch(ptr, n) __sync_sub_and_fetch(ptr, n)
+ #define atomic_and_fetch(ptr, n) __sync_and_and_fetch(ptr, n)
+ #define atomic_or_fetch(ptr, n) __sync_or_and_fetch(ptr, n)
++#endif
+ #define atomic_xor_fetch(ptr, n) __sync_xor_and_fetch(ptr, n)
+ 
+ #define atomic_cmpxchg(ptr, old, new) __sync_val_compare_and_swap(ptr, old, new)
+@@ -382,10 +388,12 @@
  /* And even shorter names that return void.  */
+ #define atomic_inc(ptr)        ((void) __sync_fetch_and_add(ptr, 1))
+ #define atomic_dec(ptr)        ((void) __sync_fetch_and_add(ptr, -1))
++#ifndef __cplusplus
+ #define atomic_add(ptr, n)     ((void) __sync_fetch_and_add(ptr, n))
+ #define atomic_sub(ptr, n)     ((void) __sync_fetch_and_sub(ptr, n))
+ #define atomic_and(ptr, n)     ((void) __sync_fetch_and_and(ptr, n))
+ #define atomic_or(ptr, n)      ((void) __sync_fetch_and_or(ptr, n))
++#endif
+ #define atomic_xor(ptr, n)     ((void) __sync_fetch_and_xor(ptr, n))
+ 
+ #endif /* __ATOMIC_RELAXED */

Added: head/emulators/qemu-devel/files/pcap-patch-net_clients.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/emulators/qemu-devel/files/pcap-patch-net_clients.h	Thu Feb 28 01:52:17 2019	(r494122)
@@ -0,0 +1,13 @@
+--- net/clients.h.orig	2018-04-24 16:30:47 UTC
++++ net/clients.h
+@@ -61,4 +61,10 @@ int net_init_netmap(const Netdev *netdev, const char *
+ int net_init_vhost_user(const Netdev *netdev, const char *name,
+                         NetClientState *peer, Error **errp);
+ 
++#ifdef CONFIG_PCAP
++int net_init_pcap(const Netdev *netdev, const char *name,
++                    NetClientState *peer, Error **errp);
++#endif
++
++
+ #endif /* QEMU_NET_CLIENTS_H */

Modified: head/emulators/qemu-devel/files/pcap-patch-net_net.c
==============================================================================
--- head/emulators/qemu-devel/files/pcap-patch-net_net.c	Thu Feb 28 01:24:25 2019	(r494121)
+++ head/emulators/qemu-devel/files/pcap-patch-net_net.c	Thu Feb 28 01:52:17 2019	(r494122)
@@ -1,6 +1,6 @@
---- net/net.c.orig	2016-04-14 20:19:54 UTC
+--- net/net.c.orig	2018-04-24 16:30:47 UTC
 +++ net/net.c
-@@ -48,6 +48,11 @@
+@@ -52,6 +52,11 @@
  #include "net/filter.h"
  #include "qapi/string-output-visitor.h"
  
@@ -12,7 +12,7 @@
  /* Net bridge is currently not supported for W32. */
  #if !defined(_WIN32)
  # define CONFIG_NET_BRIDGE
-@@ -931,7 +936,223 @@ static int net_init_nic(const NetClientO
+@@ -929,7 +934,225 @@ static int net_init_nic(const Netdev *netdev, const ch
      return idx;
  }
  
@@ -22,7 +22,7 @@
 +#include <net/bpf.h>
 +#endif
 +#include <pcap.h>
-+
+ 
 +struct PCAPState {
 +    NetClientState     nc;
 +    pcap_t            *handle;
@@ -75,7 +75,7 @@
 +}
 +
 +static NetClientInfo net_pcap_info = {
-+    .type = NET_CLIENT_OPTIONS_KIND_PCAP,
++    .type = NET_CLIENT_DRIVER_PCAP,
 +    .size = sizeof(struct PCAPState),
 +    .receive = pcap_receive,
 +//    .receive_raw = pcap_receive_raw,
@@ -87,10 +87,10 @@
 + * ... -net pcap,ifname="..."
 + */
 +
-+int net_init_pcap(const NetClientOptions *opts,
++int net_init_pcap(const Netdev *netdev,
 +    const char *name, NetClientState *peer, Error **errp)
 +{
-+    const NetdevPcapOptions *pcap_opts = opts->u.pcap.data;
++    const NetdevPcapOptions *pcap_opts;
 +    NetClientState *nc;
 +    struct PCAPState *s;
 +    const char *ifname;
@@ -100,6 +100,8 @@
 +#endif
 +    int i;
 +
++    assert(netdev->type == NET_CLIENT_DRIVER_PCAP);
++    pcap_opts = &netdev->u.pcap;
 +    if (!pcap_opts->has_ifname)
 +        return -1;
 +
@@ -113,13 +115,13 @@
 +        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.
++    * interface's mtu and assume the guest is configured the same.
 +     */
 +    s->max_eth_frame_size = 1514;
 +    i = socket(AF_INET, SOCK_DGRAM, 0);
@@ -147,7 +149,7 @@
 +        pcap_perror(s->handle, (char *)"qemu: pcap_set_promisc:");
 +        goto fail;
 +    }
-+    if (pcap_activate(s->handle) != 0) {
++   if (pcap_activate(s->handle) != 0) {
 +        pcap_perror(s->handle, (char *)"qemu: pcap_activate:");
 +        goto fail;
 +    }
@@ -233,16 +235,16 @@
 +
 +#endif
 + 
- static int (* const net_client_init_fun[NET_CLIENT_OPTIONS_KIND__MAX])(
-     const NetClientOptions *opts,
+ static int (* const net_client_init_fun[NET_CLIENT_DRIVER__MAX])(
+     const Netdev *netdev,
      const char *name,
-@@ -952,6 +1172,9 @@ static int (* const net_client_init_fun[
- #ifdef CONFIG_NET_BRIDGE
-         [NET_CLIENT_OPTIONS_KIND_BRIDGE]    = net_init_bridge,
+@@ -955,6 +1178,9 @@ static int (* const net_client_init_fun[NET_CLIENT_DRI
  #endif
-+#ifdef CONFIG_PCAP
-+	[NET_CLIENT_OPTIONS_KIND_PCAP]      = net_init_pcap,
+ #ifdef CONFIG_L2TPV3
+         [NET_CLIENT_DRIVER_L2TPV3]    = net_init_l2tpv3,
 +#endif
-         [NET_CLIENT_OPTIONS_KIND_HUBPORT]   = net_init_hubport,
- #ifdef CONFIG_VHOST_NET_USED
-         [NET_CLIENT_OPTIONS_KIND_VHOST_USER] = net_init_vhost_user,
++#ifdef CONFIG_PCAP
++	[NET_CLIENT_DRIVER_PCAP]      = net_init_pcap,
+ #endif
+ };
+ 

Added: head/emulators/qemu-devel/files/pcap-patch-qapi_net.json
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/emulators/qemu-devel/files/pcap-patch-qapi_net.json	Thu Feb 28 01:52:17 2019	(r494122)
@@ -0,0 +1,56 @@
+--- qapi/net.json.orig	2018-04-24 16:30:47 UTC
++++ qapi/net.json
+@@ -388,6 +388,19 @@
+     '*helper': 'str' } }
+ 
+ ##
++# @NetdevPcapOptions:
++#
++# Use ifname as a source to capture
++#
++# @ifname: #required to determine which interface to capture
++#
++# Since: 1.2
++##
++{ 'struct': 'NetdevPcapOptions',
++  'data': {
++    '*ifname':     'str' } }
++
++##
+ # @NetdevHubPortOptions:
+ #
+ # Connect two or more net clients through a software hub.
+@@ -454,7 +467,7 @@
+ ##
+ { 'enum': 'NetClientDriver',
+   'data': [ 'none', 'nic', 'user', 'tap', 'l2tpv3', 'socket', 'vde',
+-            'bridge', 'hubport', 'netmap', 'vhost-user' ] }
++            'bridge', 'hubport', 'netmap', 'vhost-user', 'pcap' ] }
+ 
+ ##
+ # @Netdev:
+@@ -478,6 +491,7 @@
+     'user':     'NetdevUserOptions',
+     'tap':      'NetdevTapOptions',
+     'l2tpv3':   'NetdevL2TPv3Options',
++    'pcap':     'NetdevPcapOptions',
+     'socket':   'NetdevSocketOptions',
+     'vde':      'NetdevVdeOptions',
+     'bridge':   'NetdevBridgeOptions',
+@@ -514,7 +528,7 @@
+ ##
+ { 'enum': 'NetLegacyOptionsType',
+   'data': ['none', 'nic', 'user', 'tap', 'l2tpv3', 'socket', 'vde',
+-           'bridge', 'netmap', 'vhost-user'] }
++           'bridge', 'netmap', 'vhost-user', 'pcap'] }
+ 
+ ##
+ # @NetLegacyOptions:
+@@ -532,6 +546,7 @@
+     'user':     'NetdevUserOptions',
+     'tap':      'NetdevTapOptions',
+     'l2tpv3':   'NetdevL2TPv3Options',
++    'pcap':     'NetdevPcapOptions',
+     'socket':   'NetdevSocketOptions',
+     'vde':      'NetdevVdeOptions',
+     'bridge':   'NetdevBridgeOptions',

Modified: head/emulators/qemu-devel/pkg-plist
==============================================================================
--- head/emulators/qemu-devel/pkg-plist	Thu Feb 28 01:24:25 2019	(r494121)
+++ head/emulators/qemu-devel/pkg-plist	Thu Feb 28 01:52:17 2019	(r494122)
@@ -1,9 +1,9 @@
-bin/ivshmem-server
-bin/ivshmem-client
+bin/qemu-edid
 bin/qemu-ga
 bin/qemu-i386
 bin/qemu-img
 bin/qemu-io
+%%GTK3%%bin/qemu-keymap
 bin/qemu-nbd
 %%NO_X86_TARGETS%%bin/qemu-sparc
 %%NO_X86_TARGETS%%bin/qemu-sparc64
@@ -11,6 +11,7 @@ bin/qemu-nbd
 %%NO_X86_TARGETS%%bin/qemu-system-alpha
 %%NO_X86_TARGETS%%bin/qemu-system-arm
 %%NO_X86_TARGETS%%bin/qemu-system-cris
+%%NO_X86_TARGETS%%bin/qemu-system-hppa
 bin/qemu-system-i386
 %%NO_X86_TARGETS%%bin/qemu-system-lm32
 %%NO_X86_TARGETS%%bin/qemu-system-m68k
@@ -21,10 +22,12 @@ bin/qemu-system-i386
 %%NO_X86_TARGETS%%bin/qemu-system-mips64el
 %%NO_X86_TARGETS%%bin/qemu-system-mipsel
 %%NO_X86_TARGETS%%bin/qemu-system-moxie
-%%NO_X86_TARGETS%%bin/qemu-system-or32
+%%NO_X86_TARGETS%%bin/qemu-system-nios2
+%%NO_X86_TARGETS%%bin/qemu-system-or1k
 %%NO_X86_TARGETS%%bin/qemu-system-ppc
 %%NO_X86_TARGETS%%bin/qemu-system-ppc64
-%%NO_X86_TARGETS%%bin/qemu-system-ppcemb
+%%NO_X86_TARGETS%%bin/qemu-system-riscv32
+%%NO_X86_TARGETS%%bin/qemu-system-riscv64
 %%NO_X86_TARGETS%%bin/qemu-system-s390x
 %%NO_X86_TARGETS%%bin/qemu-system-sh4
 %%NO_X86_TARGETS%%bin/qemu-system-sh4eb
@@ -38,21 +41,31 @@ bin/qemu-system-x86_64
 bin/qemu-x86_64
 man/man1/qemu.1.gz
 man/man1/qemu-img.1.gz
+man/man7/qemu-block-drivers.7.gz
+man/man7/qemu-cpu-models.7.gz
+man/man7/qemu-ga-ref.7.gz
+man/man7/qemu-qmp-ref.7.gz
 man/man8/qemu-ga.8.gz
 man/man8/qemu-nbd.8.gz
 @sample etc/qemu-ifup.sample
 @sample etc/qemu-ifdown.sample
 %%DATADIR%%/QEMU,tcx.bin
 %%DATADIR%%/QEMU,cgthree.bin
-%%DATADIR%%/acpi-dsdt.aml
 %%DATADIR%%/bios-256k.bin
 %%DATADIR%%/bios.bin
+%%DATADIR%%/canyonlands.dtb
 %%DATADIR%%/efi-e1000.rom
+%%DATADIR%%/efi-e1000e.rom
 %%DATADIR%%/efi-eepro100.rom
 %%DATADIR%%/efi-ne2k_pci.rom
 %%DATADIR%%/efi-pcnet.rom
 %%DATADIR%%/efi-rtl8139.rom
 %%DATADIR%%/efi-virtio.rom
+%%DATADIR%%/efi-vmxnet3.rom
+%%DATADIR%%/hppa-firmware.img
+%%DATADIR%%/qemu_vga.ndrv
+%%DATADIR%%/s390-netboot.img
+%%DATADIR%%/u-boot-sam460-20100605.bin
 %%DATADIR%%/vgabios.bin
 %%DATADIR%%/vgabios-cirrus.bin
 %%DATADIR%%/vgabios-qxl.bin
@@ -75,14 +88,16 @@ man/man8/qemu-nbd.8.gz
 %%DATADIR%%/slof.bin
 %%DATADIR%%/s390-ccw.img
 %%DATADIR%%/linuxboot.bin
+%%LINUXBOOT_DMA%%%%DATADIR%%/linuxboot_dma.bin
 %%DATADIR%%/multiboot.bin
 %%DATADIR%%/sgabios.bin
+%%DATADIR%%/skiboot.lid
+%%DATADIR%%/trace-events-all
 %%DATADIR%%/petalogix-s3adsp1800.dtb
 %%DATADIR%%/bamboo.dtb
 %%DATADIR%%/kvmvapic.bin
 %%DATADIR%%/qemu-icon.bmp
 %%DATADIR%%/qemu_logo_no_text.svg
-%%DATADIR%%/trace-events
 %%DATADIR%%/u-boot.e500
 %%DATADIR%%/keymaps/ar
 %%DATADIR%%/keymaps/bepo
@@ -121,9 +136,12 @@ man/man8/qemu-nbd.8.gz
 %%DATADIR%%/keymaps/sv
 %%DATADIR%%/keymaps/th
 %%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
+%%DATADIR%%/vgabios-bochs-display.bin
+%%DATADIR%%/vgabios-ramfb.bin
+%%GTK3%%share/locale/bg/LC_MESSAGES/qemu.mo
+%%GTK3%%share/locale/de_DE/LC_MESSAGES/qemu.mo
+%%GTK3%%share/locale/fr_FR/LC_MESSAGES/qemu.mo
+%%GTK3%%share/locale/hu/LC_MESSAGES/qemu.mo
+%%GTK3%%share/locale/it/LC_MESSAGES/qemu.mo
+%%GTK3%%share/locale/tr/LC_MESSAGES/qemu.mo
+%%GTK3%%share/locale/zh_CN/LC_MESSAGES/qemu.mo


More information about the svn-ports-all mailing list