]> xenbits.xensource.com Git - qemu-xen.git/commitdiff
net: Drop vlan argument to qemu_new_net_client()
authorStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Tue, 24 Jul 2012 15:35:08 +0000 (16:35 +0100)
committerStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Wed, 1 Aug 2012 11:28:51 +0000 (12:28 +0100)
Since hubs are now used to implement the 'vlan' feature and the vlan
argument is always NULL, remove the argument entirely and update all net
clients that use qemu_new_net_client().

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
net.c
net.h
net/dump.c
net/hub.c
net/slirp.c
net/socket.c
net/tap-win32.c
net/tap.c
net/vde.c

diff --git a/net.c b/net.c
index 413dac4ce92bf3a45f09c842ff75cfe1d1954b53..274f3bddd71febcee08370809422e77943b77e7e 100644 (file)
--- a/net.c
+++ b/net.c
@@ -197,7 +197,6 @@ static ssize_t qemu_deliver_packet_iov(VLANClientState *sender,
                                        void *opaque);
 
 VLANClientState *qemu_new_net_client(NetClientInfo *info,
-                                     VLANState *vlan,
                                      VLANClientState *peer,
                                      const char *model,
                                      const char *name)
@@ -216,22 +215,16 @@ VLANClientState *qemu_new_net_client(NetClientInfo *info,
         vc->name = assign_name(vc, model);
     }
 
-    if (vlan) {
-        assert(!peer);
-        vc->vlan = vlan;
-        QTAILQ_INSERT_TAIL(&vc->vlan->clients, vc, next);
-    } else {
-        if (peer) {
-            assert(!peer->peer);
-            vc->peer = peer;
-            peer->peer = vc;
-        }
-        QTAILQ_INSERT_TAIL(&non_vlan_clients, vc, next);
-
-        vc->send_queue = qemu_new_net_queue(qemu_deliver_packet,
-                                            qemu_deliver_packet_iov,
-                                            vc);
+    if (peer) {
+        assert(!peer->peer);
+        vc->peer = peer;
+        peer->peer = vc;
     }
+    QTAILQ_INSERT_TAIL(&non_vlan_clients, vc, next);
+
+    vc->send_queue = qemu_new_net_queue(qemu_deliver_packet,
+                                        qemu_deliver_packet_iov,
+                                        vc);
 
     return vc;
 }
