]> xenbits.xensource.com Git - people/andrewcoop/hwloc.git/commitdiff
linux: get_obj_cpuset() callback needs to work ...
authorBrice Goglin <brice.goglin@inria.fr>
Mon, 1 Jul 2013 10:09:31 +0000 (10:09 +0000)
committerBrice Goglin <brice.goglin@inria.fr>
Mon, 1 Jul 2013 10:09:31 +0000 (10:09 +0000)
linux: get_obj_cpuset() callback needs to work on modified fsroot too

Testing on any other PCI-enabled topology chroot requires this.

The single test with PCI in tests/linux/ defines pci bridge locality
using environment variable, so it didn't raise this assertion.

This commit was SVN r5716.

src/topology-linux.c

index 58ee0c088398cc345035a459094dc41eef6d44cf..fb78e3ac436b628d2ca7c20ce3f47661c78e5600 100644 (file)
@@ -4149,13 +4149,10 @@ hwloc_linux_backend_get_obj_cpuset(struct hwloc_backend *backend,
   assert(obj->type == HWLOC_OBJ_PCI_DEVICE
         || (obj->type == HWLOC_OBJ_BRIDGE && obj->attr->bridge.upstream_type == HWLOC_OBJ_BRIDGE_PCI));
 
-  /* this should not be called if the backend isn't the real OS one */
-  assert(data->is_real_fsroot);
-
   snprintf(path, sizeof(path), "/sys/bus/pci/devices/%04x:%02x:%02x.%01x/local_cpus",
           obj->attr->pcidev.domain, obj->attr->pcidev.bus,
           obj->attr->pcidev.dev, obj->attr->pcidev.func);
-  file = fopen(path, "r"); /* the libpci backend doesn't use sysfs.fsroot */
+  file = hwloc_fopen(path, "r", data->root_fd);
   if (file) {
     err = hwloc_linux_parse_cpumap_file(file, cpuset);
     fclose(file);