HEX

Warning: set_time_limit() [function.set-time-limit]: Cannot set time limit - prohibited by configuration in /home/u547966/brikov.ru/www/wp-content/plugins/admin-menu-editor/menu-editor.php on line 745
Server: Apache
System: Linux 4.19.0-0.bpo.9-amd64 x86_64 at red40
User: u547966 (5490)
PHP: 5.3.29-mh2
Disabled: syslog, dl, popen, proc_open, proc_nice, proc_get_status, proc_close, proc_terminate, posix_mkfifo, chown, chgrp, accelerator_reset, opcache_reset, accelerator_get_status, opcache_get_status, pcntl_alarm, pcntl_fork, pcntl_waitpid, pcntl_wait, pcntl_wifexited, pcntl_wifstopped, pcntl_wifsignaled, pcntl_wifcontinued, pcntl_wexitstatus, pcntl_wtermsig, pcntl_wstopsig, pcntl_signal, pcntl_signal_dispatch, pcntl_get_last_error, pcntl_strerror, pcntl_sigprocmask, pcntl_sigwaitinfo, pcntl_sigtimedwait, pcntl_exec, pcntl_getpriority, pcntl_setpriority
Upload Files
File: //usr/share/doc/bareos-common/README.storagebackend
Adding additional storage backends:

- Creating a new backend:
   - Create a new derived class of DEVICE e.g.

      class whatever_device: public DEVICE {
      private:
         POOLMEM *m_virtual_filename;
         boffset_t m_offset;

      public:
         whatever_device();
         ~whatever_device();

         /*
          * Interface from DEVICE
          */
         int d_close(int);
         int d_open(const char *pathname, int flags, int mode);
         int d_ioctl(int fd, ioctl_req_t request, char *mt = NULL);
         boffset_t d_lseek(DCR *dcr, boffset_t offset, int whence);
         ssize_t d_read(int fd, void *buffer, size_t count);
         ssize_t d_write(int fd, const void *buffer, size_t count);
         bool d_truncate(DCR *dcr);
      };

      In file src/stored/backends/whatever_device.h
   - Create a new class implementing the pure virtual methods.
      In file src/stored/backends/whatever_device.c

     There are plenty of examples.
   - Add build rules to src/stored/backends/Makefile.in
   - Add new backend to AVAILABLE_DEVICE_API_SRCS in src/stored/Makefile.in for non dynamic loading.

- Glue code for loading and using the new backend
   - Add new enum value to Device types enum in src/stored/dev.h
   - Add new enum value to is_file() method of DEVICE class.
   - Add new enum mapping to dev_types array in src/stored/stored_conf.c
   - For static allocation of new backend add code to m_init_dev() in src/stored/dev.c
     (In switch (device->dev_type) which dispatches based on device type)
   - Add mapping for dynamic loading of backend to src/stored/sd_backends.h