]> git.proxmox.com Git - mirror_ovs.git/commitdiff
ofproto: Use ofputil_uninit_group_mod().
authorJarno Rajahalme <jarno@ovn.org>
Fri, 29 Jul 2016 23:52:04 +0000 (16:52 -0700)
committerJarno Rajahalme <jarno@ovn.org>
Fri, 29 Jul 2016 23:52:04 +0000 (16:52 -0700)
Use ofputil_uninit_group_mod() instead of
ofputil_bucket_list_destroy().  Currently these have the same effect,
but this will change in a following patch.

Signed-off-by: Jarno Rajahalme <jarno@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
lib/ofp-parse.c
lib/ofp-print.c
ofproto/ofproto.c
ovn/controller/ofctrl.c
utilities/ovs-ofctl.c

index 86590795798f45f608bf98e7730d23ec101f9c88..56607f61a8a951910158b0d835d6054877052f65 100644 (file)
@@ -1590,7 +1590,7 @@ parse_ofp_group_mod_str__(struct ofputil_group_mod *gm, uint16_t command,
 
     return NULL;
  out:
-    ofputil_bucket_list_destroy(&gm->buckets);
+    ofputil_uninit_group_mod(gm);
     return error;
 }
 
@@ -1605,7 +1605,7 @@ parse_ofp_group_mod_str(struct ofputil_group_mod *gm, uint16_t command,
     free(string);
 
     if (error) {
-        ofputil_bucket_list_destroy(&gm->buckets);
+        ofputil_uninit_group_mod(gm);
     }
     return error;
 }
@@ -1653,7 +1653,7 @@ parse_ofp_group_mod_file(const char *file_name, uint16_t command,
             size_t i;
 
             for (i = 0; i < *n_gms; i++) {
-                ofputil_bucket_list_destroy(&(*gms)[i].buckets);
+                ofputil_uninit_group_mod(&(*gms)[i]);
             }
             free(*gms);
             *gms = NULL;
index 919c95d64c376a41ea455c36920e5a7a68736b8c..0b3bf01a07c0225d0b6f4e5826d796d83b43c5fa 100644 (file)
@@ -2586,7 +2586,7 @@ ofp_print_group_desc(struct ds *s, const struct ofp_header *oh)
         ds_put_char(s, ' ');
         ofp_print_group(s, gd.group_id, gd.type, &gd.buckets, &gd.props,
                         oh->version, false);
-        ofputil_bucket_list_destroy(&gd.buckets);
+        ofputil_uninit_group_desc(&gd);
      }
 }
 
@@ -2747,7 +2747,7 @@ ofp_print_group_mod(struct ds *s, const struct ofp_header *oh)
         return;
     }
     ofp_print_group_mod__(s, oh->version, &gm);
-    ofputil_bucket_list_destroy(&gm.buckets);
+    ofputil_uninit_group_mod(&gm);
 }
 
 static void
index 4e59d649cde57142a2267c18066c6b6b9c44bc39..3b9118340d4ad3846edc0663d0bcc73aba35cb61 100644 (file)
@@ -6874,7 +6874,7 @@ handle_group_mod(struct ofconn *ofconn, const struct ofp_header *oh)
     ofmonitor_flush(ofproto->connmgr);
     ovs_mutex_unlock(&ofproto_mutex);
 
-    ofputil_bucket_list_destroy(&ogm.gm.buckets);
+    ofputil_uninit_group_mod(&ogm.gm);
 
     return error;
 }
index dd9f5ece1acf060da6ed055311e114e45264a759..79d840d7829417346af558fe1af1e38ca2d00a40 100644 (file)
@@ -365,7 +365,7 @@ run_S_CLEAR_FLOWS(void)
     gm.command_bucket_id = OFPG15_BUCKET_ALL;
     ovs_list_init(&gm.buckets);
     queue_msg(encode_group_mod(&gm));
-    ofputil_bucket_list_destroy(&gm.buckets);
+    ofputil_uninit_group_mod(&gm);
 
     /* Clear installed_flows, to match the state of the switch. */
     ovn_flow_table_clear();
@@ -936,7 +936,7 @@ ofctrl_put(struct group_table *group_table, int64_t nb_cfg)
                 free(error);
             }
             ds_destroy(&group_string);
-            ofputil_bucket_list_destroy(&gm.buckets);
+            ofputil_uninit_group_mod(&gm);
         }
     }
 
@@ -1051,7 +1051,7 @@ ofctrl_put(struct group_table *group_table, int64_t nb_cfg)
                 free(error);
             }
             ds_destroy(&group_string);
-            ofputil_bucket_list_destroy(&gm.buckets);
+            ofputil_uninit_group_mod(&gm);
 
             /* Remove 'installed' from 'group_table->existing_groups' */
             hmap_remove(&group_table->existing_groups, &installed->hmap_node);
index a54cfc1ac5556cb804509afe016801846948d915..124e8849518db9e405ac4c334ca7a97415b79d06 100644 (file)
@@ -2525,10 +2525,10 @@ ofctl_group_mod__(const char *remote, struct ofputil_group_mod *gms,
         if (request) {
             transact_noreply(vconn, request);
         }
+        ofputil_uninit_group_mod(gm);
     }
 
     vconn_close(vconn);
-
 }
 
 
@@ -2539,7 +2539,6 @@ ofctl_group_mod_file(int argc OVS_UNUSED, char *argv[], uint16_t command)
     enum ofputil_protocol usable_protocols;
     size_t n_gms = 0;
     char *error;
-    int i;
 
     error = parse_ofp_group_mod_file(argv[2], command, &gms, &n_gms,
                                      &usable_protocols);
@@ -2547,9 +2546,6 @@ ofctl_group_mod_file(int argc OVS_UNUSED, char *argv[], uint16_t command)
         ovs_fatal(0, "%s", error);
     }
     ofctl_group_mod__(argv[1], gms, n_gms, usable_protocols);
-    for (i = 0; i < n_gms; i++) {
-        ofputil_bucket_list_destroy(&gms[i].buckets);
-    }
     free(gms);
 }
 
@@ -2569,7 +2565,6 @@ ofctl_group_mod(int argc, char *argv[], uint16_t command)
             ovs_fatal(0, "%s", error);
         }
         ofctl_group_mod__(argv[1], &gm, 1, usable_protocols);
-        ofputil_bucket_list_destroy(&gm.buckets);
     }
 }