mirror of
https://git.FreeBSD.org/ports.git
synced 2025-01-25 09:34:11 +00:00
emulators/qemu: Update version 2.6.1=>2.8.0
- Fix ncurses build uses to use base version and remove from CONFIGURE_ARGS for OPTIONS usage [1] PR: 211973[1] Submitted by: ilavsky.martin@gmail.com[1]
This commit is contained in:
parent
49c1a90d13
commit
cf2484d8a1
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=435826
@ -2,13 +2,12 @@
|
||||
# $FreeBSD$
|
||||
|
||||
PORTNAME= qemu
|
||||
PORTVERSION= 2.6.1
|
||||
PORTREVISION= 1
|
||||
PORTVERSION= 2.8.0
|
||||
CATEGORIES= emulators
|
||||
MASTER_SITES= http://wiki.qemu.org/download/
|
||||
DIST_SUBDIR= qemu/${PORTVERSION}
|
||||
|
||||
MAINTAINER= bofh@FreeBSD.org
|
||||
MAINTAINER?= bofh@FreeBSD.org
|
||||
COMMENT?= QEMU CPU Emulator
|
||||
|
||||
LICENSE= GPLv2
|
||||
@ -60,7 +59,8 @@ 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 ${FILESDIR}/pcap-patch-net_net.c \
|
||||
${FILESDIR}/pcap-patch-net_clients.h
|
||||
STATIC_LINK_CONFIGURE_ON= --static
|
||||
STATIC_LINK_PREVENTS= GTK2 X11
|
||||
STATIC_LINK_PREVENTS_MSG= X11 ui cannot be built static
|
||||
@ -70,12 +70,12 @@ 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 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 \
|
||||
CONFIGURE_ARGS?=--localstatedir=/var --extra-ldflags=-L\"/usr/lib\" \
|
||||
--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} \
|
||||
@ -107,6 +107,13 @@ MAKE_ARGS+= ARCH=ppc64
|
||||
CONFIGURE_ARGS+= --sparc_cpu=v9
|
||||
.endif
|
||||
|
||||
# clang in freebsd 10 is unable to assemble linuxboot_dma.bin
|
||||
.if (${OSVERSION} < 1100000)
|
||||
PLIST_SUB+= LINUXBOOT_DMA="@comment "
|
||||
.else
|
||||
PLIST_SUB+= LINUXBOOT_DMA=""
|
||||
.endif
|
||||
|
||||
# -lprocstat actually only _needs_ -lelf after r249666 or r250870 (MFC)
|
||||
# but it shouldn't matter much
|
||||
post-patch:
|
||||
@ -128,6 +135,15 @@ post-patch:
|
||||
@${REINPLACE_CMD} -E \
|
||||
-e "1s|^(#! )/usr/bin/perl|\1${PERL}|" \
|
||||
${WRKSRC}/scripts/texi2pod.pl
|
||||
# clang in freebsd 10 is unable to assemble linuxboot_dma.bin
|
||||
.if (${OSVERSION} < 1100000)
|
||||
@${REINPLACE_CMD} -E \
|
||||
-e 's|linuxboot_dma.bin||' \
|
||||
${WRKSRC}/pc-bios/optionrom/Makefile
|
||||
@${REINPLACE_CMD} -E \
|
||||
-e 's|linuxboot_dma.bin||' \
|
||||
${WRKSRC}/Makefile
|
||||
.endif
|
||||
|
||||
post-patch-CDROM_DMA-off:
|
||||
@${REINPLACE_CMD} -e '/USE_DMA_CDROM/d' ${WRKSRC}/hw/ide/internal.h
|
||||
|
@ -1,3 +1,3 @@
|
||||
TIMESTAMP = 1471559363
|
||||
SHA256 (qemu/2.6.1/qemu-2.6.1.tar.bz2) = 4942fd1b6ee31f2f55ffc2201dd7397e6b9c55a2ef332e6d660c730d268e08d1
|
||||
SIZE (qemu/2.6.1/qemu-2.6.1.tar.bz2) = 25762855
|
||||
SHA256 (qemu/2.8.0/qemu-2.8.0.tar.bz2) = dafd5d7f649907b6b617b822692f4c82e60cf29bc0fc58bc2036219b591e5e62
|
||||
SIZE (qemu/2.8.0/qemu-2.8.0.tar.bz2) = 28368517
|
||||
|
@ -1,24 +1,25 @@
|
||||
--- Makefile.orig 2016-04-14 20:19:53 UTC
|
||||
+++ Makefile
|
||||
@@ -90,7 +90,11 @@ LIBS+=-lz $(LIBS_TOOLS)
|
||||
--- Makefile.orig 2016-12-20 13:16:43.000000000 -0700
|
||||
+++ Makefile 2017-03-05 08:08:54.529466000 -0700
|
||||
@@ -90,7 +90,11 @@
|
||||
HELPERS-$(CONFIG_LINUX) = qemu-bridge-helper$(EXESUF)
|
||||
|
||||
ifdef BUILD_DOCS
|
||||
+ifdef NOPORTDOCS
|
||||
+DOCS=qemu.1 qemu-img.1 qemu-nbd.8 qemu-ga.8
|
||||
+else
|
||||
DOCS=qemu-doc.html qemu-tech.html qemu.1 qemu-img.1 qemu-nbd.8 qemu-ga.8
|
||||
DOCS=qemu-doc.html qemu.1 qemu-img.1 qemu-nbd.8 qemu-ga.8
|
||||
+endif
|
||||
DOCS+=qmp-commands.txt
|
||||
ifdef CONFIG_LINUX
|
||||
DOCS+=kvm_stat.1
|
||||
@@ -410,8 +414,10 @@ endif
|
||||
ifdef CONFIG_VIRTFS
|
||||
DOCS+=fsdev/virtfs-proxy-helper.1
|
||||
endif
|
||||
@@ -429,9 +433,11 @@
|
||||
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) $(SRC_PATH)/docs/qmp-commands.txt "$(DESTDIR)$(qemu_docdir)"
|
||||
+endif
|
||||
ifdef CONFIG_POSIX
|
||||
$(INSTALL_DIR) "$(DESTDIR)$(mandir)/man1"
|
||||
|
@ -1,6 +1,6 @@
|
||||
--- configure.orig 2016-04-14 20:19:53 UTC
|
||||
+++ configure
|
||||
@@ -245,7 +245,7 @@ DSOSUF=".so"
|
||||
--- configure.orig 2016-12-20 13:16:44.000000000 -0700
|
||||
+++ configure 2017-03-05 08:10:46.513171000 -0700
|
||||
@@ -247,7 +247,7 @@
|
||||
LDFLAGS_SHARED="-shared"
|
||||
modules="no"
|
||||
prefix="/usr/local"
|
||||
@ -9,27 +9,18 @@
|
||||
datadir="\${prefix}/share"
|
||||
qemu_docdir="\${prefix}/share/doc/qemu"
|
||||
bindir="\${prefix}/bin"
|
||||
@@ -316,6 +316,10 @@ virglrenderer=""
|
||||
tpm="yes"
|
||||
libssh2=""
|
||||
vhdx=""
|
||||
+quorum="no"
|
||||
@@ -322,6 +322,10 @@
|
||||
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
|
||||
+
|
||||
|
||||
# parse CC options first
|
||||
for opt do
|
||||
@@ -887,6 +891,10 @@
|
||||
;;
|
||||
--enable-vnc-png) vnc_png="yes"
|
||||
;;
|
||||
@ -39,8 +30,8 @@
|
||||
+ ;;
|
||||
--disable-slirp) slirp="no"
|
||||
;;
|
||||
--disable-uuid) uuid="no"
|
||||
@@ -2157,7 +2165,7 @@ if test "$gtk" != "no"; then
|
||||
--disable-vde) vde="no"
|
||||
@@ -2266,7 +2274,7 @@
|
||||
gtk_cflags="$gtk_cflags $x11_cflags"
|
||||
gtk_libs="$gtk_libs $x11_libs"
|
||||
fi
|
||||
@ -49,7 +40,7 @@
|
||||
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
|
||||
@@ -2485,6 +2493,14 @@
|
||||
fi
|
||||
|
||||
##########################################
|
||||
@ -64,7 +55,7 @@
|
||||
# VTE probe
|
||||
|
||||
if test "$vte" != "no"; then
|
||||
@@ -2526,6 +2542,50 @@ EOF
|
||||
@@ -2644,6 +2660,50 @@
|
||||
fi
|
||||
fi
|
||||
|
||||
@ -115,7 +106,7 @@
|
||||
|
||||
##########################################
|
||||
# VNC SASL detection
|
||||
@@ -3857,14 +3917,7 @@ fi
|
||||
@@ -3970,14 +4030,7 @@
|
||||
|
||||
# Check if tools are available to build documentation.
|
||||
if test "$docs" != "no" ; then
|
||||
@ -130,7 +121,7 @@
|
||||
fi
|
||||
|
||||
# Search for bswap_32 function
|
||||
@@ -4769,6 +4834,7 @@ echo "Audio drivers $audio_drv_list"
|
||||
@@ -5026,6 +5079,7 @@
|
||||
echo "Block whitelist (rw) $block_drv_rw_whitelist"
|
||||
echo "Block whitelist (ro) $block_drv_ro_whitelist"
|
||||
echo "VirtFS support $virtfs"
|
||||
@ -138,7 +129,7 @@
|
||||
echo "VNC support $vnc"
|
||||
if test "$vnc" = "yes" ; then
|
||||
echo "VNC SASL support $vnc_sasl"
|
||||
@@ -4950,6 +5016,15 @@ fi
|
||||
@@ -5204,6 +5258,15 @@
|
||||
if test "$profiler" = "yes" ; then
|
||||
echo "CONFIG_PROFILER=y" >> $config_host_mak
|
||||
fi
|
||||
@ -154,9 +145,9 @@
|
||||
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
|
||||
@@ -5415,6 +5478,9 @@
|
||||
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
|
||||
|
@ -1,6 +1,6 @@
|
||||
--- include/qemu/atomic.h.orig 2016-06-02 18:20:47 UTC
|
||||
+++ include/qemu/atomic.h
|
||||
@@ -136,10 +136,12 @@
|
||||
--- include/qemu/atomic.h.orig 2016-12-20 13:16:47.000000000 -0700
|
||||
+++ include/qemu/atomic.h 2017-03-05 08:15:48.793780000 -0700
|
||||
@@ -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 */
|
||||
|
@ -1,38 +0,0 @@
|
||||
--- 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 <sys/type32.h> */
|
||||
#undef HAVE_SYS_TYPES32_H
|
@ -1,44 +1,26 @@
|
||||
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, Error **errp);
|
||||
+#endif
|
||||
+
|
||||
int net_init_l2tpv3(const NetClientOptions *opts, const char *name,
|
||||
NetClientState *peer, Error **errp);
|
||||
#ifdef CONFIG_VDE
|
||||
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:
|
||||
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' } }
|
||||
--- qapi-schema.json.orig 2016-12-20 13:16:49.000000000 -0700
|
||||
+++ qapi-schema.json 2017-03-05 08:45:39.490366000 -0700
|
||||
@@ -2543,6 +2543,10 @@
|
||||
##
|
||||
{ 'command': 'netdev_del', 'data': {'id': 'str'} }
|
||||
|
||||
+{ 'struct': 'NetdevPcapOptions',
|
||||
+ 'data': {
|
||||
+ '*ifname': 'str' } }
|
||||
+
|
||||
##
|
||||
# @NetdevHubPortOptions
|
||||
# @object-add:
|
||||
#
|
||||
@@ -2608,6 +2612,7 @@
|
||||
@@ -2966,7 +2970,7 @@
|
||||
##
|
||||
{ 'enum': 'NetClientDriver',
|
||||
'data': [ 'none', 'nic', 'user', 'tap', 'l2tpv3', 'socket', 'vde', 'dump',
|
||||
- 'bridge', 'hubport', 'netmap', 'vhost-user' ] }
|
||||
+ 'bridge', 'hubport', 'netmap', 'vhost-user', 'pcap' ] }
|
||||
|
||||
##
|
||||
# @Netdev:
|
||||
@@ -2989,6 +2993,7 @@
|
||||
'nic': 'NetLegacyNicOptions',
|
||||
'user': 'NetdevUserOptions',
|
||||
'tap': 'NetdevTapOptions',
|
||||
@ -46,3 +28,11 @@ diff -ruN qapi-schema.json qapi-schema.json
|
||||
'l2tpv3': 'NetdevL2TPv3Options',
|
||||
'socket': 'NetdevSocketOptions',
|
||||
'vde': 'NetdevVdeOptions',
|
||||
@@ -3033,6 +3038,7 @@
|
||||
'nic': 'NetLegacyNicOptions',
|
||||
'user': 'NetdevUserOptions',
|
||||
'tap': 'NetdevTapOptions',
|
||||
+ 'pcap': 'NetdevPcapOptions',
|
||||
'l2tpv3': 'NetdevL2TPv3Options',
|
||||
'socket': 'NetdevSocketOptions',
|
||||
'vde': 'NetdevVdeOptions',
|
||||
|
13
emulators/qemu/files/pcap-patch-net_clients.h
Normal file
13
emulators/qemu/files/pcap-patch-net_clients.h
Normal file
@ -0,0 +1,13 @@
|
||||
--- net/clients.h.orig 2017-03-05 10:36:13.475005000 -0700
|
||||
+++ net/clients.h 2017-03-05 10:35:30.412539000 -0700
|
||||
@@ -61,4 +61,10 @@
|
||||
|
||||
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 */
|
@ -1,5 +1,5 @@
|
||||
--- net/net.c.orig 2016-04-14 20:19:54 UTC
|
||||
+++ net/net.c
|
||||
--- net/net.c.orig 2016-12-20 13:16:48.000000000 -0700
|
||||
+++ net/net.c 2017-03-05 08:04:17.606428000 -0700
|
||||
@@ -48,6 +48,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
|
||||
@@ -933,7 +938,225 @@
|
||||
return idx;
|
||||
}
|
||||
|
||||
@ -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;
|
||||
+ }
|
||||
@ -219,7 +221,7 @@
|
||||
+ }
|
||||
+ qemu_set_fd_handler(i, pcap_send, NULL, s);
|
||||
+#endif /* _WIN32 */
|
||||
+
|
||||
|
||||
+ return 0;
|
||||
+
|
||||
+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,
|
||||
@@ -961,6 +1182,9 @@
|
||||
#ifdef CONFIG_L2TPV3
|
||||
[NET_CLIENT_DRIVER_L2TPV3] = net_init_l2tpv3,
|
||||
#endif
|
||||
+#ifdef CONFIG_PCAP
|
||||
+ [NET_CLIENT_OPTIONS_KIND_PCAP] = net_init_pcap,
|
||||
+ [NET_CLIENT_DRIVER_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,
|
||||
};
|
||||
|
||||
|
||||
|
@ -48,11 +48,13 @@ man/man8/qemu-nbd.8.gz
|
||||
%%DATADIR%%/bios-256k.bin
|
||||
%%DATADIR%%/bios.bin
|
||||
%%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%%/vgabios.bin
|
||||
%%DATADIR%%/vgabios-cirrus.bin
|
||||
%%DATADIR%%/vgabios-qxl.bin
|
||||
@ -75,14 +77,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,6 +125,7 @@ man/man8/qemu-nbd.8.gz
|
||||
%%DATADIR%%/keymaps/sv
|
||||
%%DATADIR%%/keymaps/th
|
||||
%%DATADIR%%/keymaps/tr
|
||||
%%GTK2%%share/locale/bg/LC_MESSAGES/qemu.mo
|
||||
%%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
|
||||
|
Loading…
Reference in New Issue
Block a user