summaryrefslogtreecommitdiffstats
path: root/tools/src/h5diff
diff options
context:
space:
mode:
authorDana Robinson <43805+derobins@users.noreply.github.com>2022-08-02 19:54:40 (GMT)
committerGitHub <noreply@github.com>2022-08-02 19:54:40 (GMT)
commitfcf41b3cd60df51af9be529e379a9dd6c488d088 (patch)
treee486d5f8254a33b978c34069b9810ce171ba7c2c /tools/src/h5diff
parentea13de1bb0aba8a97c75f10343dc4c792193b215 (diff)
downloadhdf5-fcf41b3cd60df51af9be529e379a9dd6c488d088.zip
hdf5-fcf41b3cd60df51af9be529e379a9dd6c488d088.tar.gz
hdf5-fcf41b3cd60df51af9be529e379a9dd6c488d088.tar.bz2
Onion VFD (#1953)
* Onion VFD feature * Fixes onion VFD errors with non-sec2 backing store VFDs * Disables the onion VFD tests w/ ph5diff * Disables non-sec2 VFDs as onion VFD backing stores * Committing clang-format changes * Formatted source * Typo * Adds onion VFD tools tests to CMake * Fixes for v16 API compatibility * Memset structs to avoid bad frees on errors * H5Dwrite() calls now use H5T_NATIVE_INT as the memory type vs LE * Properly decodes checksums on BE machines * Be more careful about uint64_t to haddr_t/hsize_t conversions * Another fix for BE data comparison * Removed double underscores from onion constants * Replace hard-coded onion header string w/ constant * Fixes cleanup paths in H5FD__onion_ingest_history() * Fixed use of size_t revision numbers * Fix h5dump revision count format string Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Diffstat (limited to 'tools/src/h5diff')
-rw-r--r--tools/src/h5diff/h5diff_common.c58
1 files changed, 57 insertions, 1 deletions
diff --git a/tools/src/h5diff/h5diff_common.c b/tools/src/h5diff/h5diff_common.c
index 433f0c7..87c08be 100644
--- a/tools/src/h5diff/h5diff_common.c
+++ b/tools/src/h5diff/h5diff_common.c
@@ -56,6 +56,28 @@ static struct h5_long_options l_opts[] = {{"help", no_arg, 'h'},
{"vfd-info-2", require_arg, 'Z'},
{NULL, 0, '\0'}};
+static H5FD_onion_fapl_info_t onion_fa_g_1 = {
+ H5FD_ONION_FAPL_INFO_VERSION_CURR,
+ H5P_DEFAULT, /* backing_fapl_id */
+ 32, /* page_size */
+ H5FD_ONION_STORE_TARGET_ONION, /* store_target */
+ H5FD_ONION_FAPL_INFO_REVISION_ID_LATEST,
+ 0, /* force_write_open */
+ 0, /* creation_flags */
+ "first input file", /* comment */
+};
+
+static H5FD_onion_fapl_info_t onion_fa_g_2 = {
+ H5FD_ONION_FAPL_INFO_VERSION_CURR,
+ H5P_DEFAULT, /* backing_fapl_id */
+ 32, /* page_size */
+ H5FD_ONION_STORE_TARGET_ONION, /* store_target */
+ H5FD_ONION_FAPL_INFO_REVISION_ID_LATEST,
+ 0, /* force_write_open */
+ 0, /* creation_flags */
+ "second input file", /* comment */
+};
+
/*-------------------------------------------------------------------------
* Function: check_options
*
@@ -451,7 +473,7 @@ parse_command_line(int argc, const char *const *argv, const char **fname1, const
case '8':
opts->vfd_info[0].type = VFD_BY_NAME;
opts->vfd_info[0].u.name = H5_optarg;
- opts->custom_vol[0] = TRUE;
+ opts->custom_vfd[0] = TRUE;
break;
case '9':
@@ -476,6 +498,40 @@ parse_command_line(int argc, const char *const *argv, const char **fname1, const
}
}
+ /* If file 1 uses the onion VFD, get the revision number */
+ if (opts->vfd_info[0].u.name && !HDstrcmp(opts->vfd_info[0].u.name, "onion")) {
+ if (opts->vfd_info[0].info) {
+ errno = 0;
+ onion_fa_g_1.revision_num = HDstrtoull(opts->vfd_info[0].info, NULL, 10);
+ if (errno == ERANGE) {
+ HDprintf("Invalid onion revision specified for file 1\n");
+ usage();
+ h5diff_exit(EXIT_FAILURE);
+ }
+ }
+ else
+ onion_fa_g_1.revision_num = 0;
+
+ opts->vfd_info[0].info = &onion_fa_g_1;
+ }
+
+ /* If file 2 uses the onion VFD, get the revision number */
+ if (opts->vfd_info[1].u.name && !HDstrcmp(opts->vfd_info[1].u.name, "onion")) {
+ if (opts->vfd_info[1].info) {
+ errno = 0;
+ onion_fa_g_2.revision_num = HDstrtoull(opts->vfd_info[1].info, NULL, 10);
+ if (errno == ERANGE) {
+ HDprintf("Invalid onion revision specified for file 2\n");
+ usage();
+ h5diff_exit(EXIT_FAILURE);
+ }
+ }
+ else
+ onion_fa_g_2.revision_num = 0;
+
+ opts->vfd_info[1].info = &onion_fa_g_2;
+ }
+
/* check options */
check_options(opts);