提交 6db0fdce 编写于 作者: A Anthony Liguori

Revert 455aa1e0 and c3767ed0

    commit c3767ed0
    qemu-char: (Re-)connect for tcp_chr_write() unconnected writing

Has no hope of working because tcp_chr_connect() does not actually connect.

455aa1e0 just fixes the SEGV with server() but the attempt to connect a client
socket is still completely broken.

This patch reverts both.
Reported-by: NRichard W.M. Jones <rjones@redhat.com>
Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
上级 ed0ec1aa
......@@ -2141,18 +2141,13 @@ typedef struct {
static void tcp_chr_accept(void *opaque);
static void tcp_chr_connect(void *opaque);
static int tcp_chr_write(CharDriverState *chr, const uint8_t *buf, int len)
{
TCPCharDriver *s = chr->opaque;
if (s->connected) {
return send_all(s->fd, buf, len);
} else if (s->listen_fd == -1) {
/* (Re-)connect for unconnected writing */
tcp_chr_connect(chr);
return 0;
} else {
/* XXX: indicate an error ? */
return len;
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册