Skip to content

Commit a696220

Browse files
committed
xml/import/v2: update the osdevice type before filtering
We filter objects using that osdev type, so make sure it's updated before. Signed-off-by: Brice Goglin <[email protected]>
1 parent 35cc3ed commit a696220

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

hwloc/topology-xml.c

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -843,6 +843,14 @@ hwloc__xml_import_object(hwloc_topology_t topology,
843843
}
844844
}
845845

846+
if (data->version_major < 3 && obj->type == HWLOC_OBJ_OS_DEVICE) {
847+
if (obj->attr->osdev.type == HWLOC_OBJ_OSDEV_STORAGE
848+
&& ((obj->name && !strncmp(obj->name, "dax", 3))
849+
|| (obj->subtype && !strcmp(obj->subtype, "CXLMem"))))
850+
obj->attr->osdev.type = HWLOC_OBJ_OSDEV_MEMORY;
851+
}
852+
853+
/* filter AFTER having updated the osdevice attribute from v2 */
846854
if (!hwloc_filter_check_keep_object(topology, obj)) {
847855
/* Ignore this object instead of inserting it.
848856
*
@@ -859,13 +867,6 @@ hwloc__xml_import_object(hwloc_topology_t topology,
859867
/* insert_object_by_parent() doesn't merge during insert, so obj is still valid */
860868
}
861869

862-
if (data->version_major < 3 && obj->type == HWLOC_OBJ_OS_DEVICE) {
863-
if (obj->attr->osdev.type == HWLOC_OBJ_OSDEV_STORAGE
864-
&& ((obj->name && !strncmp(obj->name, "dax", 3))
865-
|| (obj->subtype && !strcmp(obj->subtype, "CXLMem"))))
866-
obj->attr->osdev.type = HWLOC_OBJ_OSDEV_MEMORY;
867-
}
868-
869870
/* process object subnodes, if we found one win the above loop */
870871
while (tag) {
871872
int ret;

0 commit comments

Comments
 (0)