X-Git-Url: https://git.camperquake.de/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=cmd%2Fzinject%2Fzinject.c;fp=cmd%2Fzinject%2Fzinject.c;h=60c53ceb3fce2d52259185ad7a88ff3f3a5c903a;hb=572e285762521df27fe5b026f409ba1a21abb7ac;hp=ab04e422a9b2b8a460abadd377300957f6ed8838;hpb=1980602bfae0605d3231e79627b3e25c07991b0e;p=zfs.git diff --git a/cmd/zinject/zinject.c b/cmd/zinject/zinject.c index ab04e42..60c53ce 100644 --- a/cmd/zinject/zinject.c +++ b/cmd/zinject/zinject.c @@ -233,7 +233,7 @@ usage(void) "\t\tInject a fault into a particular device or the device's\n" "\t\tlabel. Label injection can either be 'nvlist', 'uber',\n " "\t\t'pad1', or 'pad2'.\n" - "\t\t'errno' can either be 'nxio' (the default) or 'io'.\n" + "\t\t'errno' can be 'nxio' (the default), 'io', or 'dtl'.\n" "\n" "\tzinject -d device -A pool\n" "\t\tPerform a specific action on a particular device\n" @@ -395,17 +395,25 @@ print_panic_handler(int id, const char *pool, zinject_record_t *record, static int print_all_handlers(void) { - int count = 0; + int count = 0, total = 0; (void) iter_handlers(print_device_handler, &count); - (void) printf("\n"); - count = 0; + if (count > 0) { + total += count; + (void) printf("\n"); + count = 0; + } + (void) iter_handlers(print_data_handler, &count); - (void) printf("\n"); - count = 0; + if (count > 0) { + total += count; + (void) printf("\n"); + count = 0; + } + (void) iter_handlers(print_panic_handler, &count); - return (count); + return (count + total); } /* ARGSUSED */ @@ -627,6 +635,8 @@ main(int argc, char **argv) error = ECKSUM; } else if (strcasecmp(optarg, "nxio") == 0) { error = ENXIO; + } else if (strcasecmp(optarg, "dtl") == 0) { + error = ECHILD; } else { (void) fprintf(stderr, "invalid error type " "'%s': must be 'io', 'checksum' or "