return NULL;
}
dev = New(cloud_dev(jcr, device));
- dev->capabilities |= CAP_LSEEK;
return dev;
}
Enter(dbglvl);
m_fd = -1;
*full_type = 0;
- capabilities |= CAP_LSEEK;
/* Initialize Cloud driver */
if (!driver) {
cloud_prox = cloud_proxy::get_instance();
}
+int cloud_dev::device_specific_init(JCR *jcr, DEVRES *device)
+{
+ // Don't forget to do capabilities |= CAP_LSEEK in device_specific_init()
+ return file_dev::device_specific_init(jcr, device);
+}
+
/*
* DEVICE virtuals that we redefine.
*/
Leave(dbglvl);
return ret;
}
+
void get_api_cloud_upload_transfer_status(OutputWriter &ow, bool verbose);
uint32_t get_cloud_download_transfer_status(POOL_MEM &msg, bool verbose);
void get_api_cloud_download_transfer_status(OutputWriter &ow, bool verbose);
+ virtual int device_specific_init(JCR *jcr, DEVRES *device);
};
/* Exported subroutines */
return "FIFO";
}
+int fifo_dev::device_specific_init(JCR *jcr, DEVRES *device)
+{
+ capabilities |= CAP_STREAM;
+ return 0;
+}
+
boffset_t lseek(DCR *dcr, boffset_t offset, int whence);
bool truncate(DCR *dcr);
const char *print_type();
+ virtual int device_specific_init(JCR *jcr, DEVRES *device);
};
#endif /* __FIFO_DEV_ */
{
return "File";
}
+
+int file_dev::device_specific_init(JCR *jcr, DEVRES *device)
+{
+ // Called by child to get the CAP_LSEEK
+ capabilities |= CAP_LSEEK;
+ return 0;
+}
bool eod(DCR *dcr);
bool open_device(DCR *dcr, int omode);
const char *print_type();
+ virtual int device_specific_init(JCR *jcr, DEVRES *device);
};
#endif /* __FILE_DEV_ */
case B_ALIGNED_DEV:
case B_FILE_DEV:
dev = New(win_file_dev);
- dev->capabilities |= CAP_LSEEK;
break;
case B_NULL_DEV:
dev = New(win_file_dev);
break;
case B_FILE_DEV:
dev = New(file_dev);
- dev->capabilities |= CAP_LSEEK;
break;
case B_NULL_DEV:
dev = New(null_dev);
goto bailout;
}
- /* ***FIXME*** move to fifo driver */
- if (dev->is_fifo()) {
- dev->capabilities |= CAP_STREAM; /* set stream device */
- }
-
dev->register_metrics(statcollector);
if (!cloning) {
win_file_dev() { };
~win_file_dev() { m_fd = -1; };
+ virtual int device_specific_init(JCR *jcr, DEVRES *device) {
+ // Don't forget to do capabilities |= CAP_LSEEK in device_specific_init()
+ return file_dev::device_specific_init(jcr, device);
+ }
};
#endif