diff options
author | Andreas Rogge <andreas.rogge@bareos.com> | 2022-10-11 15:01:49 +0300 |
---|---|---|
committer | Andreas Rogge <andreas.rogge@bareos.com> | 2022-11-07 19:40:27 +0300 |
commit | e81c6780ad86c133da82b53c59fada5dee433f9b (patch) | |
tree | 2bf5de7b271e0415c2b438b63c51a3648fd509a4 | |
parent | 3ee0e4b23c3f5f3b4f3c23c337b62895dcf71126 (diff) |
stored: don't call Device::IsTape() unneccessary
Previously IsTape() was called for display purposes. This patch displays
the configured Device Type instead.
-rw-r--r-- | core/src/stored/acquire.cc | 2 | ||||
-rw-r--r-- | core/src/stored/dev.h | 1 | ||||
-rw-r--r-- | core/src/stored/status.cc | 27 |
3 files changed, 15 insertions, 15 deletions
diff --git a/core/src/stored/acquire.cc b/core/src/stored/acquire.cc index cd4e266de..76732d442 100644 --- a/core/src/stored/acquire.cc +++ b/core/src/stored/acquire.cc @@ -437,7 +437,7 @@ DeviceControlRecord* AcquireDeviceForAppend(DeviceControlRecord* dcr) dev->Lock_acquire(); /* only one job at a time */ dev->Lock(); - Dmsg1(100, "acquire_append device is %s\n", dev->IsTape() ? "tape" : "disk"); + Dmsg1(100, "acquire_append device is %s\n", dev->type().c_str()); // With the reservation system, this should not happen if (dev->CanRead()) { diff --git a/core/src/stored/dev.h b/core/src/stored/dev.h index 613caee49..823761872 100644 --- a/core/src/stored/dev.h +++ b/core/src/stored/dev.h @@ -335,6 +335,7 @@ class Device { const char* strerror() const; const char* archive_name() const; const char* name() const; + const std::string& type() const { return dev_type; } const char* print_name() const; /**< Name for display purposes */ void SetEot() { SetBit(ST_EOT, state); } void SetEof() { SetBit(ST_EOF, state); } diff --git a/core/src/stored/status.cc b/core/src/stored/status.cc index 7a662f69c..3e76b991f 100644 --- a/core/src/stored/status.cc +++ b/core/src/stored/status.cc @@ -597,18 +597,17 @@ static void SendDeviceStatus(Device* dev, StatusPacket* sp) len = Mmsg(msg, _("Device state:\n")); sp->send(msg, len); - len = Mmsg( - msg, - " %sOPENED %sTAPE %sLABEL %sMALLOC %sAPPEND %sREAD %sEOT %sWEOT %sEOF " - "%sNEXTVOL %sSHORT %sMOUNTED\n", - dev->IsOpen() ? "" : "!", dev->IsTape() ? "" : "!", - dev->IsLabeled() ? "" : "!", - BitIsSet(ST_ALLOCATED, dev->state) ? "" : "!", - dev->CanAppend() ? "" : "!", dev->CanRead() ? "" : "!", - dev->AtEot() ? "" : "!", BitIsSet(ST_WEOT, dev->state) ? "" : "!", - dev->AtEof() ? "" : "!", BitIsSet(ST_NEXTVOL, dev->state) ? "" : "!", - BitIsSet(ST_SHORT, dev->state) ? "" : "!", - BitIsSet(ST_MOUNTED, dev->state) ? "" : "!"); + len = Mmsg(msg, + " %sOPENED %sLABEL %sMALLOC %sAPPEND %sREAD %sEOT %sWEOT %sEOF " + "%sNEXTVOL %sSHORT %sMOUNTED\n", + dev->IsOpen() ? "" : "!", dev->IsLabeled() ? "" : "!", + BitIsSet(ST_ALLOCATED, dev->state) ? "" : "!", + dev->CanAppend() ? "" : "!", dev->CanRead() ? "" : "!", + dev->AtEot() ? "" : "!", BitIsSet(ST_WEOT, dev->state) ? "" : "!", + dev->AtEof() ? "" : "!", + BitIsSet(ST_NEXTVOL, dev->state) ? "" : "!", + BitIsSet(ST_SHORT, dev->state) ? "" : "!", + BitIsSet(ST_MOUNTED, dev->state) ? "" : "!"); sp->send(msg, len); len = Mmsg(msg, _(" num_writers=%d reserves=%d block=%d\n"), @@ -634,8 +633,8 @@ static void SendDeviceStatus(Device* dev, StatusPacket* sp) len = Mmsg(msg, _("Device parameters:\n")); sp->send(msg, len); - len = Mmsg(msg, _(" Archive name: %s Device name: %s\n"), - dev->archive_name(), dev->name()); + len = Mmsg(msg, _(" Archive name: %s\nDevice name: %s\nDevice Type: %s\n"), + dev->archive_name(), dev->name(), dev->type().c_str()); sp->send(msg, len); len = Mmsg(msg, _(" File=%u block=%u\n"), dev->file, dev->block_num); sp->send(msg, len); |