]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
Remove virDomainNetType parameter from nwfilter drivers
authorDaniel P. Berrange <berrange@redhat.com>
Mon, 24 Mar 2014 12:27:03 +0000 (12:27 +0000)
committerDaniel P. Berrange <berrange@redhat.com>
Fri, 25 Apr 2014 14:44:09 +0000 (15:44 +0100)
The 'virDomainNetType' is unused in every impl of the
virNWFilterRuleCreateInstance driver method. Remove it
from the code to avoid the dependancy on the external
enum.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
src/nwfilter/nwfilter_dhcpsnoop.c
src/nwfilter/nwfilter_dhcpsnoop.h
src/nwfilter/nwfilter_ebiptables_driver.c
src/nwfilter/nwfilter_gentech_driver.c
src/nwfilter/nwfilter_gentech_driver.h
src/nwfilter/nwfilter_learnipaddr.c
src/nwfilter/nwfilter_learnipaddr.h
src/nwfilter/nwfilter_tech_driver.h

index df46a7201764a13675f38f2b55b0c1490683acdd..bfd05530e090b15d32fbd39ccf637a35103b110d 100644 (file)
@@ -137,7 +137,6 @@ struct _virNWFilterSnoopReq {
     char                                *ifname;
     int                                  ifindex;
     char                                *linkdev;
-    enum virDomainNetType                nettype;
     char                                 ifkey[VIR_IFKEY_LEN];
     virMacAddr                           macaddr;
     char                                *filtername;
@@ -493,7 +492,6 @@ virNWFilterSnoopIPLeaseInstallRule(virNWFilterSnoopIPLeasePtr ipl,
                                               req->ifname,
                                               req->ifindex,
                                               req->linkdev,
-                                              req->nettype,
                                               &req->macaddr,
                                               req->filtername,
                                               req->vars);
@@ -879,7 +877,6 @@ virNWFilterSnoopReqLeaseDel(virNWFilterSnoopReqPtr req,
                                                req->ifname,
                                                req->ifindex,
                                                req->linkdev,
-                                               req->nettype,
                                                &req->macaddr,
                                                req->filtername,
                                                req->vars);
@@ -1592,7 +1589,6 @@ int
 virNWFilterDHCPSnoopReq(virNWFilterTechDriverPtr techdriver,
                         const char *ifname,
                         const char *linkdev,
-                        enum virDomainNetType nettype,
                         const unsigned char *vmuuid,
                         const virMacAddr *macaddr,
                         const char *filtername,
@@ -1628,7 +1624,6 @@ virNWFilterDHCPSnoopReq(virNWFilterTechDriverPtr techdriver,
     req->driver = driver;
     req->techdriver = techdriver;
     tmp = virNetDevGetIndex(ifname, &req->ifindex);
-    req->nettype = nettype;
     virMacAddrSet(&req->macaddr, macaddr);
     req->vars = virNWFilterHashTableCreate(0);
     req->linkdev = NULL;
@@ -2230,7 +2225,6 @@ int
 virNWFilterDHCPSnoopReq(virNWFilterTechDriverPtr techdriver ATTRIBUTE_UNUSED,
                         const char *ifname ATTRIBUTE_UNUSED,
                         const char *linkdev ATTRIBUTE_UNUSED,
-                        enum virDomainNetType nettype ATTRIBUTE_UNUSED,
                         const unsigned char *vmuuid ATTRIBUTE_UNUSED,
                         const virMacAddr *macaddr ATTRIBUTE_UNUSED,
                         const char *filtername ATTRIBUTE_UNUSED,
index 6e73eb3b78cd530fb2e3d073b75bf1ff03219838..3ef96fa4e1c35971e6860ae54868e33c613ac7f4 100644 (file)
@@ -32,7 +32,6 @@ void virNWFilterDHCPSnoopShutdown(void);
 int virNWFilterDHCPSnoopReq(virNWFilterTechDriverPtr techdriver,
                             const char *ifname,
                             const char *linkdev,
-                            enum virDomainNetType nettype,
                             const unsigned char *vmuuid,
                             const virMacAddr *macaddr,
                             const char *filtername,
index ce0b7e3568f51cfa0dac043d6e750ec153c59e84..4365c1f20afc3ef0bfb6db7a3b86e0d64594eece 100644 (file)
@@ -2649,8 +2649,7 @@ ebtablesCreateRuleInstance(char chainPrefix,
  * pointed to by res, -1 otherwise
  */
 static int
-ebiptablesCreateRuleInstance(enum virDomainNetType nettype ATTRIBUTE_UNUSED,
-                             virNWFilterDefPtr nwfilter,
+ebiptablesCreateRuleInstance(virNWFilterDefPtr nwfilter,
                              virNWFilterRuleDefPtr rule,
                              const char *ifname,
                              virNWFilterVarCombIterPtr vars,
@@ -2740,13 +2739,11 @@ ebiptablesCreateRuleInstance(enum virDomainNetType nettype ATTRIBUTE_UNUSED,
 }
 
 static int
-ebiptablesCreateRuleInstanceIterate(
-                             enum virDomainNetType nettype ATTRIBUTE_UNUSED,
-                             virNWFilterDefPtr nwfilter,
-                             virNWFilterRuleDefPtr rule,
-                             const char *ifname,
-                             virNWFilterHashTablePtr vars,
-                             virNWFilterRuleInstPtr res)
+ebiptablesCreateRuleInstanceIterate(virNWFilterDefPtr nwfilter,
+                                    virNWFilterRuleDefPtr rule,
+                                    const char *ifname,
+                                    virNWFilterHashTablePtr vars,
+                                    virNWFilterRuleInstPtr res)
 {
     int rc = 0;
     virNWFilterVarCombIterPtr vciter, tmp;
@@ -2761,8 +2758,7 @@ ebiptablesCreateRuleInstanceIterate(
         return -1;
 
     do {
-        rc = ebiptablesCreateRuleInstance(nettype,
-                                          nwfilter,
+        rc = ebiptablesCreateRuleInstance(nwfilter,
                                           rule,
                                           ifname,
                                           tmp,
index 1ce5e705c3c23168d91a2da1edf023b71ffe73fa..82ff62874ae50160a4dad22fc547059547b4319b 100644 (file)
@@ -289,7 +289,6 @@ virNWFilterPrintVars(virHashTablePtr vars,
  */
 static virNWFilterRuleInstPtr
 virNWFilterRuleInstantiate(virNWFilterTechDriverPtr techdriver,
-                           enum virDomainNetType nettype,
                            virNWFilterDefPtr filter,
                            virNWFilterRuleDefPtr rule,
                            const char *ifname,
@@ -304,7 +303,7 @@ virNWFilterRuleInstantiate(virNWFilterTechDriverPtr techdriver,
 
     ret->techdriver = techdriver;
 
-    rc = techdriver->createRuleInstance(nettype, filter,
+    rc = techdriver->createRuleInstance(filter,
                                         rule, ifname, vars, ret);
 
     if (rc) {
@@ -376,7 +375,6 @@ virNWFilterCreateVarsFrom(virNWFilterHashTablePtr vars1,
  */
 static int
 _virNWFilterInstantiateRec(virNWFilterTechDriverPtr techdriver,
-                           enum virDomainNetType nettype,
                            virNWFilterDefPtr filter,
                            const char *ifname,
                            virNWFilterHashTablePtr vars,
@@ -396,7 +394,6 @@ _virNWFilterInstantiateRec(virNWFilterTechDriverPtr techdriver,
         virNWFilterIncludeDefPtr inc  = filter->filterEntries[i]->include;
         if (rule) {
             inst = virNWFilterRuleInstantiate(techdriver,
-                                              nettype,
                                               filter,
                                               rule,
                                               ifname,
@@ -449,7 +446,6 @@ _virNWFilterInstantiateRec(virNWFilterTechDriverPtr techdriver,
                 }
 
                 rc = _virNWFilterInstantiateRec(techdriver,
-                                                nettype,
                                                 next_filter,
                                                 ifname,
                                                 tmpvars,
@@ -634,7 +630,6 @@ virNWFilterRuleInstancesToArray(int nEntries,
 static int
 virNWFilterInstantiate(const unsigned char *vmuuid ATTRIBUTE_UNUSED,
                        virNWFilterTechDriverPtr techdriver,
-                       enum virDomainNetType nettype,
                        virNWFilterDefPtr filter,
                        const char *ifname,
                        int ifindex,
@@ -690,7 +685,7 @@ virNWFilterInstantiate(const unsigned char *vmuuid ATTRIBUTE_UNUSED,
             }
             if (STRCASEEQ(learning, "dhcp")) {
                 rc = virNWFilterDHCPSnoopReq(techdriver, ifname, linkdev,
-                                             nettype, vmuuid, macaddr,
+                                             vmuuid, macaddr,
                                              filter->name, vars, driver);
                 goto err_exit;
             } else if (STRCASEEQ(learning, "any")) {
@@ -699,7 +694,7 @@ virNWFilterInstantiate(const unsigned char *vmuuid ATTRIBUTE_UNUSED,
                                                    ifname,
                                                    ifindex,
                                                    linkdev,
-                                                   nettype, macaddr,
+                                                   macaddr,
                                                    filter->name,
                                                    vars, driver,
                                                    DETECT_DHCP|DETECT_STATIC);
@@ -723,7 +718,6 @@ virNWFilterInstantiate(const unsigned char *vmuuid ATTRIBUTE_UNUSED,
     }
 
     rc = _virNWFilterInstantiateRec(techdriver,
-                                    nettype,
                                     filter,
                                     ifname,
                                     vars,
@@ -805,7 +799,6 @@ __virNWFilterInstantiateFilter(virNWFilterDriverStatePtr driver,
                                const char *ifname,
                                int ifindex,
                                const char *linkdev,
-                               enum virDomainNetType nettype,
                                const virMacAddr *macaddr,
                                const char *filtername,
                                virNWFilterHashTablePtr filterparams,
@@ -892,7 +885,6 @@ __virNWFilterInstantiateFilter(virNWFilterDriverStatePtr driver,
 
     rc = virNWFilterInstantiate(vmuuid,
                                 techdriver,
-                                nettype,
                                 filter,
                                 ifname,
                                 ifindex,
@@ -953,7 +945,6 @@ _virNWFilterInstantiateFilter(virNWFilterDriverStatePtr driver,
                                         net->ifname,
                                         ifindex,
                                         linkdev,
-                                        net->type,
                                         &net->mac,
                                         net->filter,
                                         net->filterparams,
@@ -974,7 +965,6 @@ virNWFilterInstantiateFilterLate(virNWFilterDriverStatePtr driver,
                                  const char *ifname,
                                  int ifindex,
                                  const char *linkdev,
-                                 enum virDomainNetType nettype,
                                  const virMacAddr *macaddr,
                                  const char *filtername,
                                  virNWFilterHashTablePtr filterparams)
@@ -991,7 +981,6 @@ virNWFilterInstantiateFilterLate(virNWFilterDriverStatePtr driver,
                                         ifname,
                                         ifindex,
                                         linkdev,
-                                        nettype,
                                         macaddr,
                                         filtername,
                                         filterparams,
index da85508dc044c8093969cc6dfc676ba7b67e8e6b..8349ab41050fc0c83aa76a8ffce430efc8b2b73e 100644 (file)
@@ -51,7 +51,6 @@ int virNWFilterInstantiateFilterLate(virNWFilterDriverStatePtr driver,
                                      const char *ifname,
                                      int ifindex,
                                      const char *linkdev,
-                                     enum virDomainNetType nettype,
                                      const virMacAddr *macaddr,
                                      const char *filtername,
                                      virNWFilterHashTablePtr filterparams);
index a6cdc87d8f08f67f1ab332d29b8b66b2c28493dc..4cea9cf0486253c58cf800e19440c1426b5ea0f3 100644 (file)
@@ -622,7 +622,6 @@ learnIPAddressThread(void *arg)
                                                    req->ifname,
                                                    req->ifindex,
                                                    req->linkdev,
-                                                   req->nettype,
                                                    &req->macaddr,
                                                    req->filtername,
                                                    req->filterparams);
@@ -661,7 +660,6 @@ learnIPAddressThread(void *arg)
  * @ifindex: the index of the interface
  * @linkdev : the name of the link device; currently only used in case of a
  *     macvtap device
- * @nettype : the type of interface
  * @macaddr : the MAC address of the interface
  * @filtername : the name of the top-level filter to apply to the interface
  *               once its IP address has been detected
@@ -681,7 +679,6 @@ virNWFilterLearnIPAddress(virNWFilterTechDriverPtr techdriver,
                           const char *ifname,
                           int ifindex,
                           const char *linkdev,
-                          enum virDomainNetType nettype,
                           const virMacAddr *macaddr,
                           const char *filtername,
                           virNWFilterHashTablePtr filterparams,
@@ -733,7 +730,6 @@ virNWFilterLearnIPAddress(virNWFilterTechDriverPtr techdriver,
     }
 
     req->ifindex = ifindex;
-    req->nettype = nettype;
     virMacAddrSet(&req->macaddr, macaddr);
     req->driver = driver;
     req->filterparams = ht;
@@ -771,7 +767,6 @@ virNWFilterLearnIPAddress(virNWFilterTechDriverPtr techdriver ATTRIBUTE_UNUSED,
                           const char *ifname ATTRIBUTE_UNUSED,
                           int ifindex ATTRIBUTE_UNUSED,
                           const char *linkdev ATTRIBUTE_UNUSED,
-                          enum virDomainNetType nettype ATTRIBUTE_UNUSED,
                           const virMacAddr *macaddr ATTRIBUTE_UNUSED,
                           const char *filtername ATTRIBUTE_UNUSED,
                           virNWFilterHashTablePtr filterparams ATTRIBUTE_UNUSED,
index 0195d1011c0f21abbe7ea956a64781d2910ec943..1cc881a7820057da91957e54ddd8c4f10b292563 100644 (file)
@@ -42,7 +42,6 @@ struct _virNWFilterIPAddrLearnReq {
     char ifname[IF_NAMESIZE];
     int ifindex;
     char linkdev[IF_NAMESIZE];
-    enum virDomainNetType nettype;
     virMacAddr macaddr;
     char *filtername;
     virNWFilterHashTablePtr filterparams;
@@ -58,7 +57,6 @@ int virNWFilterLearnIPAddress(virNWFilterTechDriverPtr techdriver,
                               const char *ifname,
                               int ifindex,
                               const char *linkdev,
-                              enum virDomainNetType nettype,
                               const virMacAddr *macaddr,
                               const char *filtername,
                               virNWFilterHashTablePtr filterparams,
index 5777757796a50ca9094c5e7ee56567cca690b804..03588e214366f450819d5e8ec94ec3024829566a 100644 (file)
@@ -44,10 +44,7 @@ struct _virNWFilterRuleInst {
 typedef int (*virNWFilterTechDrvInit)(bool privileged);
 typedef void (*virNWFilterTechDrvShutdown)(void);
 
-enum virDomainNetType;
-
-typedef int (*virNWFilterRuleCreateInstance)(enum virDomainNetType nettype,
-                                             virNWFilterDefPtr filter,
+typedef int (*virNWFilterRuleCreateInstance)(virNWFilterDefPtr filter,
                                              virNWFilterRuleDefPtr rule,
                                              const char *ifname,
                                              virNWFilterHashTablePtr vars,