mirror of
https://github.com/ceph/ceph
synced 2025-01-02 09:02:34 +00:00
Merge pull request #13729 from dillaman/wip-librbd-compile-warnings
librbd: eliminate compiler warnings Reviewed-by: Mykola Golub <mgolub@mirantis.com>
This commit is contained in:
commit
496cc53de9
@ -1489,7 +1489,7 @@ void aio_writesame_test_data(rbd_image_t image, const char *test_data, uint64_t
|
||||
off += data_len;
|
||||
left -= data_len;
|
||||
}
|
||||
ASSERT_EQ(0, left);
|
||||
ASSERT_EQ(0U, left);
|
||||
free(result);
|
||||
printf("verified\n");
|
||||
|
||||
@ -1528,7 +1528,7 @@ void writesame_test_data(rbd_image_t image, const char *test_data, uint64_t off,
|
||||
off += data_len;
|
||||
left -= data_len;
|
||||
}
|
||||
ASSERT_EQ(0, left);
|
||||
ASSERT_EQ(0U, left);
|
||||
free(result);
|
||||
printf("verified\n");
|
||||
|
||||
@ -2103,14 +2103,15 @@ void aio_writesame_test_data(librbd::Image& image, const char *test_data, off_t
|
||||
off += data_len;
|
||||
left -= data_len;
|
||||
}
|
||||
ASSERT_EQ(0, left);
|
||||
ASSERT_EQ(0U, left);
|
||||
printf("verified\n");
|
||||
|
||||
*passed = true;
|
||||
}
|
||||
|
||||
void writesame_test_data(librbd::Image& image, const char *test_data, off_t off, size_t len,
|
||||
size_t data_len, uint32_t iohint, bool *passed)
|
||||
void writesame_test_data(librbd::Image& image, const char *test_data, off_t off,
|
||||
ssize_t len, size_t data_len, uint32_t iohint,
|
||||
bool *passed)
|
||||
{
|
||||
ssize_t written;
|
||||
ceph::bufferlist bl;
|
||||
@ -2144,7 +2145,7 @@ void writesame_test_data(librbd::Image& image, const char *test_data, off_t off,
|
||||
off += data_len;
|
||||
left -= data_len;
|
||||
}
|
||||
ASSERT_EQ(0, left);
|
||||
ASSERT_EQ(0U, left);
|
||||
printf("verified\n");
|
||||
|
||||
*passed = true;
|
||||
|
@ -56,7 +56,6 @@ ManagedLock<MockTestImageCtx> *ManagedLock<MockTestImageCtx>::s_instance = nullp
|
||||
|
||||
// template definitions
|
||||
#include "tools/rbd_mirror/InstanceWatcher.cc"
|
||||
template class rbd::mirror::InstanceWatcher<librbd::MockTestImageCtx>;
|
||||
|
||||
namespace rbd {
|
||||
namespace mirror {
|
||||
|
@ -511,5 +511,15 @@ void validate(boost::any& v, const std::vector<std::string>& values,
|
||||
v = boost::any(format);
|
||||
}
|
||||
|
||||
void validate(boost::any& v, const std::vector<std::string>& values,
|
||||
Secret *target_type, int) {
|
||||
std::cerr << "rbd: --secret is deprecated, use --keyfile" << std::endl;
|
||||
|
||||
po::validators::check_first_occurrence(v);
|
||||
const std::string &s = po::validators::get_single_string(values);
|
||||
g_conf->set_val_or_die("keyfile", s.c_str());
|
||||
v = boost::any(s);
|
||||
}
|
||||
|
||||
} // namespace argument_types
|
||||
} // namespace rbd
|
||||
|
@ -116,8 +116,7 @@ struct JournalObjectSize {};
|
||||
|
||||
struct ExportFormat {};
|
||||
|
||||
void validate(boost::any& v, const std::vector<std::string>& values,
|
||||
ExportFormat *target_type, int);
|
||||
struct Secret {};
|
||||
|
||||
void add_export_format_option(boost::program_options::options_description *opt);
|
||||
|
||||
@ -197,6 +196,8 @@ void add_no_error_option(boost::program_options::options_description *opt);
|
||||
std::string get_short_features_help(bool append_suffix);
|
||||
std::string get_long_features_help();
|
||||
|
||||
void validate(boost::any& v, const std::vector<std::string>& values,
|
||||
ExportFormat *target_type, int);
|
||||
void validate(boost::any& v, const std::vector<std::string>& values,
|
||||
ImageSize *target_type, int);
|
||||
void validate(boost::any& v, const std::vector<std::string>& values,
|
||||
@ -213,6 +214,9 @@ void validate(boost::any& v, const std::vector<std::string>& values,
|
||||
Format *target_type, int);
|
||||
void validate(boost::any& v, const std::vector<std::string>& values,
|
||||
JournalObjectSize *target_type, int);
|
||||
void validate(boost::any& v, const std::vector<std::string>& values,
|
||||
Secret *target_type, int);
|
||||
|
||||
|
||||
std::ostream &operator<<(std::ostream &os, const ImageFeatures &features);
|
||||
|
||||
|
@ -23,18 +23,6 @@ static const std::string APP_NAME("rbd");
|
||||
static const std::string HELP_SPEC("help");
|
||||
static const std::string BASH_COMPLETION_SPEC("bash-completion");
|
||||
|
||||
struct Secret {};
|
||||
|
||||
void validate(boost::any& v, const std::vector<std::string>& values,
|
||||
Secret *target_type, int) {
|
||||
std::cerr << "rbd: --secret is deprecated, use --keyfile" << std::endl;
|
||||
|
||||
po::validators::check_first_occurrence(v);
|
||||
const std::string &s = po::validators::get_single_string(values);
|
||||
g_conf->set_val_or_die("keyfile", s.c_str());
|
||||
v = boost::any(s);
|
||||
}
|
||||
|
||||
std::string format_command_spec(const Shell::CommandSpec &spec) {
|
||||
return joinify<std::string>(spec.begin(), spec.end(), " ");
|
||||
}
|
||||
@ -252,7 +240,7 @@ void Shell::get_global_options(po::options_description *opts) {
|
||||
("user", po::value<std::string>(), "client id (without 'client.' prefix)")
|
||||
("name,n", po::value<std::string>(), "client name")
|
||||
("mon_host,m", po::value<std::string>(), "monitor host")
|
||||
("secret", po::value<Secret>(), "path to secret key (deprecated)")
|
||||
("secret", po::value<at::Secret>(), "path to secret key (deprecated)")
|
||||
("keyfile,K", po::value<std::string>(), "path to secret key")
|
||||
("keyring,k", po::value<std::string>(), "path to keyring");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user