Skip to content

Commit

Permalink
Revert 455aa1e and c3767ed
Browse files Browse the repository at this point in the history
    commit c3767ed
    qemu-char: (Re-)connect for tcp_chr_write() unconnected writing

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

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

This patch reverts both.

Reported-by: Richard W.M. Jones <rjones@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit 6db0fdc)

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
  • Loading branch information
Anthony Liguori authored and mdroth committed Oct 12, 2012
1 parent 5d6ad62 commit 57683d6
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions qemu-char.c
Expand Up @@ -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;
}
}
Expand Down

0 comments on commit 57683d6

Please sign in to comment.