qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH] warnings in net.c


From: Ulrich Hecht
Subject: [Qemu-devel] [PATCH] warnings in net.c
Date: Wed, 17 Jun 2009 17:47:40 +0200

removes unused slirp code and initializes ret in net_client_init()

Signed-off-by: Ulrich Hecht <address@hidden>
---
 net.c |   51 +--------------------------------------------------
 1 files changed, 1 insertions(+), 50 deletions(-)

diff --git a/net.c b/net.c
index af9de73..91976b9 100644
--- a/net.c
+++ b/net.c
@@ -691,55 +691,6 @@ int slirp_is_inited(void)
     return slirp_inited;
 }
 
-static ssize_t slirp_receive(VLANClientState *vc, const uint8_t *buf, size_t 
size)
-{
-#ifdef DEBUG_SLIRP
-    printf("slirp input:\n");
-    hex_dump(stdout, buf, size);
-#endif
-    slirp_input(buf, size);
-    return size;
-}
-
-static int slirp_in_use;
-
-static void net_slirp_cleanup(VLANClientState *vc)
-{
-    slirp_in_use = 0;
-}
-
-static int net_slirp_init(VLANState *vlan, const char *model, const char *name,
-                          int restricted, const char *ip)
-{
-    if (slirp_in_use) {
-        /* slirp only supports a single instance so far */
-        return -1;
-    }
-    if (!slirp_inited) {
-        slirp_inited = 1;
-        slirp_init(restricted, ip);
-
-        while (slirp_redirs) {
-            struct slirp_config_str *config = slirp_redirs;
-
-            slirp_redirection(NULL, config->str);
-            slirp_redirs = config->next;
-            qemu_free(config);
-        }
-#ifndef _WIN32
-        if (slirp_smb_export) {
-            slirp_smb(slirp_smb_export);
-        }
-#endif
-    }
-
-    slirp_vc = qemu_new_vlan_client(vlan, model, name, NULL, slirp_receive,
-                                    NULL, net_slirp_cleanup, NULL);
-    slirp_vc->info_str[0] = '\0';
-    slirp_in_use = 1;
-    return 0;
-}
-
 static void net_slirp_redir_print(void *opaque, int is_udp,
                                   struct in_addr *laddr, u_int lport,
                                   struct in_addr *faddr, u_int fport)
@@ -2088,7 +2039,7 @@ int net_client_init(Monitor *mon, const char *device, 
const char *p)
         "vlan", "name", "fd", NULL
     };
     char buf[1024];
-    int vlan_id, ret;
+    int vlan_id, ret = 0;
     VLANState *vlan;
     char *name = NULL;
 
-- 
1.6.2.1





reply via email to

[Prev in Thread] Current Thread [Next in Thread]