3 * label.c Bacula routines to handle labels
11 Copyright (C) 2000-2003 Kern Sibbald and John Walker
13 This program is free software; you can redistribute it and/or
14 modify it under the terms of the GNU General Public License as
15 published by the Free Software Foundation; either version 2 of
16 the License, or (at your option) any later version.
18 This program is distributed in the hope that it will be useful,
19 but WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 General Public License for more details.
23 You should have received a copy of the GNU General Public
24 License along with this program; if not, write to the Free
25 Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
30 #include "bacula.h" /* pull in global headers */
31 #include "stored.h" /* pull in Storage Deamon headers */
33 /* Forward referenced functions */
34 static void create_volume_label_record(JCR *jcr, DEVICE *dev, DEV_RECORD *rec);
36 extern char my_name[];
37 extern int debug_level;
40 * Read the volume label
42 * If jcr->VolumeName == NULL, we accept any Bacula Volume
43 * If jcr->VolumeName[0] == 0, we accept any Bacula Volume
44 * otherwise jcr->VolumeName must match the Volume.
46 * If VolName given, ensure that it matches
48 * Returns VOL_ code as defined in record.h
59 int read_dev_volume_label(JCR *jcr, DEVICE *dev, DEV_BLOCK *block)
61 char *VolName = jcr->VolumeName;
65 Dmsg3(100, "Enter read_volume_label device=%s vol=%s dev_Vol=%s\n",
66 dev_name(dev), VolName, dev->VolHdr.VolName);
68 if (dev_state(dev, ST_LABEL)) { /* did we already read label? */
69 /* Compare Volume Names allow special wild card */
70 if (VolName && *VolName && *VolName != '*' && strcmp(dev->VolHdr.VolName, VolName) != 0) {
71 Mmsg(&jcr->errmsg, _("Wrong Volume mounted on device %s: Wanted %s have %s\n"),
72 dev_name(dev), VolName, dev->VolHdr.VolName);
74 * Cancel Job if too many label errors
77 if (jcr->label_errors++ > 100) {
78 Jmsg(jcr, M_FATAL, 0, "%s", jcr->errmsg);
80 return jcr->label_status = VOL_NAME_ERROR;
82 Dmsg0(30, "Leave read_volume_label() VOL_OK\n");
83 return jcr->label_status = VOL_OK; /* label already read */
86 dev->state &= ~(ST_LABEL|ST_APPEND|ST_READ); /* set no label, no append */
88 if (!rewind_dev(dev)) {
89 Mmsg(&jcr->errmsg, _("Couldn't rewind device %s ERR=%s\n"), dev_name(dev),
91 return jcr->label_status = VOL_NO_MEDIA;
93 bstrncpy(dev->VolHdr.Id, "**error**", sizeof(dev->VolHdr.Id));
95 /* Read the Volume label block */
96 record = new_record();
97 Dmsg0(90, "Big if statement in read_volume_label\n");
98 if (!read_block_from_dev(jcr, dev, block, NO_BLOCK_NUMBER_CHECK)) {
99 Mmsg(&jcr->errmsg, _("Volume on %s is not a Bacula labeled Volume, \
100 because:\n %s"), dev_name(dev), strerror_dev(dev));
101 } else if (!read_record_from_block(block, record)) {
102 Mmsg(&jcr->errmsg, _("Could not read Volume label from block.\n"));
103 } else if (!unser_volume_label(dev, record)) {
104 Mmsg(&jcr->errmsg, _("Could not unserialize Volume label: %s\n"),
106 } else if (strcmp(dev->VolHdr.Id, BaculaId) != 0 &&
107 strcmp(dev->VolHdr.Id, OldBaculaId) != 0) {
108 Mmsg(&jcr->errmsg, _("Volume Header Id bad: %s\n"), dev->VolHdr.Id);
114 if (forge_on || jcr->ignore_label_errors) {
115 dev->state |= ST_LABEL; /* set has Bacula label */
116 Jmsg(jcr, M_ERROR, 0, "%s", jcr->errmsg);
117 return jcr->label_status = VOL_OK;
121 return jcr->label_status = VOL_NO_LABEL;
125 /* If we are a streaming device, we only get one chance to read */
126 if (!dev_cap(dev, CAP_STREAM)) {
131 if (dev->VolHdr.VerNum != BaculaTapeVersion &&
132 dev->VolHdr.VerNum != OldCompatibleBaculaTapeVersion1 &&
133 dev->VolHdr.VerNum != OldCompatibleBaculaTapeVersion2) {
134 Mmsg(&jcr->errmsg, _("Volume on %s has wrong Bacula version. Wanted %d got %d\n"),
135 dev_name(dev), BaculaTapeVersion, dev->VolHdr.VerNum);
136 return jcr->label_status = VOL_VERSION_ERROR;
139 /* We are looking for either an unused Bacula tape (PRE_LABEL) or
140 * a Bacula volume label (VOL_LABEL)
142 if (dev->VolHdr.LabelType != PRE_LABEL && dev->VolHdr.LabelType != VOL_LABEL) {
143 Mmsg(&jcr->errmsg, _("Volume on %s has bad Bacula label type: %x\n"),
144 dev_name(dev), dev->VolHdr.LabelType);
145 return jcr->label_status = VOL_LABEL_ERROR;
148 dev->state |= ST_LABEL; /* set has Bacula label */
150 /* Compare Volume Names */
151 Dmsg2(30, "Compare Vol names: VolName=%s hdr=%s\n", VolName?VolName:"*", dev->VolHdr.VolName);
152 if (VolName && *VolName && *VolName != '*' && strcmp(dev->VolHdr.VolName, VolName) != 0) {
153 Mmsg(&jcr->errmsg, _("Wrong Volume mounted on device %s: Wanted %s have %s\n"),
154 dev_name(dev), VolName, dev->VolHdr.VolName);
156 * Cancel Job if too many label errors
157 * => we are in a loop
159 if (jcr->label_errors++ > 100) {
160 Jmsg(jcr, M_FATAL, 0, "%s", jcr->errmsg);
162 return jcr->label_status = VOL_NAME_ERROR;
164 Dmsg1(30, "Copy vol_name=%s\n", dev->VolHdr.VolName);
166 if (debug_level >= 10) {
167 dump_volume_label(dev);
169 Dmsg0(30, "Leave read_volume_label() VOL_OK\n");
170 return jcr->label_status = VOL_OK;
173 /* unser_volume_label
175 * Unserialize the Volume label into the device Volume_Label
178 * Assumes that the record is already read.
180 * Returns: 0 on error
184 int unser_volume_label(DEVICE *dev, DEV_RECORD *rec)
188 if (rec->FileIndex != VOL_LABEL && rec->FileIndex != PRE_LABEL) {
189 Mmsg3(&dev->errmsg, _("Expecting Volume Label, got FI=%s Stream=%s len=%d\n"),
190 FI_to_ascii(rec->FileIndex),
191 stream_to_ascii(rec->Stream, rec->FileIndex),
198 dev->VolHdr.LabelType = rec->FileIndex;
199 dev->VolHdr.LabelSize = rec->data_len;
202 /* Unserialize the record into the Volume Header */
203 rec->data = check_pool_memory_size(rec->data, SER_LENGTH_Volume_Label);
204 ser_begin(rec->data, SER_LENGTH_Volume_Label);
205 unser_string(dev->VolHdr.Id);
206 unser_uint32(dev->VolHdr.VerNum);
208 if (dev->VolHdr.VerNum >= 11) {
209 unser_btime(dev->VolHdr.label_btime);
210 unser_btime(dev->VolHdr.write_btime);
211 } else { /* old way */
212 unser_float64(dev->VolHdr.label_date);
213 unser_float64(dev->VolHdr.label_time);
215 unser_float64(dev->VolHdr.write_date); /* Unused with VerNum >= 11 */
216 unser_float64(dev->VolHdr.write_time); /* Unused with VerNum >= 11 */
218 unser_string(dev->VolHdr.VolName);
219 unser_string(dev->VolHdr.PrevVolName);
220 unser_string(dev->VolHdr.PoolName);
221 unser_string(dev->VolHdr.PoolType);
222 unser_string(dev->VolHdr.MediaType);
224 unser_string(dev->VolHdr.HostName);
225 unser_string(dev->VolHdr.LabelProg);
226 unser_string(dev->VolHdr.ProgVersion);
227 unser_string(dev->VolHdr.ProgDate);
229 ser_end(rec->data, SER_LENGTH_Volume_Label);
230 Dmsg0(90, "ser_read_vol\n");
231 if (debug_level >= 90) {
232 dump_volume_label(dev);
238 * Put a volume label into the block
240 * Returns: 0 on failure
243 int write_volume_label_to_block(JCR *jcr, DEVICE *dev, DEV_BLOCK *block)
247 Dmsg0(20, "write Label in write_volume_label_to_block()\n");
248 memset(&rec, 0, sizeof(rec));
249 rec.data = get_memory(SER_LENGTH_Volume_Label);
251 create_volume_label_record(jcr, dev, &rec);
253 empty_block(block); /* Volume label always at beginning */
254 block->BlockNumber = 0;
255 if (!write_record_to_block(block, &rec)) {
256 free_pool_memory(rec.data);
257 Jmsg1(jcr, M_FATAL, 0, _("Cannot write Volume label to block for device %s\n"),
261 Dmsg1(90, "Wrote label of %d bytes to block\n", rec.data_len);
263 free_pool_memory(rec.data);
268 * create_volume_label_record
269 * Serialize label (from dev->VolHdr structure) into device record.
270 * Assumes that the dev->VolHdr structure is properly
273 static void create_volume_label_record(JCR *jcr, DEVICE *dev, DEV_RECORD *rec)
278 /* Serialize the label into the device record. */
280 rec->data = check_pool_memory_size(rec->data, SER_LENGTH_Volume_Label);
281 ser_begin(rec->data, SER_LENGTH_Volume_Label);
282 ser_string(dev->VolHdr.Id);
284 ser_uint32(dev->VolHdr.VerNum);
286 if (dev->VolHdr.VerNum >= 11) {
287 ser_btime(dev->VolHdr.label_btime);
288 dev->VolHdr.write_btime = get_current_btime();
289 ser_btime(dev->VolHdr.write_btime);
290 dev->VolHdr.write_date = 0;
291 dev->VolHdr.write_time = 0;
293 /* OLD WAY DEPRECATED */
294 ser_float64(dev->VolHdr.label_date);
295 ser_float64(dev->VolHdr.label_time);
296 get_current_time(&dt);
297 dev->VolHdr.write_date = dt.julian_day_number;
298 dev->VolHdr.write_time = dt.julian_day_fraction;
300 ser_float64(dev->VolHdr.write_date); /* 0 if VerNum >= 11 */
301 ser_float64(dev->VolHdr.write_time); /* 0 if VerNum >= 11 */
303 ser_string(dev->VolHdr.VolName);
304 ser_string(dev->VolHdr.PrevVolName);
305 ser_string(dev->VolHdr.PoolName);
306 ser_string(dev->VolHdr.PoolType);
307 ser_string(dev->VolHdr.MediaType);
309 ser_string(dev->VolHdr.HostName);
310 ser_string(dev->VolHdr.LabelProg);
311 ser_string(dev->VolHdr.ProgVersion);
312 ser_string(dev->VolHdr.ProgDate);
314 ser_end(rec->data, SER_LENGTH_Volume_Label);
315 rec->data_len = ser_length(rec->data);
316 rec->FileIndex = dev->VolHdr.LabelType;
317 rec->VolSessionId = jcr->VolSessionId;
318 rec->VolSessionTime = jcr->VolSessionTime;
319 rec->Stream = jcr->NumVolumes;
320 Dmsg2(100, "Created Vol label rec: FI=%s len=%d\n", FI_to_ascii(rec->FileIndex),
326 * Create a volume label in memory
327 * Returns: 0 on error
330 void create_volume_label(DEVICE *dev, char *VolName, char *PoolName)
332 DEVRES *device = (DEVRES *)dev->device;
334 Dmsg0(90, "Start create_volume_label()\n");
338 memset(&dev->VolHdr, 0, sizeof(dev->VolHdr));
340 bstrncpy(dev->VolHdr.Id, BaculaId, sizeof(dev->VolHdr.Id));
341 dev->VolHdr.VerNum = BaculaTapeVersion;
342 dev->VolHdr.LabelType = PRE_LABEL; /* Mark tape as unused */
343 bstrncpy(dev->VolHdr.VolName, VolName, sizeof(dev->VolHdr.VolName));
344 bstrncpy(dev->VolHdr.PoolName, PoolName, sizeof(dev->VolHdr.PoolName));
345 bstrncpy(dev->VolHdr.MediaType, device->media_type, sizeof(dev->VolHdr.MediaType));
347 bstrncpy(dev->VolHdr.PoolType, "Backup", sizeof(dev->VolHdr.PoolType));
349 dev->VolHdr.label_btime = get_current_btime();
350 dev->VolHdr.label_date = 0;
351 dev->VolHdr.label_time = 0;
353 if (gethostname(dev->VolHdr.HostName, sizeof(dev->VolHdr.HostName)) != 0) {
354 dev->VolHdr.HostName[0] = 0;
356 bstrncpy(dev->VolHdr.LabelProg, my_name, sizeof(dev->VolHdr.LabelProg));
357 sprintf(dev->VolHdr.ProgVersion, "Ver. %s %s", VERSION, BDATE);
358 sprintf(dev->VolHdr.ProgDate, "Build %s %s", __DATE__, __TIME__);
359 dev->state |= ST_LABEL; /* set has Bacula label */
360 if (debug_level >= 90) {
361 dump_volume_label(dev);
366 * Write a Volume Label
367 * !!! Note, this is ONLY used for writing
368 * a fresh volume label. Any data
369 * after the label will be destroyed,
370 * in fact, we write the label 5 times !!!!
372 * This routine expects that open_device() was previously called.
374 * This routine should be used only when labeling a blank tape.
376 int write_volume_label_to_dev(JCR *jcr, DEVRES *device, char *VolName, char *PoolName)
378 DEVICE *dev = device->dev;
384 Dmsg0(99, "write_volume_label()\n");
385 create_volume_label(dev, VolName, PoolName);
387 if (!rewind_dev(dev)) {
388 memset(&dev->VolHdr, 0, sizeof(dev->VolHdr));
389 Dmsg2(30, "Bad status on %s from rewind. ERR=%s\n", dev_name(dev), strerror_dev(dev));
395 block = new_block(dev);
396 memset(&rec, 0, sizeof(rec));
397 rec.data = get_memory(SER_LENGTH_Volume_Label);
398 create_volume_label_record(jcr, dev, &rec);
401 if (!write_record_to_block(block, &rec)) {
402 Dmsg2(30, "Bad Label write on %s. ERR=%s\n", dev_name(dev), strerror_dev(dev));
403 memset(&dev->VolHdr, 0, sizeof(dev->VolHdr));
405 free_pool_memory(rec.data);
408 Dmsg2(30, "Wrote label of %d bytes to %s\n", rec.data_len, dev_name(dev));
410 free_pool_memory(rec.data);
412 Dmsg0(99, "Call write_block_to_dev()\n");
413 if (!write_block_to_dev(jcr->dcr, block)) {
414 memset(&dev->VolHdr, 0, sizeof(dev->VolHdr));
415 Dmsg2(30, "Bad Label write on %s. ERR=%s\n", dev_name(dev), strerror_dev(dev));
418 Dmsg0(99, " Wrote block to device\n");
422 dev->state |= ST_LABEL;
424 if (debug_level >= 20) {
425 dump_volume_label(dev);
433 * Create session label
434 * The pool memory must be released by the calling program
436 void create_session_label(JCR *jcr, DEV_RECORD *rec, int label)
441 rec->VolSessionId = jcr->VolSessionId;
442 rec->VolSessionTime = jcr->VolSessionTime;
443 rec->Stream = jcr->JobId;
445 rec->data = check_pool_memory_size(rec->data, SER_LENGTH_Session_Label);
446 ser_begin(rec->data, SER_LENGTH_Session_Label);
447 ser_string(BaculaId);
448 ser_uint32(BaculaTapeVersion);
450 ser_uint32(jcr->JobId);
452 /* Changed in VerNum 11 */
453 ser_btime(get_current_btime());
456 ser_string(jcr->pool_name);
457 ser_string(jcr->pool_type);
458 ser_string(jcr->job_name); /* base Job name */
459 ser_string(jcr->client_name);
461 /* Added in VerNum 10 */
462 ser_string(jcr->Job); /* Unique name of this Job */
463 ser_string(jcr->fileset_name);
464 ser_uint32(jcr->JobType);
465 ser_uint32(jcr->JobLevel);
466 /* Added in VerNum 11 */
467 ser_string(jcr->fileset_md5);
469 if (label == EOS_LABEL) {
470 ser_uint32(jcr->JobFiles);
471 ser_uint64(jcr->JobBytes);
472 ser_uint32(dcr->StartBlock);
473 ser_uint32(dcr->EndBlock);
474 ser_uint32(dcr->StartFile);
475 ser_uint32(dcr->EndFile);
476 ser_uint32(jcr->JobErrors);
478 /* Added in VerNum 11 */
479 ser_uint32(jcr->JobStatus);
481 ser_end(rec->data, SER_LENGTH_Session_Label);
482 rec->data_len = ser_length(rec->data);
485 /* Write session label
486 * Returns: 0 on failure
489 int write_session_label(JCR *jcr, DEV_BLOCK *block, int label)
491 DEVICE *dev = jcr->device->dev;
496 Dmsg1(90, "session_label record=%x\n", rec);
499 if (dev->state & ST_TAPE) {
500 dcr->StartBlock = dev->block_num;
501 dcr->StartFile = dev->file;
503 dcr->StartBlock = (uint32_t)dev->file_addr;
504 dcr->StartFile = (uint32_t)(dev->file_addr >> 32);
508 if (dev->state & ST_TAPE) {
509 dcr->EndBlock = dev->EndBlock;
510 dcr->EndFile = dev->EndFile;
512 dcr->EndBlock = (uint32_t)dev->file_addr;
513 dcr->EndFile = (uint32_t)(dev->file_addr >> 32);
517 Jmsg1(jcr, M_ABORT, 0, _("Bad session label = %d\n"), label);
520 create_session_label(jcr, rec, label);
521 rec->FileIndex = label;
524 * We guarantee that the session record can totally fit
525 * into a block. If not, write the block, and put it in
526 * the next block. Having the sesssion record totally in
527 * one block makes reading them much easier (no need to
528 * read the next block).
530 if (!can_write_record_to_block(block, rec)) {
531 Dmsg0(100, "Cannot write session label to block.\n");
532 if (!write_block_to_device(jcr->dcr, block)) {
533 Dmsg0(90, "Got session label write_block_to_dev error.\n");
534 Jmsg(jcr, M_FATAL, 0, _("Error writing Session label to %s: %s\n"),
535 dev_vol_name(dev), strerror(errno));
540 if (!write_record_to_block(block, rec)) {
541 Jmsg(jcr, M_FATAL, 0, _("Error writing Session label to %s: %s\n"),
542 dev_vol_name(dev), strerror(errno));
547 Dmsg6(20, "Write sesson_label record JobId=%d FI=%s SessId=%d Strm=%s len=%d\n\
548 remainder=%d\n", jcr->JobId,
549 FI_to_ascii(rec->FileIndex), rec->VolSessionId,
550 stream_to_ascii(rec->Stream, rec->FileIndex), rec->data_len,
554 Dmsg2(20, "Leave write_session_label Block=%d File=%d\n",
555 dev->block_num, dev->file);
559 void dump_volume_label(DEVICE *dev)
561 int dbl = debug_level;
563 char *LabelType, buf[30];
569 switch (dev->VolHdr.LabelType) {
571 LabelType = "PRE_LABEL";
574 LabelType = "VOL_LABEL";
577 LabelType = "EOM_LABEL";
580 LabelType = "SOS_LABEL";
583 LabelType = "EOS_LABEL";
589 sprintf(buf, "Unknown %d", dev->VolHdr.LabelType);
594 Pmsg11(-1, "\nVolume Label:\n\
607 dev->VolHdr.Id, dev->VolHdr.VerNum,
608 dev->VolHdr.VolName, dev->VolHdr.PrevVolName,
609 File, LabelType, dev->VolHdr.LabelSize,
610 dev->VolHdr.PoolName, dev->VolHdr.MediaType,
611 dev->VolHdr.PoolType, dev->VolHdr.HostName);
613 if (dev->VolHdr.VerNum >= 11) {
615 bstrftime(dt, sizeof(dt), btime_to_unix(dev->VolHdr.label_btime));
616 Pmsg1(-1, "Date label written: %s\n", dt);
618 dt.julian_day_number = dev->VolHdr.label_date;
619 dt.julian_day_fraction = dev->VolHdr.label_time;
622 Date label written: %04d-%02d-%02d at %02d:%02d\n",
623 tm.tm_year+1900, tm.tm_mon+1, tm.tm_mday, tm.tm_hour, tm.tm_min);
630 int unser_session_label(SESSION_LABEL *label, DEV_RECORD *rec)
634 rec->data = check_pool_memory_size(rec->data, SER_LENGTH_Session_Label);
635 unser_begin(rec->data, SER_LENGTH_Session_Label);
636 unser_string(label->Id);
637 unser_uint32(label->VerNum);
638 unser_uint32(label->JobId);
639 if (label->VerNum >= 11) {
640 unser_btime(label->write_btime);
642 unser_float64(label->write_date);
644 unser_float64(label->write_time);
645 unser_string(label->PoolName);
646 unser_string(label->PoolType);
647 unser_string(label->JobName);
648 unser_string(label->ClientName);
649 if (label->VerNum >= 10) {
650 unser_string(label->Job); /* Unique name of this Job */
651 unser_string(label->FileSetName);
652 unser_uint32(label->JobType);
653 unser_uint32(label->JobLevel);
655 if (label->VerNum >= 11) {
656 unser_string(label->FileSetMD5);
658 label->FileSetMD5[0] = 0;
660 if (rec->FileIndex == EOS_LABEL) {
661 unser_uint32(label->JobFiles);
662 unser_uint64(label->JobBytes);
663 unser_uint32(label->StartBlock);
664 unser_uint32(label->EndBlock);
665 unser_uint32(label->StartFile);
666 unser_uint32(label->EndFile);
667 unser_uint32(label->JobErrors);
668 if (label->VerNum >= 11) {
669 unser_uint32(label->JobStatus);
671 label->JobStatus = JS_Terminated; /* kludge */
678 static void dump_session_label(DEV_RECORD *rec, char *type)
684 char ec1[30], ec2[30], ec3[30], ec4[30], ec5[30], ec6[30], ec7[30];
686 unser_session_label(&label, rec);
689 Pmsg7(-1, "\n%s Record:\n\
696 ", type, label.JobId, label.VerNum,
697 label.PoolName, label.PoolType,
698 label.JobName, label.ClientName);
700 if (label.VerNum >= 10) {
702 Job (unique name) : %s\n\
706 ", label.Job, label.FileSetName, label.JobType, label.JobLevel);
709 if (rec->FileIndex == EOS_LABEL) {
720 edit_uint64_with_commas(label.JobFiles, ec1),
721 edit_uint64_with_commas(label.JobBytes, ec2),
722 edit_uint64_with_commas(label.StartBlock, ec3),
723 edit_uint64_with_commas(label.EndBlock, ec4),
724 edit_uint64_with_commas(label.StartFile, ec5),
725 edit_uint64_with_commas(label.EndFile, ec6),
726 edit_uint64_with_commas(label.JobErrors, ec7),
729 if (label.VerNum >= 11) {
731 bstrftime(dt, sizeof(dt), btime_to_unix(label.write_btime));
732 Pmsg1(-1, _("Date written : %s\n"), dt);
734 dt.julian_day_number = label.write_date;
735 dt.julian_day_fraction = label.write_time;
738 Date written : %04d-%02d-%02d at %02d:%02d\n"),
739 tm.tm_year+1900, tm.tm_mon+1, tm.tm_mday, tm.tm_hour, tm.tm_min);
745 void dump_label_record(DEVICE *dev, DEV_RECORD *rec, int verbose)
752 switch (rec->FileIndex) {
754 type = _("Fresh Volume");
760 type = _("Begin Session");
763 type = _("End Session");
766 type = _("End of Media");
769 type = ("End of Tape");
776 switch (rec->FileIndex) {
779 unser_volume_label(dev, rec);
780 dump_volume_label(dev);
783 dump_session_label(rec, type);
786 dump_session_label(rec, type);
789 Pmsg5(-1, "%s Record: SessId=%d SessTime=%d JobId=%d DataLen=%d\n",
790 type, rec->VolSessionId, rec->VolSessionTime, rec->Stream, rec->data_len);
793 Pmsg0(-1, _("End of physical tape.\n"));
796 Pmsg5(-1, "%s Record: SessId=%d SessTime=%d JobId=%d DataLen=%d\n",
797 type, rec->VolSessionId, rec->VolSessionTime, rec->Stream, rec->data_len);
801 switch (rec->FileIndex) {
805 unser_session_label(&label, rec);
806 Pmsg6(-1, "%s Record: SessId=%d SessTime=%d JobId=%d Level=%c \
808 type, rec->VolSessionId, rec->VolSessionTime, rec->Stream,
809 label.JobLevel, label.JobType);
815 Pmsg5(-1, "%s Record: SessId=%d SessTime=%d JobId=%d DataLen=%d\n",
816 type, rec->VolSessionId, rec->VolSessionTime, rec->Stream, rec->data_len);