qemu-e2k/net
Thomas Huth 18d65d2258 net: Allow hubports to connect to other netdevs
QEMU can emulate hubs to connect NICs and netdevs. This is currently
primarily used for the mis-named 'vlan' feature of the networking
subsystem. Now the 'vlan' feature has been marked as deprecated, since
its name is rather confusing and the users often rather mis-configure
their network when trying to use it. But while the 'vlan' parameter
should be removed at one point in time, the basic idea of emulating
a hub in QEMU is still good: It's useful for bundling up the output of
multiple NICs into one single l2tp netdev for example.

Now to be able to use the hubport feature without 'vlan's, there is one
missing piece: The possibility to connect a hubport to a netdev, too.
This patch adds this possibility by introducing a new "netdev=..."
parameter to the hubports.

To bundle up the output of multiple NICs into one socket netdev, you can
now run QEMU with these parameters for example:

qemu-system-ppc64 ... -netdev socket,id=s1,connect=:11122 \
    -netdev hubport,hubid=1,id=h1,netdev=s1 \
    -netdev hubport,hubid=1,id=h2 -device e1000,netdev=h2 \
    -netdev hubport,hubid=1,id=h3 -device virtio-net-pci,netdev=h3

For using the socket netdev, you have got to start another QEMU as the
receiving side first, for example with network dumping enabled:

qemu-system-x86_64 -M isapc -netdev socket,id=s0,listen=:11122 \
    -device ne2k_isa,netdev=s0 \
    -object filter-dump,id=f1,netdev=s0,file=/tmp/dump.dat

After the ppc64 guest tried to boot from both NICs, you can see in the
dump file (using Wireshark, for example), that the output of both NICs
(the e1000 and the virtio-net-pci) has been successfully transfered
via the socket netdev in this case.

Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
2018-01-29 16:05:37 +08:00
..
Makefile.objs buildsys: Move vde libs to per object 2017-09-22 10:20:34 +08:00
checksum.c net: optimize checksum computation 2017-01-20 10:36:38 +08:00
clients.h net: use Netdev instead of NetClientOptions in client init 2016-07-19 13:21:08 +02:00
colo-compare.c colo: compare the packet based on the tcp sequence number 2018-01-29 16:05:37 +08:00
colo.c colo: compare the packet based on the tcp sequence number 2018-01-29 16:05:37 +08:00
colo.h colo: compare the packet based on the tcp sequence number 2018-01-29 16:05:37 +08:00
dump.c object: use more specific property type names 2017-06-20 14:31:32 +02:00
eth.c net/eth: fix incorrect check of iov_to_buf() return value 2017-07-31 13:06:38 +03:00
filter-buffer.c object: use more specific property type names 2017-06-20 14:31:32 +02:00
filter-mirror.c filter-mirror: segfault when specifying non existent device 2017-10-16 23:16:06 +03:00
filter-replay.c record/replay: add network support 2017-01-06 10:38:00 +08:00
filter-rewriter.c net/filter-rewriter.c: Fix rewirter checksum bug when use virtio-net 2017-09-08 08:17:35 +08:00
filter.c qapi: Change data type of the FOO_lookup generated for enum FOO 2017-09-04 13:09:13 +02:00
hub.c net: Allow hubports to connect to other netdevs 2018-01-29 16:05:37 +08:00
hub.h net: Allow hubports to connect to other netdevs 2018-01-29 16:05:37 +08:00
l2tpv3.c qapi: Change Netdev into a flat union 2016-07-19 20:18:02 +02:00
net.c net: Allow hubports to connect to other netdevs 2018-01-29 16:05:37 +08:00
netmap.c qapi: Change Netdev into a flat union 2016-07-19 20:18:02 +02:00
queue.c net: Clean up includes 2016-02-04 17:41:30 +00:00
slirp.c net: Remove the legacy "-net channel" parameter 2017-12-22 10:05:26 +08:00
socket.c net/socket: fix coverity issue 2017-11-13 18:05:12 +08:00
tap-bsd.c tap-bsd: OpenBSD uses tap(4) now 2016-10-26 09:57:59 +08:00
tap-linux.c Convert error_report() to warn_report() 2017-07-13 13:49:58 +02:00
tap-linux.h Clean up decorations and whitespace around header guards 2016-07-12 16:20:46 +02:00
tap-solaris.c util: move declarations out of qemu-common.h 2016-03-22 22:20:17 +01:00
tap-stub.c net/tap: Replace tap-haiku.c and tap-aix.c by a generic tap-stub.c 2017-05-23 10:10:38 +08:00
tap-win32.c qapi: Change Netdev into a flat union 2016-07-19 20:18:02 +02:00
tap.c -----BEGIN PGP SIGNATURE----- 2017-01-20 14:56:40 +00:00
tap_int.h Clean up header guards that don't match their file name 2016-07-12 16:19:16 +02:00
trace-events colo: compare the packet based on the tcp sequence number 2018-01-29 16:05:37 +08:00
util.c net: Clean up includes 2016-02-04 17:41:30 +00:00
util.h all: Clean up includes 2016-02-23 12:43:05 +00:00
vde.c qapi: Change Netdev into a flat union 2016-07-19 20:18:02 +02:00
vhost-user.c vhost-user: fix watcher need be removed when vhost-user hotplug 2017-08-02 00:13:26 +03:00