]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/stored/ansi_label.c
kes Change Bacula trademark owner from John Walker to Kern Sibbald
[bacula/bacula] / bacula / src / stored / ansi_label.c
index e688f5fd20613a9b30105b4eb05f3096c2331004..a6bacf547c34c87e104d1448b9b8c18da341932c 100644 (file)
@@ -1,25 +1,14 @@
-/*
- *
- *  ansi_label.c routines to handle ANSI (and perhaps one day IBM)
- *   tape labels.
- *
- *   Kern Sibbald, MMV
- *
- *
- *
- *   Version $Id$
- */
 /*
    Bacula® - The Network Backup Solution
 
-   Copyright (C) 2005-2006 Free Software Foundation Europe e.V.
+   Copyright (C) 2005-2007 Free Software Foundation Europe e.V.
 
    The main author of Bacula is Kern Sibbald, with contributions from
    many others, a complete list can be found in the file AUTHORS.
    This program is Free Software; you can redistribute it and/or
    modify it under the terms of version two of the GNU General Public
-   License as published by the Free Software Foundation plus additions
-   that are listed in the file LICENSE.
+   License as published by the Free Software Foundation and included
+   in the file LICENSE.
 
    This program is distributed in the hope that it will be useful, but
    WITHOUT ANY WARRANTY; without even the implied warranty of
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   Bacula® is a registered trademark of John Walker.
+   Bacula® is a registered trademark of Kern Sibbald.
    The licensor of Bacula is the Free Software Foundation Europe
    (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
    Switzerland, email:ftf@fsfeurope.org.
 */
+/*
+ *
+ *  ansi_label.c routines to handle ANSI (and perhaps one day IBM)
+ *   tape labels.
+ *
+ *   Kern Sibbald, MMV
+ *
+ *
+ *
+ *   Version $Id$
+ */
 
 #include "bacula.h"                   /* pull in global headers */
 #include "stored.h"                   /* pull in Storage Deamon headers */
@@ -65,7 +65,7 @@ static bool same_label_names(char *bacula_name, char *ansi_name);
  */ 
 int read_ansi_ibm_label(DCR *dcr) 
 {
-   DEVICE *dev = dcr->dev;
+   DEVICE * volatile dev = dcr->dev;
    JCR *jcr = dcr->jcr;
    char label[80];                    /* tape label */
    int stat, i;
@@ -115,6 +115,7 @@ int read_ansi_ibm_label(DCR *dcr)
             if (strncmp("VOL1", label, 4) == 0) {
                ok = true;
                dev->label_type = B_ANSI_LABEL;
+               Dmsg0(100, "Got ANSI VOL1 label\n");
             } else {
                /* Try EBCDIC */
                ebcdic_to_ascii(label, label, sizeof(label));
@@ -122,6 +123,7 @@ int read_ansi_ibm_label(DCR *dcr)
                   ok = true;;
                   dev->label_type = B_IBM_LABEL;
                   Dmsg0(100, "Found IBM label.\n");
+                  Dmsg0(100, "Got IBM VOL1 label\n");
                }
             }       
          }
@@ -145,7 +147,9 @@ int read_ansi_ibm_label(DCR *dcr)
                   *q++ = *p++;
                }
                *q = 0;
+               Dmsg0(100, "Call reserve_volume\n");
                reserve_volume(dcr, dev->VolHdr.VolumeName);
+               dev = dcr->dev;            /* may have changed in reserve_volume */
                Dmsg2(100, "Wanted ANSI Vol %s got %6s\n", VolName, dev->VolHdr.VolumeName);
                Mmsg2(jcr->errmsg, _("Wanted ANSI Volume \"%s\" got \"%s\"\n"), VolName, dev->VolHdr.VolumeName);
                return VOL_NAME_ERROR;
@@ -168,6 +172,7 @@ int read_ansi_ibm_label(DCR *dcr)
                dev->VolHdr.VolumeName);
             return VOL_NAME_ERROR;     /* Not a Bacula label */
          }
+         Dmsg0(100, "Got HDR1 label\n");
          break;
       case 2:
          if (dev->label_type == B_IBM_LABEL) {
@@ -178,6 +183,7 @@ int read_ansi_ibm_label(DCR *dcr)
             Mmsg0(jcr->errmsg, _("No HDR2 label while reading ANSI/IBM label.\n"));
             return VOL_LABEL_ERROR;
          }
+         Dmsg0(100, "Got ANSI HDR2 label\n");
          break;
       default:
          if (stat == 0) {
@@ -192,6 +198,7 @@ int read_ansi_ibm_label(DCR *dcr)
             Mmsg0(jcr->errmsg, _("Unknown or bad ANSI/IBM label record.\n"));
             return VOL_LABEL_ERROR;
          }
+         Dmsg0(100, "Got HDR label\n");
          break;
       }
    }