]> git.proxmox.com Git - mirror_corosync-qdevice.git/commitdiff
qdevice-cmap: Load clear node high bit only once
authorJan Friesse <jfriesse@redhat.com>
Thu, 12 Nov 2020 15:57:50 +0000 (16:57 +0100)
committerJan Friesse <jfriesse@redhat.com>
Fri, 13 Nov 2020 15:01:24 +0000 (16:01 +0100)
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
qdevices/qdevice-cmap.c

index c2fff047d9f67eb5f1b3c33a0e2c5530abc246f2..7fd375f339faf91b79339f3032fb342670a73479 100644 (file)
@@ -107,6 +107,22 @@ qdevice_cmap_get_nodelist(cmap_handle_t cmap_handle, struct node_list *list)
 
        node_list_init(list);
 
+       /*
+        * Fill clear high node bit
+        */
+       clear_node_high_bit = 0;
+
+       if (cmap_get_string(cmap_handle, "totem.clear_node_high_bit", &tmp_str) == CS_OK) {
+               if (strcmp (tmp_str, "yes") == 0) {
+                       clear_node_high_bit = 1;
+               }
+
+               free(tmp_str);
+       }
+
+       /*
+        * Iterate nodelist
+        */
        cs_err = cmap_iter_init(cmap_handle, "nodelist.node.", &iter_handle);
        if (cs_err != CS_OK) {
                return (-1);
@@ -129,17 +145,6 @@ qdevice_cmap_get_nodelist(cmap_handle_t cmap_handle, struct node_list *list)
                        /*
                         * Nodeid doesn't exists -> autogenerate node id
                         */
-                       clear_node_high_bit = 0;
-
-                       if (cmap_get_string(cmap_handle, "totem.clear_node_high_bit",
-                           &tmp_str) == CS_OK) {
-                               if (strcmp (tmp_str, "yes") == 0) {
-                                       clear_node_high_bit = 1;
-                               }
-
-                               free(tmp_str);
-                       }
-
                        if (cmap_get_string(cmap_handle, key_name, &addr0_str) != CS_OK) {
                                return (-1);
                        }