diff options
author | Quincey Koziol <koziol@lbl.gov> | 2020-12-10 17:01:04 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-10 17:01:04 (GMT) |
commit | 17a2e88769c15d8684bda4d8a6c9f53836f7b65b (patch) | |
tree | e11decdcdfdd7bf594475b3d9520a403d1478d49 /src/H5PLint.c | |
parent | 4713a6d23840ed222d90f3ca73f037cb20b5d444 (diff) | |
download | hdf5-17a2e88769c15d8684bda4d8a6c9f53836f7b65b.zip hdf5-17a2e88769c15d8684bda4d8a6c9f53836f7b65b.tar.gz hdf5-17a2e88769c15d8684bda4d8a6c9f53836f7b65b.tar.bz2 |
Enforce VOL framework version compatibility when registering connectors. Also add a version for the connector itself, some refactoring on the register calls, and move the logic for matching / rejecting a VOL connector class from the plugin module to the VOL module. (#151)
Diffstat (limited to 'src/H5PLint.c')
-rw-r--r-- | src/H5PLint.c | 29 |
1 files changed, 9 insertions, 20 deletions
diff --git a/src/H5PLint.c b/src/H5PLint.c index 0975a9e..3b9683b 100644 --- a/src/H5PLint.c +++ b/src/H5PLint.c @@ -354,30 +354,19 @@ H5PL__open(const char *path, H5PL_type_t type, const H5PL_key_t *key, hbool_t *s } case H5PL_TYPE_VOL: { - const H5VL_class_t *cls; + const void *cls; /* Get the plugin info */ - if (NULL == (cls = (const H5VL_class_t *)(*get_plugin_info)())) + if (NULL == (cls = (const void *)(*get_plugin_info)())) HGOTO_ERROR(H5E_PLUGIN, H5E_CANTGET, FAIL, "can't get VOL connector info from plugin") - /* Which kind of key are we looking for? */ - if (key->vol.kind == H5VL_GET_CONNECTOR_BY_NAME) { - /* If the plugin names match, we're done. Set the output parameters. */ - if (cls->name && !HDstrcmp(cls->name, key->vol.u.name)) { - *plugin_info = (const void *)cls; - *success = TRUE; - } /* end if */ - } /* end if */ - else { - /* Sanity check */ - HDassert(key->vol.kind == H5VL_GET_CONNECTOR_BY_VALUE); - - /* If the plugin values match, we're done. Set the output parameters. */ - if (cls->value == key->vol.u.value) { - *plugin_info = (const void *)cls; - *success = TRUE; - } /* end if */ - } /* end else */ + /* Ask VOL interface if this class is the one we are looking for and is compatible, etc */ + if (H5VL_check_plugin_load(cls, key, success) < 0) + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTLOAD, FAIL, "VOL connector compatibility check failed") + + /* Check for finding the correct plugin */ + if (*success) + *plugin_info = cls; break; } |