Change requested in launchpad bug #1288352
[packages/centos6/qemu.git] / 0201-Revert-455aa1e08-and-c3767ed0eb.patch
1 From 423df48a1277f20511f21f4d249ea977aa4fa721 Mon Sep 17 00:00:00 2001
2 From: Anthony Liguori <aliguori@us.ibm.com>
3 Date: Wed, 12 Sep 2012 14:34:07 -0500
4 Subject: [PATCH] Revert 455aa1e08 and c3767ed0eb
5
6     commit c3767ed0eb5d0bb25fe409ae5dec06e3411ff1b6
7     qemu-char: (Re-)connect for tcp_chr_write() unconnected writing
8
9 Has no hope of working because tcp_chr_connect() does not actually connect.
10
11 455aa1e08 just fixes the SEGV with server() but the attempt to connect a client
12 socket is still completely broken.
13
14 This patch reverts both.
15
16 Reported-by: Richard W.M. Jones <rjones@redhat.com>
17 Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
18 (cherry picked from commit 6db0fdce02d72546a4c47100a9b2cd0090cf464d)
19
20 Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
21 ---
22  qemu-char.c | 7 +------
23  1 file changed, 1 insertion(+), 6 deletions(-)
24
25 diff --git a/qemu-char.c b/qemu-char.c
26 index 767da93..10d1504 100644
27 --- a/qemu-char.c
28 +++ b/qemu-char.c
29 @@ -2141,18 +2141,13 @@ typedef struct {
30  
31  static void tcp_chr_accept(void *opaque);
32  
33 -static void tcp_chr_connect(void *opaque);
34 -
35  static int tcp_chr_write(CharDriverState *chr, const uint8_t *buf, int len)
36  {
37      TCPCharDriver *s = chr->opaque;
38      if (s->connected) {
39          return send_all(s->fd, buf, len);
40 -    } else if (s->listen_fd == -1) {
41 -        /* (Re-)connect for unconnected writing */
42 -        tcp_chr_connect(chr);
43 -        return 0;
44      } else {
45 +        /* XXX: indicate an error ? */
46          return len;
47      }
48  }
49 -- 
50 1.7.12.1
51