qemu-e2k/net
Daniel P. Berrange 6701e5514b Revert "Change net/socket.c to use socket_*() functions" again
This reverts commit 883e4f7624.

This code changed net/socket.c from using socket()+connect(),
to using socket_connect(). In theory this is great, but in
practice this has completely broken the ability to connect
the frontend and backend:

  $ ./x86_64-softmmu/qemu-system-x86_64 \
       -device e1000,id=e0,netdev=hn0,mac=DE:AD:BE:EF:AF:05 \
       -netdev socket,id=hn0,connect=localhost:1234
  qemu-system-x86_64: -device e1000,id=e0,netdev=hn0,mac=DE:AD:BE:EF:AF:05: Property 'e1000.netdev' can't find value 'hn0'

The old code would call net_socket_fd_init() synchronously,
while letting the connect() complete in the backgorund. The
new code moved net_socket_fd_init() so that it is only called
after connect() completes in the background.

Thus at the time we initialize the NIC frontend, the backend
does not exist.

The socket_connect() conversion as done is a bad fit for the
current code, since it did not try to change the way it deals
with async connection completion. Rather than try to fix this,
just revert the socket_connect() conversion entirely.

The code is about to be converted to use QIOChannel which
will let the problem be solved in a cleaner manner. This
revert is more suitable for stable branches in the meantime.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
2017-06-07 10:58:31 +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 char: make chr_fe_deinit() optionaly delete backend 2017-06-02 11:33:53 +04:00
colo.c net/colo: fix memory double free error 2017-03-06 11:46:02 +08:00
colo.h filter-rewriter: rewrite tcp packet to keep secondary connection 2016-09-27 17:54:22 +08:00
dump.c net/dump: Issue a warning for the deprecated "-net dump" 2017-05-23 10:10:38 +08:00
eth.c eth: Extend vlan stripping functions 2017-03-06 11:46:02 +08:00
filter-buffer.c
filter-mirror.c char: make chr_fe_deinit() optionaly delete backend 2017-06-02 11:33:53 +04:00
filter-replay.c record/replay: add network support 2017-01-06 10:38:00 +08:00
filter-rewriter.c filter-rewriter: skip net_checksum_calculate() while offset = 0 2017-03-06 11:46:02 +08:00
filter.c qtail: clean up direct access to tqe_prev field 2016-09-13 19:08:41 +02:00
hub.c qapi: Change Netdev into a flat union 2016-07-19 20:18:02 +02:00
hub.h
l2tpv3.c qapi: Change Netdev into a flat union 2016-07-19 20:18:02 +02:00
Makefile.objs net/tap: Replace tap-haiku.c and tap-aix.c by a generic tap-stub.c 2017-05-23 10:10:38 +08:00
net.c hmp / net: Mark host_net_add/remove as deprecated 2017-05-23 10:10:38 +08:00
netmap.c qapi: Change Netdev into a flat union 2016-07-19 20:18:02 +02:00
queue.c
slirp.c char: move CharBackend handling in char-fe unit 2017-06-02 11:33:53 +04:00
socket.c Revert "Change net/socket.c to use socket_*() functions" again 2017-06-07 10:58:31 +08:00
tap_int.h Clean up header guards that don't match their file name 2016-07-12 16:19:16 +02:00
tap-bsd.c tap-bsd: OpenBSD uses tap(4) now 2016-10-26 09:57:59 +08:00
tap-linux.c
tap-linux.h Clean up decorations and whitespace around header guards 2016-07-12 16:20:46 +02:00
tap-solaris.c
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
trace-events COLO-compare: Improve tcp compare trace event readability 2017-05-23 10:10:38 +08:00
util.c
util.h
vde.c qapi: Change Netdev into a flat union 2016-07-19 20:18:02 +02:00
vhost-user.c char: make chr_fe_deinit() optionaly delete backend 2017-06-02 11:33:53 +04:00