dcavalca / rpms / qemu

Forked from rpms/qemu a year ago
Clone

Blame 0201-Revert-455aa1e08-and-c3767ed0eb.patch

5544c1
From 423df48a1277f20511f21f4d249ea977aa4fa721 Mon Sep 17 00:00:00 2001
5544c1
From: Anthony Liguori <aliguori@us.ibm.com>
5544c1
Date: Wed, 12 Sep 2012 14:34:07 -0500
5544c1
Subject: [PATCH] Revert 455aa1e08 and c3767ed0eb
5544c1
5544c1
    commit c3767ed0eb5d0bb25fe409ae5dec06e3411ff1b6
5544c1
    qemu-char: (Re-)connect for tcp_chr_write() unconnected writing
5544c1
5544c1
Has no hope of working because tcp_chr_connect() does not actually connect.
5544c1
5544c1
455aa1e08 just fixes the SEGV with server() but the attempt to connect a client
5544c1
socket is still completely broken.
5544c1
5544c1
This patch reverts both.
5544c1
5544c1
Reported-by: Richard W.M. Jones <rjones@redhat.com>
5544c1
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
5544c1
(cherry picked from commit 6db0fdce02d72546a4c47100a9b2cd0090cf464d)
5544c1
5544c1
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
5544c1
---
5544c1
 qemu-char.c | 7 +------
5544c1
 1 file changed, 1 insertion(+), 6 deletions(-)
5544c1
5544c1
diff --git a/qemu-char.c b/qemu-char.c
5544c1
index 767da93..10d1504 100644
5544c1
--- a/qemu-char.c
5544c1
+++ b/qemu-char.c
5544c1
@@ -2141,18 +2141,13 @@ typedef struct {
5544c1
 
5544c1
 static void tcp_chr_accept(void *opaque);
5544c1
 
5544c1
-static void tcp_chr_connect(void *opaque);
5544c1
-
5544c1
 static int tcp_chr_write(CharDriverState *chr, const uint8_t *buf, int len)
5544c1
 {
5544c1
     TCPCharDriver *s = chr->opaque;
5544c1
     if (s->connected) {
5544c1
         return send_all(s->fd, buf, len);
5544c1
-    } else if (s->listen_fd == -1) {
5544c1
-        /* (Re-)connect for unconnected writing */
5544c1
-        tcp_chr_connect(chr);
5544c1
-        return 0;
5544c1
     } else {
5544c1
+        /* XXX: indicate an error ? */
5544c1
         return len;
5544c1
     }
5544c1
 }
5544c1
-- 
5544c1
1.7.12.1
5544c1