Skip to content

Commit

Permalink
rbd: use semicolon to separate options from the pool/image spec
Browse files Browse the repository at this point in the history
This format will better support future expansion of additional config
option overrides.
  • Loading branch information
Jason Dillaman committed Sep 13, 2017
1 parent e6eb8b5 commit 897242e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,14 @@ o- backstores .......................................................... [...]

/backstores> cd user:rbd

/backstores/user:rbd> create cfgstring=pool/rbd1/osd_op_timeout=30 name=rbd0 size=1G
/backstores/user:rbd> create cfgstring=pool/rbd1;osd_op_timeout=30 name=rbd0 size=1G
Created user-backed storage object rbd0 size 1073741824.


Note that the cfgstring is handler specific. The format is:

(osd_op_timeout is optional and N is in seconds)
rbd: /pool_name/image_name/osd_op_timeout=N
rbd: /pool_name/image_name[;osd_op_timeout=N]
qcow: /path_to_file
glfs: /volume@hostname/filename

Expand Down
4 changes: 2 additions & 2 deletions rbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ static int tcmu_rbd_open(struct tcmu_device *dev)
goto free_config;
}

name = strtok(NULL, "/");
name = strtok(NULL, ";");
if (!name) {
tcmu_dev_err(dev, "Could not get image name\n");
ret = -EINVAL;
Expand All @@ -563,7 +563,7 @@ static int tcmu_rbd_open(struct tcmu_device *dev)
}

/* The next options are optional */
next_opt = strtok(NULL, "/");
next_opt = strtok(NULL, ";");
if (next_opt) {
if (!strncmp(next_opt, "osd_op_timeout=", 15)) {
state->osd_op_timeout = strdup(next_opt + 15);
Expand Down

0 comments on commit 897242e

Please sign in to comment.