Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rbd : make option --stripe-unit w/ B/K/M work. #12407

Merged
merged 1 commit into from Dec 16, 2016

Conversation

majianpeng
Copy link
Member

As 'man rbd' said: --stripe-unit size-in-B/K/M. But w/ B/K/M, the
command failed and said invalid options. So fix it.

Signed-off-by: Jianpeng Ma jianpeng.ma@intel.com

@@ -270,7 +270,7 @@ void add_create_image_options(po::options_description *opt,
(IMAGE_FEATURES.c_str(), po::value<ImageFeatures>()->composing(),
("image features\n" + get_short_features_help(true)).c_str())
(IMAGE_SHARED.c_str(), po::bool_switch(), "shared image")
(IMAGE_STRIPE_UNIT.c_str(), po::value<uint64_t>(), "stripe unit")
(IMAGE_STRIPE_UNIT.c_str(), po::value<ImageObjectSize>(), "stripe unit")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: can you update the description to document that it accepts B/K/M (like object size above)? You will need to update the cli test due to the help test change.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@majianpeng Still need to update the text here (to match the updated help.t test case)

@majianpeng
Copy link
Member Author

@dillaman . The 'man rbd' always said --stripe-unit can w/ B/K/M. I don't find other test case.
I only find in file "src/test/cli-integration/rbd/defaults.t ". They used stripe-unit. But they also used B/K. But I don't know those tests whether pass test.

@dillaman
Copy link

@dillaman
Copy link

Nit: can you remove the extra space between "rbd" and the colon in your commit title?

@majianpeng
Copy link
Member Author

@dillaman . update

@@ -270,7 +270,7 @@ void add_create_image_options(po::options_description *opt,
(IMAGE_FEATURES.c_str(), po::value<ImageFeatures>()->composing(),
("image features\n" + get_short_features_help(true)).c_str())
(IMAGE_SHARED.c_str(), po::bool_switch(), "shared image")
(IMAGE_STRIPE_UNIT.c_str(), po::value<uint64_t>(), "stripe unit")
(IMAGE_STRIPE_UNIT.c_str(), po::value<ImageObjectSize>(), "stripe unit in B/K/M")
(IMAGE_STRIPE_COUNT.c_str(), po::value<uint64_t>(), "stripe count")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In fact, if used wrong format. It don't show "stripe unit in B/K/M". It only print IMAGE_STRIEP_UNIT.c_str().

@dillaman
Copy link

@majianpeng If you look at the build log, you can see that there are several additional places within help.t that need to be updated.

@majianpeng
Copy link
Member Author

@dillaman . Run the failed test on my machine, it passed.

As 'man rbd' said:  --stripe-unit size-in-B/K/M. But w/ B/K/M, the
command failed and said invalid options. So fix it.

Signed-off-by: Jianpeng Ma <jianpeng.ma@intel.com>
Copy link

@dillaman dillaman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@dillaman dillaman merged commit 9a79286 into ceph:master Dec 16, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants