| 108 | } |
| 109 | |
| 110 | void |
| 111 | get_meta_attributes(GHashTable * meta_hash, resource_t * rsc, |
| 112 | node_t * node, pe_working_set_t * data_set) |
| 113 | { |
| 114 | GHashTable *node_hash = NULL; |
| 115 | |
| 116 | if (node) { |
| 117 | node_hash = node->details->attrs; |
| 118 | } |
| 119 | |
| 120 | if (rsc->xml) { |
| 121 | xmlAttrPtr xIter = NULL; |
| 122 | |
| 123 | for (xIter = rsc->xml->properties; xIter; xIter = xIter->next) { |
| 124 | const char *prop_name = (const char *)xIter->name; |
| 125 | const char *prop_value = crm_element_value(rsc->xml, prop_name); |
| 126 | |
| 127 | add_hash_param(meta_hash, prop_name, prop_value); |
| 128 | } |
| 129 | } |
| 130 | |
| 131 | unpack_instance_attributes(data_set->input, rsc->xml, XML_TAG_META_SETS, node_hash, |
| 132 | meta_hash, NULL, FALSE, data_set->now); |
| 133 | |
| 134 | /* populate from the regular attributes until the GUI can create |
| 135 | * meta attributes |
| 136 | */ |
| 137 | unpack_instance_attributes(data_set->input, rsc->xml, XML_TAG_ATTR_SETS, node_hash, |
| 138 | meta_hash, NULL, FALSE, data_set->now); |
| 139 | |
| 140 | /* set anything else based on the parent */ |
| 141 | if (rsc->parent != NULL) { |
| 142 | g_hash_table_foreach(rsc->parent->meta, dup_attr, meta_hash); |
| 143 | } |
| 144 | |
| 145 | /* and finally check the defaults */ |
| 146 | unpack_instance_attributes(data_set->input, data_set->rsc_defaults, XML_TAG_META_SETS, |
| 147 | node_hash, meta_hash, NULL, FALSE, data_set->now); |
| 148 | } |
| 149 | |
| 150 | void |
| 151 | get_rsc_attributes(GHashTable * meta_hash, resource_t * rsc, |