@@ -248,7 +241,7 @@ NICState *qemu_new_nic(NetClientInfo *info,
     assert(info->type == NET_CLIENT_OPTIONS_KIND_NIC);
     assert(info->size >= sizeof(NICState));
 
-    nc = qemu_new_net_client(info, conf->vlan, conf->peer, model, name);
+    nc = qemu_new_net_client(info, conf->peer, model, name);
 
     nic = DO_UPCAST(NICState, nc, nc);
     nic->conf = conf;
diff --git a/net.h b/net.h
index b0b8c7ab6bc0cfbeb07b232a5efc766d11ddbea8..e9c92b2c4d858967e00dfdbd48f10b64c8ba20b9 100644 (file)
--- a/net.h
+++ b/net.h
@@ -79,7 +79,6 @@ struct VLANState {
 VLANState *qemu_find_vlan(int id, int allocate);
 VLANClientState *qemu_find_netdev(const char *id);
 VLANClientState *qemu_new_net_client(NetClientInfo *info,
-                                     VLANState *vlan,
                                      VLANClientState *peer,
                                      const char *model,
                                      const char *name);
index 9d7bf3be4d91b76d98ada48cd2100bf7f9dd358d..69d5abe1e9924f0f3bd59c7aaf68c9f23e74aef4 100644 (file)
@@ -129,7 +129,7 @@ static int net_dump_init(VLANClientState *peer, const char *device,
         return -1;
     }
 
-    nc = qemu_new_net_client(&net_dump_info, NULL, peer, device, name);
+    nc = qemu_new_net_client(&net_dump_info, peer, device, name);
 
     snprintf(nc->info_str, sizeof(nc->info_str),
              "dump to %s (len=%d)", filename, len);
index 5cdd8c9152eba3c2516dd558d11f593622eabc1d..97198a2d1f159e9d8ea81f9a2a2cc23d56e15260 100644 (file)
--- a/net/hub.c
+++ b/net/hub.c
@@ -129,7 +129,7 @@ static NetHubPort *net_hub_port_new(NetHub *hub, const char *name)
         name = default_name;
     }
 
-    nc = qemu_new_net_client(&net_hub_port_info, NULL, NULL, "hub", name);
+    nc = qemu_new_net_client(&net_hub_port_info, NULL, "hub", name);
     port = DO_UPCAST(NetHubPort, nc, nc);
     port->id = id;
     port->hub = hub;
index 7682ac7b52e4fe72daf4ec44af2ca39e5ec9be9e..85d6fb4b34a20a97d789947fee0fbd1d61098330 100644 (file)
@@ -239,7 +239,7 @@ static int net_slirp_init(VLANClientState *peer, const char *model,
     }
 #endif
 
-    nc = qemu_new_net_client(&net_slirp_info, NULL, peer, model, name);
+    nc = qemu_new_net_client(&net_slirp_info, peer, model, name);
 
     snprintf(nc->info_str, sizeof(nc->info_str),
              "net=%s,restrict=%s", inet_ntoa(net),
index 09bdc66e104170c9ed35484d2a46fc89ef2db988..31bbb30b97fe8adfc9f7396898a3b7ea44c5bd89 100644 (file)
@@ -287,7 +287,7 @@ static NetSocketState *net_socket_fd_init_dgram(VLANClientState *peer,
         }
     }
 
-    nc = qemu_new_net_client(&net_dgram_socket_info, NULL, peer, model, name);
+    nc = qemu_new_net_client(&net_dgram_socket_info, peer, model, name);
 
     snprintf(nc->info_str, sizeof(nc->info_str),
             "socket: fd=%d (%s mcast=%s:%d)",
@@ -331,7 +331,7 @@ static NetSocketState *net_socket_fd_init_stream(VLANClientState *peer,
     VLANClientState *nc;
     NetSocketState *s;
 
-    nc = qemu_new_net_client(&net_socket_info, NULL, peer, model, name);
+    nc = qemu_new_net_client(&net_socket_info, peer, model, name);
 
     snprintf(nc->info_str, sizeof(nc->info_str), "socket: fd=%d", fd);
 
index 0e3b883c0074afae7eb6c5a5838ec0cfe0f74ef4..c4c98aa256631cd40f54a2ad39f000501f66cdd3 100644 (file)
@@ -685,7 +685,7 @@ static int tap_win32_init(VLANClientState *peer, const char *model,
         return -1;
     }
 
-    nc = qemu_new_net_client(&net_tap_win32_info, NULL, peer, model, name);
+    nc = qemu_new_net_client(&net_tap_win32_info, peer, model, name);
 
     s = DO_UPCAST(TAPState, nc, nc);
 
index 43c3fcd7494e6a45d2f29cd9d8bcda550291ad8c..10ae98d18b6f7e80f5ae458ba71671303aec5f61 100644 (file)
--- a/net/tap.c
+++ b/net/tap.c
@@ -331,7 +331,7 @@ static TAPState *net_tap_fd_init(VLANClientState *peer,
     VLANClientState *nc;
     TAPState *s;
 
-    nc = qemu_new_net_client(&net_tap_info, NULL, peer, model, name);
+    nc = qemu_new_net_client(&net_tap_info, peer, model, name);
 
     s = DO_UPCAST(TAPState, nc, nc);
 
index 302a022753a3983081d6f9598fbff367fd3c1e03..a1480d7016cdc02b24f23bb3d516586ef01ece03 100644 (file)
--- a/net/vde.c
+++ b/net/vde.c
@@ -96,7 +96,7 @@ static int net_vde_init(VLANClientState *peer, const char *model,
         return -1;
     }
 
-    nc = qemu_new_net_client(&net_vde_info, NULL, peer, model, name);
+    nc = qemu_new_net_client(&net_vde_info, peer, model, name);
 
     snprintf(nc->info_str, sizeof(nc->info_str), "sock=%s,fd=%d",
              sock, vde_datafd(vde));