From 2632738aea79e61fda0381d3ac1c0a4a4560d32d Mon Sep 17 00:00:00 2001 From: Pranith Kumar K Date: Tue, 2 Jan 2018 20:53:27 +0530 Subject: debug/delay-gen: volume option fixes for GD2 Updates #302 Change-Id: I2c7ab85364337d0bc00428e0001ddc4038e08174 Signed-off-by: Pranith Kumar K --- xlators/debug/delay-gen/src/delay-gen.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'xlators/debug/delay-gen') diff --git a/xlators/debug/delay-gen/src/delay-gen.c b/xlators/debug/delay-gen/src/delay-gen.c index 9dc82338bfc..849ebeaabcd 100644 --- a/xlators/debug/delay-gen/src/delay-gen.c +++ b/xlators/debug/delay-gen/src/delay-gen.c @@ -529,7 +529,7 @@ delay_gen_parse_fill_fops (dg_t *dg, char *enable_fops) char *saveptr = NULL; char *dup_enable_fops = NULL; - if (!enable_fops) { + if (strlen (enable_fops) == 0) { for (i = GF_FOP_NULL + 1; i < GF_FOP_MAXVALUE; i++) dg->enable[i] = 1; } else { @@ -720,16 +720,28 @@ struct volume_options options[] = { .type = GF_OPTION_TYPE_PERCENT, .default_value = "10%", .description = "Percentage delay of operations when enabled.", + .op_version = {GD_OP_VERSION_3_13_0}, + .flags = OPT_FLAG_SETTABLE, + .tags = {"delay-gen"}, }, { .key = {"delay-duration"}, .type = GF_OPTION_TYPE_INT, .description = "Delay duration in micro seconds", .default_value = "100000", + .op_version = {GD_OP_VERSION_3_13_0}, + .flags = OPT_FLAG_SETTABLE, + .tags = {"delay-gen"}, }, { .key = {"enable"}, .type = GF_OPTION_TYPE_STR, + .description = "Accepts a string which takes ',' separated fop " + "strings to denote which fops are enabled for delay", + .op_version = {GD_OP_VERSION_3_13_0}, + .flags = OPT_FLAG_SETTABLE, + .tags = {"delay-gen"}, + .default_value = "", }, { .key = {NULL} } -- cgit