namespace rbd {
namespace action {
+namespace export_full {
struct ExportDiffContext {
librbd::Image *image;
}
-namespace export_diff {
-
namespace at = argument_types;
namespace po = boost::program_options;
-void get_arguments(po::options_description *positional,
+void get_arguments_diff(po::options_description *positional,
po::options_description *options) {
at::add_image_or_snap_spec_options(positional, options,
at::ARGUMENT_MODIFIER_SOURCE);
at::add_no_progress_option(options);
}
-int execute(const po::variables_map &vm) {
+int execute_diff(const po::variables_map &vm) {
size_t arg_index = 0;
std::string pool_name;
std::string image_name;
}
Shell::SwitchArguments switched_arguments({at::WHOLE_OBJECT});
-Shell::Action action(
+Shell::Action action_diff(
{"export-diff"}, {}, "Export incremental diff to file.", "",
- &get_arguments, &execute);
-
-} // namespace export_diff
-
-
-namespace export_full {
-
-namespace at = argument_types;
-namespace po = boost::program_options;
+ &get_arguments_diff, &execute_diff);
class C_Export : public Context
{
namespace rbd {
namespace action {
+namespace import {
int do_import_diff_fd(librbd::Image &image, int fd,
bool no_progress, int format)
return r;
}
-namespace import_diff {
-
namespace at = argument_types;
namespace po = boost::program_options;
-void get_arguments(po::options_description *positional,
+void get_arguments_diff(po::options_description *positional,
po::options_description *options) {
at::add_path_options(positional, options,
"import file (or '-' for stdin)");
at::add_no_progress_option(options);
}
-int execute(const po::variables_map &vm) {
+int execute_diff(const po::variables_map &vm) {
std::string path;
int r = utils::get_path(vm, utils::get_positional_argument(vm, 0), &path);
if (r < 0) {
return 0;
}
-Shell::Action action(
- {"import-diff"}, {}, "Import an incremental diff.", "", &get_arguments,
- &execute);
-
-} // namespace import_diff
-
-namespace import {
-
-namespace at = argument_types;
-namespace po = boost::program_options;
+Shell::Action action_diff(
+ {"import-diff"}, {}, "Import an incremental diff.", "", &get_arguments_diff,
+ &execute_diff);
class C_Import : public Context {
public: