- if (!read_block_from_device(dcr, block, NO_BLOCK_NUMBER_CHECK)) {
- Dmsg1(100, "!read_block(): ERR=%s\n", strerror_dev(dev));
- if (dev->state & ST_EOT) {
- if (!mount_next_read_volume(jcr, dev, block)) {
- Jmsg(jcr, M_INFO, 0, _("Got EOM at file %u on device %s, Volume \"%s\"\n"),
- dev->file, dev_name(dev), jcr->VolumeName);
- break;
- }
- /* Read and discard Volume label */
- DEV_RECORD *record;
- record = new_record();
- read_block_from_device(dcr, block, NO_BLOCK_NUMBER_CHECK);
- read_record_from_block(block, record);
- get_session_record(dev, record, &sessrec);
- free_record(record);
- Jmsg(jcr, M_INFO, 0, _("Mounted Volume \"%s\".\n"), jcr->VolumeName);
-
- } else if (dev->state & ST_EOF) {
- Jmsg(jcr, M_INFO, 0, _("Got EOF at file %u on device %s, Volume \"%s\"\n"),
- dev->file, dev_name(dev), jcr->VolumeName);
+ if (!dcr->read_block_from_device(NO_BLOCK_NUMBER_CHECK)) {
+ Dmsg1(100, "!read_block(): ERR=%s\n", dev->print_errmsg());
+ if (dev->at_eot()) {
+ if (!mount_next_read_volume(dcr)) {
+ Jmsg(jcr, M_INFO, 0, _("Got EOM at file %u on device %s, Volume \"%s\"\n"),
+ dev->file, dev->print_name(), dcr->VolumeName);
+ break;
+ }
+ /* Read and discard Volume label */
+ DEV_RECORD *record;
+ record = new_record();
+ dcr->read_block_from_device(NO_BLOCK_NUMBER_CHECK);
+ read_record_from_block(dcr, record);
+ get_session_record(dev, record, &sessrec);
+ free_record(record);
+ Jmsg(jcr, M_INFO, 0, _("Mounted Volume \"%s\".\n"), dcr->VolumeName);
+ } else if (dev->at_eof()) {
+ Jmsg(jcr, M_INFO, 0, _("End of file %u on device %s, Volume \"%s\"\n"),
+ dev->file, dev->print_name(), dcr->VolumeName);