+ DEVICE *dev = dcr->dev;
+ DCR *mdcr;
+ Dmsg1(100, "Walk attached jcrs. Volume=%s\n", dev->VolCatInfo.VolCatName);
+ foreach_dlist(mdcr, dev->attached_dcrs) {
+ JCR *mjcr = mdcr->jcr;
+ Dmsg1(000, "========== JobId=%u ========\n", mjcr->JobId);
+ if (mjcr->JobId == 0) {
+ continue;
+ }
+ if (verbose) {
+ Pmsg1(000, _("Create JobMedia for Job %s\n"), mjcr->Job);
+ }
+ mdcr->StartBlock = dcr->StartBlock;
+ mdcr->StartFile = dcr->StartFile;
+ mdcr->EndBlock = dcr->EndBlock;
+ mdcr->EndFile = dcr->EndFile;
+ mdcr->VolMediaId = dcr->VolMediaId;
+ mjcr->read_dcr->VolLastIndex = dcr->VolLastIndex;
+ if (!create_jobmedia_record(db, mjcr)) {
+ Pmsg2(000, _("Could not create JobMedia record for Volume=%s Job=%s\n"),
+ dev->VolCatInfo.VolCatName, mjcr->Job);
+ }
+ }
+
+ update_media_record(db, &mr);
+
+ /* Now let common read routine get up next tape. Note,
+ * we call mount_next... with bscan's jcr because that is where we
+ * have the Volume list, but we get attached.
+ */
+ bool stat = mount_next_read_volume(dcr);
+
+ if (showProgress) {
+ char ed1[50];
+ struct stat sb;
+ fstat(dev->fd(), &sb);
+ currentVolumeSize = sb.st_size;
+ Pmsg1(000, _("First Volume Size = %sn"),
+ edit_uint64(currentVolumeSize, ed1));
+ }
+ return stat;
+}
+
+static void do_scan()
+{
+ attr = new_attr(bjcr);