Add support to decode a resume token

Adding a new subcommand to zstream called token. This
now allows users to decode a resume token to retrieve the toname
field. This can be useful for tools that need this information.
The syntax works as follows zstream token <resume_token>.

Reviewed-by: Matt Ahrens <matt@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Paul Zuchowski <pzuchowski@datto.com>
Signed-off-by: Tony Perkins <tperkins@datto.com>
Closes #10558
This commit is contained in:
tony-zfs
2020-07-23 20:44:03 -04:00
committed by GitHub
parent bfafe1780a
commit 02fced3067
7 changed files with 127 additions and 1 deletions
+5
View File
@@ -15,6 +15,7 @@
/*
* Copyright (c) 2020 by Delphix. All rights reserved.
* Copyright (c) 2020 by Datto Inc. All rights reserved.
*/
#include <sys/types.h>
#include <sys/stat.h>
@@ -39,6 +40,8 @@ zstream_usage(void)
"\tzstream dump [-vCd] FILE\n"
"\t... | zstream dump [-vCd]\n"
"\n"
"\tzstream token resume_token\n"
"\n"
"\tzstream redup [-v] FILE | ...\n");
exit(1);
}
@@ -53,6 +56,8 @@ main(int argc, char *argv[])
if (strcmp(subcommand, "dump") == 0) {
return (zstream_do_dump(argc - 1, argv + 1));
} else if (strcmp(subcommand, "token") == 0) {
return (zstream_do_token(argc - 1, argv + 1));
} else if (strcmp(subcommand, "redup") == 0) {
return (zstream_do_redup(argc - 1, argv + 1));
} else {