Patchwork guest agent: qemu-ga, remove unused variables

login
register
mail settings
Submitter Michael Roth
Date July 20, 2011, 8 p.m.
Message ID <1311192014-21655-1-git-send-email-mdroth@linux.vnet.ibm.com>
Download mbox | patch
Permalink /patch/105983/
State New
Headers show

Comments

Michael Roth - July 20, 2011, 8 p.m.
---
 qemu-ga.c |   25 ++++---------------------
 1 files changed, 4 insertions(+), 21 deletions(-)

Patch

diff --git a/qemu-ga.c b/qemu-ga.c
index 4530d3d..6e2f61f 100644
--- a/qemu-ga.c
+++ b/qemu-ga.c
@@ -37,10 +37,8 @@ 
 struct GAState {
     JSONMessageParser parser;
     GMainLoop *main_loop;
-    guint conn_id;
     GSocket *conn_sock;
     GIOChannel *conn_channel;
-    guint listen_id;
     GSocket *listen_sock;
     GIOChannel *listen_channel;
     const char *path;
@@ -393,7 +391,6 @@  static gboolean conn_channel_read(GIOChannel *channel, GIOCondition condition,
 static int conn_channel_add(GAState *s, int fd)
 {
     GIOChannel *conn_channel;
-    guint conn_id;
     GError *err = NULL;
 
     g_assert(s && !s->conn_channel);
@@ -405,15 +402,9 @@  static int conn_channel_add(GAState *s, int fd)
         g_error_free(err);
         return -1;
     }
-    conn_id = g_io_add_watch(conn_channel, G_IO_IN | G_IO_HUP,
-                             conn_channel_read, s);
-    if (err != NULL) {
-        g_warning("error adding io watch: %s", err->message);
-        g_error_free(err);
-        return -1;
-    }
+    g_io_add_watch(conn_channel, G_IO_IN | G_IO_HUP,
+                   conn_channel_read, s);
     s->conn_channel = conn_channel;
-    s->conn_id = conn_id;
     return 0;
 }
 
@@ -450,7 +441,6 @@  out:
 static int listen_channel_add(GAState *s, int listen_fd, bool new)
 {
     GError *err = NULL;
-    guint listen_id;
 
     if (new) {
         s->listen_channel = g_io_channel_unix_new(listen_fd);
@@ -464,13 +454,8 @@  static int listen_channel_add(GAState *s, int listen_fd, bool new)
             return -1;
         }
     }
-    listen_id = g_io_add_watch(s->listen_channel, G_IO_IN,
-                               listen_channel_accept, s);
-    if (err != NULL) {
-        g_warning("error adding io watch: %s", err->message);
-        g_error_free(err);
-        return -1;
-    }
+    g_io_add_watch(s->listen_channel, G_IO_IN,
+                   listen_channel_accept, s);
     return 0;
 }
 
@@ -494,7 +479,6 @@  static void conn_channel_close(GAState *s)
     }
     g_io_channel_unref(s->conn_channel);
     s->conn_channel = NULL;
-    s->conn_id = 0;
 out_noclose:
     return;
 }
@@ -644,7 +628,6 @@  int main(int argc, char **argv)
     g_thread_init(NULL);
 
     s = qemu_mallocz(sizeof(GAState));
-    s->conn_id = 0;
     s->conn_channel = NULL;
     s->path = path;
     s->method = method;