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: set a default value for options in `nbd map` #20529

Merged
merged 2 commits into from Feb 27, 2018

Conversation

Projects
None yet
3 participants
@Songweibin
Copy link
Contributor

commented Feb 22, 2018

Since vm does not contain an options item and
vm.at("options").value() will throw an exception.

root@s222:/ceph-dev/build# rbd nbd map img1
rbd: 'nbd map' command is deprecated, use 'device map -t nbd' instead
terminate called after throwing an instance of 'std::out_of_range'
  what():  map::at
*** Caught signal (Aborted) **
 in thread 7f0e5e046400 thread_name:rbd
 ceph version 12.0.3-11022-ga09b319 (a09b319) mimic (dev)
 1: (()+0x1afb00) [0x55a07d677b00]
 2: (()+0x10340) [0x7f0e545a0340]
 3: (gsignal()+0x39) [0x7f0e531b0cc9]
 4: (abort()+0x148) [0x7f0e531b40d8]
 5: (__gnu_cxx::__verbose_terminate_handler()+0x125) [0x7f0e53ac8415]
 6: (()+0x6a206) [0x7f0e53ac6206]
 7: (()+0x6a251) [0x7f0e53ac6251]
 8: (()+0x6a493) [0x7f0e53ac6493]
 9: (std::__throw_out_of_range(char const*)+0x3f) [0x7f0e53aeac3f]
 10: (rbd::action::nbd::execute_map_deprecated(boost::program_options::variables_map const&, std::vector<std::string, std::allocator<std::string> > const&)+0xa35) [0x55a07d5f6a15]
 11: (rbd::Shell::execute(int, char const**)+0xb5b) [0x55a07d581adb]
 12: (main()+0x15) [0x55a07d546615]
 13: (__libc_start_main()+0xf5) [0x7f0e5319bec5]
 14: (()+0xa141f) [0x55a07d56941f]
2018-02-22 13:43:59.212 7f0e5e046400 -1 *** Caught signal (Aborted) **
 in thread 7f0e5e046400 thread_name:rbd

Songweibin added some commits Feb 22, 2018

rbd: set a default value for options in `nbd map`
Since `vm` does not contain an `options` item and
`vm.at("options").value()` will throw an exception.

root@s222:/ceph-dev/build# rbd nbd map img1
rbd: 'nbd map' command is deprecated, use 'device map -t nbd' instead
terminate called after throwing an instance of 'std::out_of_range'
  what():  map::at
*** Caught signal (Aborted) **
 in thread 7f0e5e046400 thread_name:rbd
 ceph version 12.0.3-11022-ga09b319 (a09b319) mimic (dev)
 1: (()+0x1afb00) [0x55a07d677b00]
 2: (()+0x10340) [0x7f0e545a0340]
 3: (gsignal()+0x39) [0x7f0e531b0cc9]
 4: (abort()+0x148) [0x7f0e531b40d8]
 5: (__gnu_cxx::__verbose_terminate_handler()+0x125) [0x7f0e53ac8415]
 6: (()+0x6a206) [0x7f0e53ac6206]
 7: (()+0x6a251) [0x7f0e53ac6251]
 8: (()+0x6a493) [0x7f0e53ac6493]
 9: (std::__throw_out_of_range(char const*)+0x3f) [0x7f0e53aeac3f]
 10: (rbd::action::nbd::execute_map_deprecated(boost::program_options::variables_map const&,
     std::vector<std::string, std::allocator<std::string> > const&)+0xa35) [0x55a07d5f6a15]
 11: (rbd::Shell::execute(int, char const**)+0xb5b) [0x55a07d581adb]
 12: (main()+0x15) [0x55a07d546615]
 13: (__libc_start_main()+0xf5) [0x7f0e5319bec5]
 14: (()+0xa141f) [0x55a07d56941f]
2018-02-22 13:43:59.212 7f0e5e046400 -1 *** Caught signal (Aborted) **
 in thread 7f0e5e046400 thread_name:rbd

Signed-off-by: songweibin <song.weibin@zte.com.cn>
rbd: fix get image or snap spec in `nbd map`
root@s222:/ceph-dev/build# rbd nbd map img1
rbd: 'nbd map' command is deprecated, use 'device map -t nbd' instead
rbd: image name was not specified
root@s222:/ceph-dev/build# rbd nbd map -p rbd --image img1
rbd: 'nbd map' command is deprecated, use 'device map -t nbd' instead
rbd: image name was not specified

Signed-off-by: songweibin <song.weibin@zte.com.cn>

@xiexingguo xiexingguo requested a review from dillaman Feb 22, 2018

@dillaman
Copy link
Contributor

left a comment

lgtm

@dillaman dillaman merged commit b3b3a40 into ceph:master Feb 27, 2018

5 checks passed

Docs: build check OK - docs built
Details
Signed-off-by all commits in this PR are signed
Details
Unmodified Submodules submodules for project are unmodified
Details
make check make check succeeded
Details
make check (arm64) make check succeeded
Details

@Songweibin Songweibin deleted the Songweibin:wip-fix-nbd-map branch Feb 27, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.