* - free_space_errno == 0: ignore free_space.
* - free_space_errno < 0: an error occured.
* - free_space_errno > 0: free_space is valid. */
+ bool truncating; /* if set, we are currently truncating the DVD */
+
utime_t vol_poll_interval; /* interval between polling Vol mount */
DEVRES *device; /* pointer to Device Resource */
}
if (dev->open(dcr, mode) < 0) {
/* If polling, ignore the error */
- if (!dev->poll) {
+ if ((!dev->poll) && (!dev->is_dvd())) {
Jmsg2(dcr->jcr, M_FATAL, 0, _("Unable to open device %s: ERR=%s\n"),
dev->print_name(), strerror_dev(dev));
Pmsg2(000, "Unable to open archive %s: ERR=%s\n",
dev->print_name(), strerror_dev(dev));
}
if (recycle) {
- if (!truncate_dev(dev)) {
+ if (!truncate_dev(dcr)) {
Jmsg2(jcr, M_WARNING, 0, _("Truncate error on device %s: ERR=%s\n"),
dev->print_name(), strerror_dev(dev));
}
JCR *jcr = dcr->jcr;
DEV_BLOCK *block = dcr->block;
- Dmsg0(100, "Enter mount_next_volume()\n");
+ Dmsg1(100, "Enter mount_next_volume(release=%d)\n", release);
init_device_wait_timers(dcr);
* we will err, recurse and ask the operator the next time.
*/
if (!release && dev->is_tape() && dev_cap(dev, CAP_AUTOMOUNT)) {
+ Dmsg0(100, "(1)Ask=0");
ask = false; /* don't ask SYSOP this time */
}
/* Don't ask if not removable */
if (!dev_cap(dev, CAP_REM)) {
+ Dmsg0(100, "(2)Ask=0");
ask = false;
}
Dmsg2(100, "Ask=%d autochanger=%d\n", ask, autochanger);
/* Ensure the device is open */
if (!open_device(dcr)) {
- if (dev->poll) {
+ if ((dev->poll) || (dev->is_dvd())) {
goto mount_next_vol;
} else {
return false;
int open_first_part(DCR *dcr, int mode);
int open_next_part(DCR *dcr);
bool can_open_mounted_dev(DEVICE *dev);
-bool truncate_dev(DEVICE *dev);
+bool truncate_dev(DCR *dcr);
void term_dev(DEVICE *dev);
char * strerror_dev(DEVICE *dev);
void clrerror_dev(DEVICE *dev, int func);
void update_free_space_dev(DEVICE *dev);
void make_mounted_dvd_filename(DEVICE *dev, POOL_MEM &archive_name);
void make_spooled_dvd_filename(DEVICE *dev, POOL_MEM &archive_name);
+bool truncate_dvd_dev(DCR *dcr);
+bool check_can_write_on_non_blank_dvd(DCR *dcr);
/* From device.c */
bool open_device(DCR *dcr);