dev->state &= ~ST_APPEND; /* clear any previous append mode */
dev->state |= ST_READ; /* set read mode */
- attach_jcr_to_device(dev, jcr); /* attach jcr to device */
+// attach_jcr_to_device(dev, jcr); /* attach jcr to device */
set_jcr_job_status(jcr, JS_Running);
dir_send_job_status(jcr);
Jmsg(jcr, M_INFO, 0, _("Ready to read from volume \"%s\" on device %s.\n"),
if (jcr->NumVolumes == 0) {
jcr->NumVolumes = 1;
}
- attach_jcr_to_device(dev, jcr); /* attach jcr to device */
+// attach_jcr_to_device(dev, jcr); /* attach jcr to device */
set_jcr_job_status(jcr, JS_Running);
dir_send_job_status(jcr);
goto ok_out;
Jmsg2(jcr, M_ERROR, 0, _("BAD ERROR: release_device %s, Volume \"%s\" not in use.\n"),
dev_name(dev), NPRT(jcr->VolumeName));
}
- detach_jcr_from_device(dev, jcr);
+// detach_jcr_from_device(dev, jcr);
if (dev->prev && !dev_state(dev, ST_READ) && !dev->num_writers) {
P(mutex);
unlock_device(dev);
DEVICE *dev = dcr->dev;
JCR *jcr = dcr->jcr;
-
if (dcr->spooling) {
stat = write_block_to_spool_file(dcr, block);
return stat;
* Walk through all attached jcrs indicating the file has changed
*/
Dmsg1(100, "Walk attached jcrs. Volume=%s\n", dev->VolCatInfo.VolCatName);
+#ifdef xxx
for (JCR *mjcr=NULL; (mjcr=next_attached_jcr(dev, mjcr)); ) {
if (mjcr->JobId == 0) {
continue; /* ignore console */
}
mjcr->dcr->NewFile = true; /* set reminder to do set_new_file_params */
}
+#endif
+ /*
+ * Walk through all attached dcrs setting flag to call
+ * set_new_file_parameters() when that dcr is next used.
+ */
+ DCR *mdcr;
+ foreach_dlist(mdcr, dev->attached_dcrs) {
+ if (mdcr->jcr->JobId == 0) {
+ continue;
+ }
+ mdcr->NewFile = true; /* set reminder to do set_new_file_params */
+ }
+ /* Set new file/block parameters for current dcr */
set_new_file_parameters(dcr);
}
jobjcr->VolSessionId = rec->VolSessionId;
jobjcr->VolSessionTime = rec->VolSessionTime;
jobjcr->ClientId = jr->ClientId;
- attach_jcr_to_device(dev, jobjcr);
+// attach_jcr_to_device(dev, jobjcr);
new_dcr(jobjcr, dev);
return jobjcr;
}