• Daniel P. Berrange's avatar
    Revert "Change net/socket.c to use socket_*() functions" again · 6701e551
    Daniel P. Berrange authored
    This reverts commit 883e4f76.
    
    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: 's avatarDaniel P. Berrange <berrange@redhat.com>
    Reviewed-by: 's avatarStefan Hajnoczi <stefanha@redhat.com>
    Signed-off-by: 's avatarJason Wang <jasowang@redhat.com>
    6701e551
Name
Last commit
Last update
..
Makefile.objs Loading commit data...
checksum.c Loading commit data...
clients.h Loading commit data...
colo-compare.c Loading commit data...
colo.c Loading commit data...
colo.h Loading commit data...
dump.c Loading commit data...
eth.c Loading commit data...
filter-buffer.c Loading commit data...
filter-mirror.c Loading commit data...
filter-replay.c Loading commit data...
filter-rewriter.c Loading commit data...
filter.c Loading commit data...
hub.c Loading commit data...
hub.h Loading commit data...
l2tpv3.c Loading commit data...
net.c Loading commit data...
netmap.c Loading commit data...
queue.c Loading commit data...
slirp.c Loading commit data...
socket.c Loading commit data...
tap-bsd.c Loading commit data...
tap-linux.c Loading commit data...
tap-linux.h Loading commit data...
tap-solaris.c Loading commit data...
tap-stub.c Loading commit data...
tap-win32.c Loading commit data...
tap.c Loading commit data...
tap_int.h Loading commit data...
trace-events Loading commit data...
util.c Loading commit data...
util.h Loading commit data...
vde.c Loading commit data...
vhost-user.c Loading commit data...