Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/bareos/bareos.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/stored/backends/unix_file_device.cc')
-rw-r--r--core/src/stored/backends/unix_file_device.cc20
1 files changed, 20 insertions, 0 deletions
diff --git a/core/src/stored/backends/unix_file_device.cc b/core/src/stored/backends/unix_file_device.cc
index 363762c77..048f0417b 100644
--- a/core/src/stored/backends/unix_file_device.cc
+++ b/core/src/stored/backends/unix_file_device.cc
@@ -32,6 +32,7 @@
#include "include/bareos.h"
#include "stored/stored.h"
#include "stored/stored_globals.h"
+#include "stored/sd_backends.h"
#include "stored/device_control_record.h"
#include "unix_file_device.h"
#include "lib/berrno.h"
@@ -310,4 +311,23 @@ bail_out:
return true;
}
+class Backend : public BackendInterface {
+ public:
+ Device* GetDevice(JobControlRecord* jcr, DeviceType device_type) override
+ {
+ switch (device_type) {
+ case DeviceType::B_FILE_DEV:
+ return new unix_file_device;
+ default:
+ Jmsg(jcr, M_FATAL, 0, _("Request for unknown devicetype: %d\n"),
+ device_type);
+ return nullptr;
+ }
+ }
+};
+
+#ifdef HAVE_DYNAMIC_SD_BACKENDS
+extern "C" BackendInterface* GetBackend(void) { return new Backend; }
+#endif
+
} /* namespace storagedaemon */