From 108f4363ae31e94928792e7ab3ae1a2cbd5e3c41 Mon Sep 17 00:00:00 2001 From: Lucian Petrut Date: Tue, 23 Feb 2021 12:37:59 +0000 Subject: [PATCH] rbd: fix rbd-wnbd log messages Previously, rbd-wnbd was called "rbd-nbd" as it was using NBD to communicate with the driver. The tool was then renamed to "rbd-wnbd" but some messages were not updated. This patch will simply replace "rbd-nbd" with "rbd-wnbd" in some log messages. Signed-off-by: Lucian Petrut --- src/tools/rbd_wnbd/rbd_wnbd.cc | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/tools/rbd_wnbd/rbd_wnbd.cc b/src/tools/rbd_wnbd/rbd_wnbd.cc index 0b4cbb650c2..b4e94ab692c 100644 --- a/src/tools/rbd_wnbd/rbd_wnbd.cc +++ b/src/tools/rbd_wnbd/rbd_wnbd.cc @@ -1205,7 +1205,7 @@ static int do_unmap(Config *cfg, bool unregister) if (unregister) { err = remove_config_from_registry(cfg); if (err) { - derr << "rbd-nbd: failed to unregister device: " + derr << "rbd-wnbd: failed to unregister device: " << cfg->devpath << ". Error: " << err << dendl; return -EINVAL; } @@ -1249,7 +1249,7 @@ static int do_list_mapped_devices(const std::string &format, bool pretty_format) } else if (format == "xml") { f.reset(new XMLFormatter(pretty_format)); } else if (!format.empty() && format != "plain") { - derr << "rbd-nbd: invalid output format: " << format << dendl; + derr << "rbd-wnbd: invalid output format: " << format << dendl; return -EINVAL; } @@ -1324,7 +1324,7 @@ static int do_show_mapped_device(std::string format, bool pretty_format, } else if (format == "xml") { f.reset(new XMLFormatter(pretty_format)); } else { - derr << "rbd-nbd: invalid output format: " << format << dendl; + derr << "rbd-wnbd: invalid output format: " << format << dendl; return -EINVAL; } @@ -1453,41 +1453,41 @@ static int parse_args(std::vector& args, } else if (ceph_argparse_witharg(args, i, (int*)&cfg->wnbd_log_level, err, "--wnbd-log-level", (char *)NULL)) { if (!err.str().empty()) { - *err_msg << "rbd-nbd: " << err.str(); + *err_msg << "rbd-wnbd: " << err.str(); return -EINVAL; } if (cfg->wnbd_log_level < 0) { - *err_msg << "rbd-nbd: Invalid argument for wnbd-log-level"; + *err_msg << "rbd-wnbd: Invalid argument for wnbd-log-level"; return -EINVAL; } } else if (ceph_argparse_witharg(args, i, (int*)&cfg->io_req_workers, err, "--io-req-workers", (char *)NULL)) { if (!err.str().empty()) { - *err_msg << "rbd-nbd: " << err.str(); + *err_msg << "rbd-wnbd: " << err.str(); return -EINVAL; } if (cfg->io_req_workers <= 0) { - *err_msg << "rbd-nbd: Invalid argument for io-req-workers"; + *err_msg << "rbd-wnbd: Invalid argument for io-req-workers"; return -EINVAL; } } else if (ceph_argparse_witharg(args, i, (int*)&cfg->io_reply_workers, err, "--io-reply-workers", (char *)NULL)) { if (!err.str().empty()) { - *err_msg << "rbd-nbd: " << err.str(); + *err_msg << "rbd-wnbd: " << err.str(); return -EINVAL; } if (cfg->io_reply_workers <= 0) { - *err_msg << "rbd-nbd: Invalid argument for io-reply-workers"; + *err_msg << "rbd-wnbd: Invalid argument for io-reply-workers"; return -EINVAL; } } else if (ceph_argparse_witharg(args, i, (int*)&cfg->service_thread_count, err, "--service-thread-count", (char *)NULL)) { if (!err.str().empty()) { - *err_msg << "rbd-nbd: " << err.str(); + *err_msg << "rbd-wnbd: " << err.str(); return -EINVAL; } if (cfg->service_thread_count <= 0) { - *err_msg << "rbd-nbd: Invalid argument for service-thread-count"; + *err_msg << "rbd-wnbd: Invalid argument for service-thread-count"; return -EINVAL; } } else if (ceph_argparse_flag(args, i, "--hard-disconnect", (char *)NULL)) { @@ -1500,11 +1500,11 @@ static int parse_args(std::vector& args, err, "--soft-disconnect-timeout", (char *)NULL)) { if (!err.str().empty()) { - *err_msg << "rbd-nbd: " << err.str(); + *err_msg << "rbd-wnbd: " << err.str(); return -EINVAL; } if (cfg->soft_disconnect_timeout < 0) { - *err_msg << "rbd-nbd: Invalid argument for soft-disconnect-timeout"; + *err_msg << "rbd-wnbd: Invalid argument for soft-disconnect-timeout"; return -EINVAL; } } else if (ceph_argparse_witharg(args, i, @@ -1512,11 +1512,11 @@ static int parse_args(std::vector& args, err, "--start-timeout", (char *)NULL)) { if (!err.str().empty()) { - *err_msg << "rbd-nbd: " << err.str(); + *err_msg << "rbd-wnbd: " << err.str(); return -EINVAL; } if (cfg->service_start_timeout <= 0) { - *err_msg << "rbd-nbd: Invalid argument for start-timeout"; + *err_msg << "rbd-wnbd: Invalid argument for start-timeout"; return -EINVAL; } } else if (ceph_argparse_witharg(args, i, @@ -1524,11 +1524,11 @@ static int parse_args(std::vector& args, err, "--map-timeout", (char *)NULL)) { if (!err.str().empty()) { - *err_msg << "rbd-nbd: " << err.str(); + *err_msg << "rbd-wnbd: " << err.str(); return -EINVAL; } if (cfg->image_map_timeout <= 0) { - *err_msg << "rbd-nbd: Invalid argument for map-timeout"; + *err_msg << "rbd-wnbd: Invalid argument for map-timeout"; return -EINVAL; } } else { -- 2.39.5