diff options
author | ek110237 <none@none> | 2007-09-04 12:08:58 -0700 |
---|---|---|
committer | ek110237 <none@none> | 2007-09-04 12:08:58 -0700 |
commit | 2a6b87f07ac0c0b819179c84afe5a60afa04cfa5 (patch) | |
tree | 501721740aafdd4c211379f594bffcd0f2c935c2 /usr/src/cmd/zfs | |
parent | 437220cd296f6d8b6654d6d52508b40b1e2d1ac7 (diff) | |
download | illumos-joyent-2a6b87f07ac0c0b819179c84afe5a60afa04cfa5.tar.gz |
6595467 libzfs consumers should be allowed to write their own history (or none at all)
6595470 zpool_stage_history() should take a single string
6596228 zfs upgrade -a doesn't always log to all pools
Diffstat (limited to 'usr/src/cmd/zfs')
-rw-r--r-- | usr/src/cmd/zfs/zfs_main.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/usr/src/cmd/zfs/zfs_main.c b/usr/src/cmd/zfs/zfs_main.c index cab179c5d7..b7fffb2973 100644 --- a/usr/src/cmd/zfs/zfs_main.c +++ b/usr/src/cmd/zfs/zfs_main.c @@ -57,8 +57,7 @@ libzfs_handle_t *g_zfs; static FILE *mnttab_file; -static int first_argc; -static char **first_argv; +static char history_str[HIS_MAX_RECORD_LEN]; static int zfs_do_clone(int argc, char **argv); static int zfs_do_create(int argc, char **argv); @@ -1299,7 +1298,7 @@ same_pool(zfs_handle_t *zhp, const char *name) if (len1 != len2) return (B_FALSE); - return (strncmp(name, zhname, len1) != 0); + return (strncmp(name, zhname, len1) == 0); } static int @@ -1355,8 +1354,7 @@ upgrade_set_callback(zfs_handle_t *zhp, void *data) * be doing ioctls to different pools. We need * to log this history once to each pool. */ - zpool_stage_history(g_zfs, first_argc, first_argv, - B_TRUE); + verify(zpool_stage_history(g_zfs, history_str) == 0); } if (zfs_prop_set(zhp, "version", verstr) == 0) cb->cb_numupgraded++; @@ -3816,16 +3814,14 @@ main(int argc, char **argv) opterr = 0; - first_argc = argc; - first_argv = argv; - if ((g_zfs = libzfs_init()) == NULL) { (void) fprintf(stderr, gettext("internal error: failed to " "initialize ZFS library\n")); return (1); } - zpool_stage_history(g_zfs, argc, argv, B_TRUE); + zpool_set_history_str("zfs", argc, argv, history_str); + verify(zpool_stage_history(g_zfs, history_str) == 0); libzfs_print_on_error(g_zfs, B_TRUE); |