Переглянути джерело

remove unused QemuOpts parameter from net init functions

v1->v2:
- unchanged

v2->v3:
- keep "qemu-option.h" included in "net/slirp.h"

Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Laszlo Ersek 13 роки тому
батько
коміт
1a0c09583d
12 змінених файлів з 32 додано та 38 видалено
  1. 6 8
      net.c
  2. 2 2
      net/dump.c
  3. 2 3
      net/dump.h
  4. 2 2
      net/slirp.c
  5. 2 2
      net/slirp.h
  6. 2 2
      net/socket.c
  7. 2 3
      net/socket.h
  8. 2 2
      net/tap-win32.c
  9. 4 4
      net/tap.c
  10. 4 5
      net/tap.h
  11. 2 2
      net/vde.c
  12. 2 3
      net/vde.h

+ 6 - 8
net.c

@@ -748,8 +748,8 @@ int net_handle_fd_param(Monitor *mon, const char *param)
     return fd;
     return fd;
 }
 }
 
 
-static int net_init_nic(QemuOpts *old_opts, const NetClientOptions *opts,
-                        const char *name, VLANState *vlan)
+static int net_init_nic(const NetClientOptions *opts, const char *name,
+                        VLANState *vlan)
 {
 {
     int idx;
     int idx;
     NICInfo *nd;
     NICInfo *nd;
@@ -813,8 +813,7 @@ static int net_init_nic(QemuOpts *old_opts, const NetClientOptions *opts,
 
 
 
 
 static int (* const net_client_init_fun[NET_CLIENT_OPTIONS_KIND_MAX])(
 static int (* const net_client_init_fun[NET_CLIENT_OPTIONS_KIND_MAX])(
-    QemuOpts *old_opts,
-    const NetClientOptions *new_opts,
+    const NetClientOptions *opts,
     const char *name,
     const char *name,
     VLANState *vlan) = {
     VLANState *vlan) = {
         [NET_CLIENT_OPTIONS_KIND_NIC]    = net_init_nic,
         [NET_CLIENT_OPTIONS_KIND_NIC]    = net_init_nic,
@@ -833,8 +832,7 @@ static int (* const net_client_init_fun[NET_CLIENT_OPTIONS_KIND_MAX])(
 };
 };
 
 
 
 
-static int net_client_init1(const void *object, int is_netdev,
-                            QemuOpts *old_opts, Error **errp)
+static int net_client_init1(const void *object, int is_netdev, Error **errp)
 {
 {
     union {
     union {
         const Netdev    *netdev;
         const Netdev    *netdev;
@@ -885,7 +883,7 @@ static int net_client_init1(const void *object, int is_netdev,
             vlan = qemu_find_vlan(u.net->has_vlan ? u.net->vlan : 0, true);
             vlan = qemu_find_vlan(u.net->has_vlan ? u.net->vlan : 0, true);
         }
         }
 
 
-        if (net_client_init_fun[opts->kind](old_opts, opts, name, vlan) < 0) {
+        if (net_client_init_fun[opts->kind](opts, name, vlan) < 0) {
             /* TODO push error reporting into init() methods */
             /* TODO push error reporting into init() methods */
             error_set(errp, QERR_DEVICE_INIT_FAILED,
             error_set(errp, QERR_DEVICE_INIT_FAILED,
                       NetClientOptionsKind_lookup[opts->kind]);
                       NetClientOptionsKind_lookup[opts->kind]);
@@ -920,7 +918,7 @@ int net_client_init(QemuOpts *opts, int is_netdev, Error **errp)
     }
     }
 
 
     if (!err) {
     if (!err) {
-        ret = net_client_init1(object, is_netdev, opts, &err);
+        ret = net_client_init1(object, is_netdev, &err);
     }
     }
 
 
     if (object) {
     if (object) {

+ 2 - 2
net/dump.c

@@ -144,8 +144,8 @@ static int net_dump_init(VLANState *vlan, const char *device,
     return 0;
     return 0;
 }
 }
 
 
-int net_init_dump(QemuOpts *old_opts, const NetClientOptions *opts,
-                  const char *name, VLANState *vlan)
+int net_init_dump(const NetClientOptions *opts, const char *name,
+                  VLANState *vlan)
 {
 {
     int len;
     int len;
     const char *file;
     const char *file;

+ 2 - 3
net/dump.h

@@ -25,10 +25,9 @@
 #define QEMU_NET_DUMP_H
 #define QEMU_NET_DUMP_H
 
 
 #include "net.h"
 #include "net.h"
-#include "qemu-common.h"
 #include "qapi-types.h"
 #include "qapi-types.h"
 
 
-int net_init_dump(QemuOpts *opts, const NetClientOptions *new_opts,
-                  const char *name, VLANState *vlan);
+int net_init_dump(const NetClientOptions *opts, const char *name,
+                  VLANState *vlan);
 
 
 #endif /* QEMU_NET_DUMP_H */
 #endif /* QEMU_NET_DUMP_H */

+ 2 - 2
net/slirp.c

@@ -702,8 +702,8 @@ net_init_slirp_configs(const StringList *fwd, int flags)
     }
     }
 }
 }
 
 
-int net_init_slirp(QemuOpts *old_opts, const NetClientOptions *opts,
-                   const char *name, VLANState *vlan)
+int net_init_slirp(const NetClientOptions *opts, const char *name,
+                   VLANState *vlan)
 {
 {
     struct slirp_config_str *config;
     struct slirp_config_str *config;
     char *vnet;
     char *vnet;

+ 2 - 2
net/slirp.h

@@ -31,8 +31,8 @@
 
 
 #ifdef CONFIG_SLIRP
 #ifdef CONFIG_SLIRP
 
 
-int net_init_slirp(QemuOpts *opts, const NetClientOptions *new_opts,
-                   const char *name, VLANState *vlan);
+int net_init_slirp(const NetClientOptions *opts, const char *name,
+                   VLANState *vlan);
 
 
 void net_slirp_hostfwd_add(Monitor *mon, const QDict *qdict);
 void net_slirp_hostfwd_add(Monitor *mon, const QDict *qdict);
 void net_slirp_hostfwd_remove(Monitor *mon, const QDict *qdict);
 void net_slirp_hostfwd_remove(Monitor *mon, const QDict *qdict);

+ 2 - 2
net/socket.c

@@ -586,8 +586,8 @@ static int net_socket_udp_init(VLANState *vlan,
     return 0;
     return 0;
 }
 }
 
 
-int net_init_socket(QemuOpts *old_opts, const NetClientOptions *opts,
-                    const char *name, VLANState *vlan)
+int net_init_socket(const NetClientOptions *opts, const char *name,
+                    VLANState *vlan)
 {
 {
     const NetdevSocketOptions *sock;
     const NetdevSocketOptions *sock;
 
 

+ 2 - 3
net/socket.h

@@ -25,10 +25,9 @@
 #define QEMU_NET_SOCKET_H
 #define QEMU_NET_SOCKET_H
 
 
 #include "net.h"
 #include "net.h"
-#include "qemu-common.h"
 #include "qapi-types.h"
 #include "qapi-types.h"
 
 
-int net_init_socket(QemuOpts *opts, const NetClientOptions *new_opts,
-                    const char *name, VLANState *vlan);
+int net_init_socket(const NetClientOptions *opts, const char *name,
+                    VLANState *vlan);
 
 
 #endif /* QEMU_NET_SOCKET_H */
 #endif /* QEMU_NET_SOCKET_H */

+ 2 - 2
net/tap-win32.c

@@ -699,8 +699,8 @@ static int tap_win32_init(VLANState *vlan, const char *model,
     return 0;
     return 0;
 }
 }
 
 
-int net_init_tap(QemuOpts *old_opts, const NetClientOptions *opts,
-                 const char *name, VLANState *vlan)
+int net_init_tap(const NetClientOptions *opts, const char *name,
+                 VLANState *vlan)
 {
 {
     const NetdevTapOptions *tap;
     const NetdevTapOptions *tap;
 
 

+ 4 - 4
net/tap.c

@@ -513,8 +513,8 @@ static int net_bridge_run_helper(const char *helper, const char *bridge)
     return -1;
     return -1;
 }
 }
 
 
-int net_init_bridge(QemuOpts *old_opts, const NetClientOptions *opts,
-                    const char *name, VLANState *vlan)
+int net_init_bridge(const NetClientOptions *opts, const char *name,
+                    VLANState *vlan)
 {
 {
     const NetdevBridgeOptions *bridge;
     const NetdevBridgeOptions *bridge;
     const char *helper, *br;
     const char *helper, *br;
@@ -586,8 +586,8 @@ static int net_tap_init(const NetdevTapOptions *tap, int *vnet_hdr,
     return fd;
     return fd;
 }
 }
 
 
-int net_init_tap(QemuOpts *old_opts, const NetClientOptions *opts,
-                 const char *name, VLANState *vlan)
+int net_init_tap(const NetClientOptions *opts, const char *name,
+                 VLANState *vlan)
 {
 {
     const NetdevTapOptions *tap;
     const NetdevTapOptions *tap;
 
 

+ 4 - 5
net/tap.h

@@ -27,14 +27,13 @@
 #define QEMU_NET_TAP_H
 #define QEMU_NET_TAP_H
 
 
 #include "qemu-common.h"
 #include "qemu-common.h"
-#include "qemu-option.h"
 #include "qapi-types.h"
 #include "qapi-types.h"
 
 
 #define DEFAULT_NETWORK_SCRIPT "/etc/qemu-ifup"
 #define DEFAULT_NETWORK_SCRIPT "/etc/qemu-ifup"
 #define DEFAULT_NETWORK_DOWN_SCRIPT "/etc/qemu-ifdown"
 #define DEFAULT_NETWORK_DOWN_SCRIPT "/etc/qemu-ifdown"
 
 
-int net_init_tap(QemuOpts *opts, const NetClientOptions *new_opts,
-                 const char *name, VLANState *vlan);
+int net_init_tap(const NetClientOptions *opts, const char *name,
+                 VLANState *vlan);
 
 
 int tap_open(char *ifname, int ifname_size, int *vnet_hdr, int vnet_hdr_required);
 int tap_open(char *ifname, int ifname_size, int *vnet_hdr, int vnet_hdr_required);
 
 
@@ -59,7 +58,7 @@ int tap_get_fd(VLANClientState *vc);
 struct vhost_net;
 struct vhost_net;
 struct vhost_net *tap_get_vhost_net(VLANClientState *vc);
 struct vhost_net *tap_get_vhost_net(VLANClientState *vc);
 
 
-int net_init_bridge(QemuOpts *opts, const NetClientOptions *new_opts,
-                    const char *name, VLANState *vlan);
+int net_init_bridge(const NetClientOptions *opts, const char *name,
+                    VLANState *vlan);
 
 
 #endif /* QEMU_NET_TAP_H */
 #endif /* QEMU_NET_TAP_H */

+ 2 - 2
net/vde.c

@@ -110,8 +110,8 @@ static int net_vde_init(VLANState *vlan, const char *model,
     return 0;
     return 0;
 }
 }
 
 
-int net_init_vde(QemuOpts *old_opts, const NetClientOptions *opts,
-                 const char *name, VLANState *vlan)
+int net_init_vde(const NetClientOptions *opts, const char *name,
+                 VLANState *vlan)
 {
 {
     const NetdevVdeOptions *vde;
     const NetdevVdeOptions *vde;
 
 

+ 2 - 3
net/vde.h

@@ -25,13 +25,12 @@
 #define QEMU_NET_VDE_H
 #define QEMU_NET_VDE_H
 
 
 #include "qemu-common.h"
 #include "qemu-common.h"
-#include "qemu-option.h"
 #include "qapi-types.h"
 #include "qapi-types.h"
 
 
 #ifdef CONFIG_VDE
 #ifdef CONFIG_VDE
 
 
-int net_init_vde(QemuOpts *opts, const NetClientOptions *new_opts,
-                 const char *name, VLANState *vlan);
+int net_init_vde(const NetClientOptions *opts, const char *name,
+                 VLANState *vlan);
 
 
 #endif /* CONFIG_VDE */
 #endif /* CONFIG_VDE */