]> git.sur5r.net Git - bacula/bacula/commitdiff
Move supported Autochangers to new chapter
authorKern Sibbald <kern@sibbald.com>
Wed, 9 Mar 2005 11:27:38 +0000 (11:27 +0000)
committerKern Sibbald <kern@sibbald.com>
Wed, 9 Mar 2005 11:27:38 +0000 (11:27 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@1876 91ce42f0-d328-0410-95d8-f526ca767f89

20 files changed:
bacula/kernstodo
bacula/src/stored/acquire.c
bacula/src/stored/append.c
bacula/src/stored/askdir.c
bacula/src/stored/autochanger.c
bacula/src/stored/bcopy.c
bacula/src/stored/bextract.c
bacula/src/stored/block.c
bacula/src/stored/bls.c
bacula/src/stored/bscan.c
bacula/src/stored/btape.c
bacula/src/stored/dev.c
bacula/src/stored/dev.h
bacula/src/stored/device.c
bacula/src/stored/dircmd.c
bacula/src/stored/label.c
bacula/src/stored/mount.c
bacula/src/stored/protos.h
bacula/src/stored/read_record.c
bacula/src/stored/status.c

index 1e772975d3627532d6e6753f9878498adcbffd01..19c71756fb579a6185eec2a7cf6ef9fc49443e70 100644 (file)
@@ -46,6 +46,8 @@ For 1.37:
   label so that bscan can get *all* the info. 
 - Scratch Pool where the volumes can be re-assigned to any Pool.
 - Implement Maximum Job Spool Size
+- Implement EOF/EOV labels for ANSI labels
+- Implement IBM labels.
 
 Maybe in 1.37:
 - By the way: on page http://www.bacula.org/?page=tapedrives , at the 
@@ -1255,4 +1257,3 @@ Block Position: 0
 #5   Events that call a Python program 
      (Implemented in Dir/SD)
 - Make sure the Device name is in the Query packet returned.
-
index 0fc975be3a36fd6c6e11d20fe79282865825d9b9..e14ed0f29c34b0b1b09e61611f209155543e4649 100644 (file)
@@ -142,7 +142,7 @@ bool reserve_device_for_read(JCR *jcr, DEVICE *dev)
    ASSERT(dcr);
    if (device_is_unmounted(dev)) {
       Jmsg(jcr, M_WARNING, 0, _("device %s is BLOCKED due to user unmount.\n"),
-        dev_name(dev));
+        dev->print_name());
       return false;
    }
    lock_device(dev);
@@ -151,7 +151,7 @@ bool reserve_device_for_read(JCR *jcr, DEVICE *dev)
 
    if (dev->is_busy()) {
       Jmsg2(jcr, M_FATAL, 0, _("Device %s is busy. Job %d canceled.\n"),
-           dev->name(), jcr->JobId);
+           dev->print_name(), jcr->JobId);
       goto get_out;
    }
    if (!dcr) {
@@ -252,10 +252,10 @@ DCR *acquire_device_for_read(JCR *jcr, DEVICE *dev)
            }
            
             Jmsg(jcr, M_FATAL, 0, _("Open device %s volume %s failed, ERR=%s\n"),
-               dev_name(dev), dcr->VolumeName, strerror_dev(dev));
+               dev->print_name(), dcr->VolumeName, strerror_dev(dev));
            goto get_out;
         }
-         Dmsg1(129, "open_dev %s OK\n", dev_name(dev));
+         Dmsg1(129, "open_dev %s OK\n", dev->print_name());
       }
       
       if (dev->is_dvd()) {
@@ -324,8 +324,8 @@ default_path:
       break;
    } /* end for loop */
    if (!vol_ok) {
-      Jmsg1(jcr, M_FATAL, 0, _("Too many errors trying to mount device \"%s\".\n"),
-           dev_name(dev));
+      Jmsg1(jcr, M_FATAL, 0, _("Too many errors trying to mount device %s.\n"),
+           dev->print_name());
       goto get_out;
    }
 
@@ -334,7 +334,7 @@ default_path:
    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"),
-      dcr->VolumeName, dev_name(dev));
+      dcr->VolumeName, dev->print_name());
 
 get_out:
    P(dev->mutex);
@@ -373,12 +373,12 @@ bool reserve_device_for_append(JCR *jcr, DEVICE *dev)
    block_device(dev, BST_DOING_ACQUIRE);
    unlock_device(dev);
    if (dev->can_read()) {
-      Jmsg(jcr, M_WARNING, 0, _("Device %s is busy reading.\n"), dev->name());
+      Jmsg(jcr, M_WARNING, 0, _("Device %s is busy reading.\n"), dev->print_name());
       goto bail_out;
    }
    if (device_is_unmounted(dev)) {
       Jmsg(jcr, M_WARNING, 0, _("device %s is BLOCKED due to user unmount.\n"),
-        dev_name(dev));
+        dev->print_name());
       goto bail_out;
    }
    Dmsg1(190, "reserve_append device is %s\n", dev_is_tape(dev)?"tape":"disk");
@@ -394,7 +394,7 @@ bool reserve_device_for_append(JCR *jcr, DEVICE *dev)
            /* OK, compatible device */
         } else {
            /* Drive not suitable for us */
-            Jmsg(jcr, M_WARNING, 0, _("Device %s is busy writing on another Volume.\n"), dev->name());
+            Jmsg(jcr, M_WARNING, 0, _("Device %s is busy writing on another Volume.\n"), dev->print_name());
            goto bail_out;
         }
       } else {
@@ -417,7 +417,7 @@ bool reserve_device_for_append(JCR *jcr, DEVICE *dev)
         /* OK, compatible device */
       } else {
         /* Drive not suitable for us */
-         Jmsg(jcr, M_WARNING, 0, _("Device %s is busy writing on another Volume.\n"), dev->name());
+         Jmsg(jcr, M_WARNING, 0, _("Device %s is busy writing on another Volume.\n"), dev->print_name());
         goto bail_out;
       }
    } else {
@@ -470,7 +470,7 @@ DCR *acquire_device_for_append(JCR *jcr, DEVICE *dev)
     * With the reservation system, this should not happen
     */
    if (dev->can_read()) {
-      Jmsg(jcr, M_FATAL, 0, _("Device %s is busy reading.\n"), dev_name(dev));
+      Jmsg(jcr, M_FATAL, 0, _("Device %s is busy reading.\n"), dev->print_name());
       goto get_out;
    }
 
@@ -491,7 +491,7 @@ DCR *acquire_device_for_append(JCR *jcr, DEVICE *dev)
            strcmp(dev->VolHdr.VolName, dcr->VolumeName) == 0)) { /* wrong tape mounted */
          Dmsg0(190, "Wrong tape mounted.\n");
         if (dev->num_writers != 0 || dev->reserved_device) {
-            Jmsg(jcr, M_FATAL, 0, _("Device %s is busy writing on another Volume.\n"), dev_name(dev));
+            Jmsg(jcr, M_FATAL, 0, _("Device %s is busy writing on another Volume.\n"), dev->print_name());
            goto get_out;
         }
         /* Wrong tape mounted, release it, then fall through to get correct one */
@@ -528,8 +528,8 @@ DCR *acquire_device_for_append(JCR *jcr, DEVICE *dev)
       if (!mounted) {
         if (!job_canceled(jcr)) {
             /* Reduce "noise" -- don't print if job canceled */
-            Jmsg(jcr, M_FATAL, 0, _("Could not ready device \"%s\" for append.\n"),
-              dev_name(dev));
+            Jmsg(jcr, M_FATAL, 0, _("Could not ready device %s for append.\n"),
+              dev->print_name());
         }
         goto get_out;
       }
@@ -609,7 +609,7 @@ bool release_device(DCR *dcr)
       }
    } else {
       Jmsg2(jcr, M_FATAL, 0, _("BAD ERROR: release_device %s, Volume \"%s\" not in use.\n"),
-           dev_name(dev), NPRT(dcr->VolumeName));
+           dev->print_name(), NPRT(dcr->VolumeName));
       Jmsg2(jcr, M_ERROR, 0, _("num_writers=%d state=%x\n"), dev->num_writers, dev->state);
    }
 
index 5f12108521da0ba5c2f9fe491e600a000886b419..0596e07407cc7e9f0ccab9b0be46d76f2d461e14 100644 (file)
@@ -72,7 +72,7 @@ bool do_append_data(JCR *jcr)
    if (dev->VolCatInfo.VolCatName[0] == 0) {
       Pmsg0(000, "NULL Volume name. This shouldn't happen!!!\n");
    }
-   Dmsg1(20, "Begin append device=%s\n", dev_name(dev));
+   Dmsg1(20, "Begin append device=%s\n", dev->print_name());
 
    begin_data_spool(dcr);
    begin_attribute_spool(jcr);
@@ -195,9 +195,9 @@ bool do_append_data(JCR *jcr)
                       rec.remainder);
            if (!write_block_to_device(dcr)) {
                Dmsg2(90, "Got write_block_to_dev error on device %s. %s\n",
-                 dev_name(dev), strerror_dev(dev));
+                 dev->print_name(), strerror_dev(dev));
                Jmsg2(jcr, M_FATAL, 0, _("Fatal append error on device %s: ERR=%s\n"),
-                    dev_name(dev), strerror_dev(dev));
+                    dev->print_name(), strerror_dev(dev));
               ok = false;
               break;
            }
@@ -289,14 +289,14 @@ bool do_append_data(JCR *jcr)
       Dmsg0(100, "Writing last part because write_part_after_job is set.\n");
       if (dev->part < dev->num_parts) {
          Jmsg3(jcr, M_FATAL, 0, _("Error while writing, current part number is less than the total number of parts (%d/%d, device=%s)\n"),
-              dev->part, dev->num_parts, dev_name(dev));
+              dev->part, dev->num_parts, dev->print_name());
         dev->dev_errno = EIO;
         ok = false;
       }
       
       if (ok && (open_next_part(dev) < 0)) {
-         Jmsg2(jcr, M_FATAL, 0, _("Unable to open device next part %s. ERR=%s\n"),
-              dev_name(dev), strerror_dev(dev));
+         Jmsg2(jcr, M_FATAL, 0, _("Unable to open device next part %s: ERR=%s\n"),
+              dev->print_name(), strerror_dev(dev));
         dev->dev_errno = EIO;
         ok = false;
       }
index 6d7465c482a09d6c076a6e7c8babd7af75e5e344..1166452d4e5c442486cd9005ecfd77ab8cec80b8 100644 (file)
@@ -489,16 +489,16 @@ bool dir_ask_sysop_to_create_appendable_volume(DCR *dcr)
 
       stat = wait_for_sysop(dcr);
       if (dev->poll) {
-         Dmsg1(400, "Poll timeout in create append vol on device %s\n", dev_name(dev));
+         Dmsg1(400, "Poll timeout in create append vol on device %s\n", dev->print_name());
         continue;
       }
 
       if (stat == ETIMEDOUT) {
         if (!double_dev_wait_time(dev)) {
-            Mmsg(dev->errmsg, _("Max time exceeded waiting to mount Storage Device \"%s\" for Job %s\n"),
-              dev_name(dev), jcr->Job);
+            Mmsg(dev->errmsg, _("Max time exceeded waiting to mount Storage Device %s for Job %s\n"),
+              dev->print_name(), jcr->Job);
             Jmsg(jcr, M_FATAL, 0, "%s", dev->errmsg);
-            Dmsg1(400, "Gave up waiting on device %s\n", dev_name(dev));
+            Dmsg1(400, "Gave up waiting on device %s\n", dev->print_name());
            return false;             /* exceeded maximum waits */
         }
         continue;
@@ -515,7 +515,7 @@ bool dir_ask_sysop_to_create_appendable_volume(DCR *dcr)
          Jmsg(jcr, M_WARNING, 0, _("pthread error in mount_next_volume stat=%d ERR=%s\n"), stat,
            be.strerror(stat));
       }
-      Dmsg1(400, "Someone woke me for device %s\n", dev_name(dev));
+      Dmsg1(400, "Someone woke me for device %s\n", dev->print_name());
 
       /* If no VolumeName, and cannot get one, try again */
       if (dcr->VolumeName[0] == 0 && !job_canceled(jcr) &&
@@ -589,17 +589,17 @@ bool dir_ask_sysop_to_mount_volume(DCR *dcr)
 
       stat = wait_for_sysop(dcr);    ;    /* wait on device */
       if (dev->poll) {
-         Dmsg1(400, "Poll timeout in mount vol on device %s\n", dev_name(dev));
+         Dmsg1(400, "Poll timeout in mount vol on device %s\n", dev->print_name());
          Dmsg1(400, "Blocked=%s\n", edit_blocked_reason(dev));
         return true;
       }
 
       if (stat == ETIMEDOUT) {
         if (!double_dev_wait_time(dev)) {
-            Mmsg(dev->errmsg, _("Max time exceeded waiting to mount Storage Device \"%s\" for Job %s\n"),
-              dev_name(dev), jcr->Job);
+            Mmsg(dev->errmsg, _("Max time exceeded waiting to mount Storage Device %s for Job %s\n"),
+              dev->print_name(), jcr->Job);
             Jmsg(jcr, M_FATAL, 0, "%s", dev->errmsg);
-            Dmsg1(400, "Gave up waiting on device %s\n", dev_name(dev));
+            Dmsg1(400, "Gave up waiting on device %s\n", dev->print_name());
            return false;             /* exceeded maximum waits */
         }
         continue;
@@ -613,10 +613,10 @@ bool dir_ask_sysop_to_mount_volume(DCR *dcr)
       }
       if (stat != 0) {
         berrno be;
-         Jmsg(jcr, M_FATAL, 0, _("pthread error in mount_next_volume stat=%d ERR=%s\n"), stat,
+         Jmsg(jcr, M_FATAL, 0, _("pthread error in mount_next_volume stat=%d: ERR=%s\n"), stat,
            be.strerror(stat));
       }
-      Dmsg1(400, "Someone woke me for device %s\n", dev_name(dev));
+      Dmsg1(400, "Someone woke me for device %s\n", dev->print_name());
       break;
    }
    set_jcr_job_status(jcr, JS_Running);
@@ -674,7 +674,7 @@ static int wait_for_sysop(DCR *dcr)
    for ( ; !job_canceled(jcr); ) {
       time_t now, start;
 
-      Dmsg3(400, "I'm going to sleep on device %s. HB=%d wait=%d\n", dev_name(dev),
+      Dmsg3(400, "I'm going to sleep on device %s. HB=%d wait=%d\n", dev->print_name(),
         (int)me->heartbeat_interval, dev->wait_sec);
       start = time(NULL);
       /* Wait required time */
index 194d0c7de9d46a49e93020f77cac7321f2a0ff60..71db9dc80a0f0b2e0813fb13935825146d48726b 100644 (file)
@@ -323,7 +323,7 @@ char *edit_device_codes(DCR *dcr, char *omsg, const char *cmd)
             str = "%";
            break;
          case 'a':
-           str = dev_name(dcr->dev);
+           str = dcr->dev->archive_name();
            break;
          case 'c':
            str = NPRT(dcr->device->changer_name);
index a416098f55c662cbcb5562ebadcb1dce6f5b6c2e..47cf76219df96e7c9c600eece7bf2e485bf280e1 100644 (file)
@@ -225,15 +225,15 @@ static bool record_cb(DCR *in_dcr, DEV_RECORD *rec)
             Dmsg2(150, "!write_record_to_block data_len=%d rem=%d\n", rec->data_len,
                       rec->remainder);
            if (!write_block_to_device(out_jcr->dcr)) {
-               Dmsg2(90, "Got write_block_to_dev error on device %s%s\n",
-                 dev_name(out_dev), strerror_dev(out_dev));
+               Dmsg2(90, "Got write_block_to_dev error on device %s: ERR=%s\n",
+                 out_dev->print_name(), strerror_dev(out_dev));
                Jmsg(out_jcr, M_FATAL, 0, _("Cannot fixup device error. %s\n"),
                     strerror_dev(out_dev));
            }
         }
         if (!write_block_to_device(out_jcr->dcr)) {
-            Dmsg2(90, "Got write_block_to_dev error on device %s%s\n",
-              dev_name(out_dev), strerror_dev(out_dev));
+            Dmsg2(90, "Got write_block_to_dev error on device %s: ERR=%s\n",
+              out_dev->print_name(), strerror_dev(out_dev));
             Jmsg(out_jcr, M_FATAL, 0, _("Cannot fixup device error. %s\n"),
                  strerror_dev(out_dev));
         }
@@ -255,8 +255,8 @@ static bool record_cb(DCR *in_dcr, DEV_RECORD *rec)
       Dmsg2(150, "!write_record_to_block data_len=%d rem=%d\n", rec->data_len,
                 rec->remainder);
       if (!write_block_to_device(out_jcr->dcr)) {
-         Dmsg2(90, "Got write_block_to_dev error on device %s%s\n",
-           dev_name(out_dev), strerror_dev(out_dev));
+         Dmsg2(90, "Got write_block_to_dev error on device %s: ERR=%s\n",
+           out_dev->print_name(), strerror_dev(out_dev));
          Jmsg(out_jcr, M_FATAL, 0, _("Cannot fixup device error. %s\n"),
               strerror_dev(out_dev));
         break;
@@ -280,7 +280,7 @@ bool dir_ask_sysop_to_mount_volume(DCR *dcr)
 {
    DEVICE *dev = dcr->dev;
    fprintf(stderr, "Mount Volume \"%s\" on device %s and press return when ready: ",
-      dcr->VolumeName, dev_name(dev));
+      dcr->VolumeName, dev->print_name());
    getchar();
    return true;
 }
index 25d12c838ea5d23237eb1fa6f549abcd23e633cd..145fca6c3c169fc249c3ddd8bc9f8a01159dd685 100644 (file)
@@ -466,7 +466,7 @@ bool dir_ask_sysop_to_mount_volume(DCR *dcr)
 {
    DEVICE *dev = dcr->dev;
    fprintf(stderr, "Mount Volume \"%s\" on device %s and press return when ready: ",
-      dcr->VolumeName, dev_name(dev));
+      dcr->VolumeName, dev->print_name());
    getchar();
    return true;
 }
index e94f7ee9b11435ec8c15d09ad027043d573ad9b8..e2c5b69990fb5849d85b6584eee64637b2ed742c 100644 (file)
@@ -758,14 +758,14 @@ static bool do_dvd_size_checks(DCR *dcr)
        (dev->part_size + block->binbuf) >= dev->max_part_size) {
       if (dev->part < dev->num_parts) {
          Jmsg3(dcr->jcr, M_FATAL, 0, _("Error while writing, current part number is less than the total number of parts (%d/%d, device=%s)\n"),
-              dev->part, dev->num_parts, dev_name(dev));
+              dev->part, dev->num_parts, dev->print_name());
         dev->dev_errno = EIO;
         return false;
       }
       
       if (open_next_part(dev) < 0) {
-         Jmsg2(dcr->jcr, M_FATAL, 0, _("Unable to open device next part %s. ERR=%s\n"),
-               dev_name(dev), strerror_dev(dev));
+         Jmsg2(dcr->jcr, M_FATAL, 0, _("Unable to open device next part %s: ERR=%s\n"),
+               dev->print_name(), strerror_dev(dev));
         dev->dev_errno = EIO;
         return false;
       }
@@ -867,8 +867,8 @@ reread:
        ((dev->file_size-dev->part_start) == dev->part_size) && 
        (dev->part < dev->num_parts)) {
       if (open_next_part(dev) < 0) {
-         Jmsg2(dcr->jcr, M_FATAL, 0, _("Unable to open device next part %s. ERR=%s\n"),
-              dev_name(dev), strerror_dev(dev));
+         Jmsg2(dcr->jcr, M_FATAL, 0, _("Unable to open device next part %s: ERR=%s\n"),
+              dev->print_name(), strerror_dev(dev));
         dev->dev_errno = EIO;
         return false;
       }
index 276e42639258d76af6f577703fd6ecc999ab0417..167958a3422266c9e51d0a00f865fd91c63067d3 100644 (file)
@@ -260,7 +260,7 @@ static void do_blocks(char *infname)
         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_name(dev), dcr->VolumeName);
+                 dev->file, dev->print_name(), dcr->VolumeName);
               break;
            }
            /* Read and discard Volume label */
@@ -273,7 +273,7 @@ static void do_blocks(char *infname)
             Jmsg(jcr, M_INFO, 0, _("Mounted Volume \"%s\".\n"), dcr->VolumeName);
         } else if (dev->at_eof()) {
             Jmsg(jcr, M_INFO, 0, _("Got EOF at file %u on device %s, Volume \"%s\"\n"),
-              dev->file, dev_name(dev), dcr->VolumeName);
+              dev->file, dev->print_name(), dcr->VolumeName);
             Dmsg0(20, "read_record got eof. try again\n");
            continue;
         } else if (dev->state & ST_SHORT) {
@@ -432,7 +432,7 @@ bool dir_ask_sysop_to_mount_volume(DCR *dcr)
 {
    DEVICE *dev = dcr->dev;
    fprintf(stderr, "Mount Volume \"%s\" on device %s and press return when ready: ",
-      dcr->VolumeName, dev_name(dev));
+      dcr->VolumeName, dev->print_name());
    getchar();
    return true;
 }
index 3feb4413f024f4ca0a4089dd453fb63c7021868a..3507ab4a177c9e7619035965c48072ba278cb131 100644 (file)
@@ -1209,7 +1209,7 @@ bool dir_ask_sysop_to_mount_volume(DCR *dcr)
    }
    force_close_dev(dev);
    fprintf(stderr, "Mount Volume \"%s\" on device %s and press return when ready: ",
-        dcr->VolumeName, dev_name(dev));
+        dcr->VolumeName, dev->print_name());
    getchar();
    return true;
 }
index 6c0371789bb7598c23b345af4f906e50c19b6f0b..9a821b1b4591c2f7d7e72a86358bc907be3d97f8 100644 (file)
@@ -332,7 +332,7 @@ static bool open_the_device()
         return false;
       }
    }
-   Pmsg1(000, "open_dev %s OK\n", dev_name(dev));
+   Pmsg1(000, "open_dev %s OK\n", dev->print_name());
    dev->state |= ST_APPEND;
    unlock_device(dev);
    free_block(block);
@@ -420,7 +420,7 @@ static void loadcmd()
    if (!load_dev(dev)) {
       Pmsg1(0, "Bad status from load. ERR=%s\n", strerror_dev(dev));
    } else
-      Pmsg1(0, "Loaded %s\n", dev_name(dev));
+      Pmsg1(0, "Loaded %s\n", dev->print_name());
 }
 
 /*
@@ -432,7 +432,7 @@ static void rewindcmd()
       Pmsg1(0, "Bad status from rewind. ERR=%s\n", strerror_dev(dev));
       clrerror_dev(dev, -1);
    } else {
-      Pmsg1(0, "Rewound %s\n", dev_name(dev));
+      Pmsg1(0, "Rewound %s\n", dev->print_name());
    }
 }
 
@@ -462,7 +462,7 @@ static void weofcmd()
       Pmsg2(0, "Bad status from weof %d. ERR=%s\n", stat, strerror_dev(dev));
       return;
    } else {
-      Pmsg3(0, "Wrote %d EOF%s to %s\n", num, num==1?"":"s", dev_name(dev));
+      Pmsg3(0, "Wrote %d EOF%s to %s\n", num, num==1?"":"s", dev->print_name());
    }
 }
 
@@ -1192,14 +1192,14 @@ try_again:
       sleep_time += 30;
       goto try_again;
    } else {
-      Pmsg1(0, "Rewound %s\n", dev_name(dev));
+      Pmsg1(0, "Rewound %s\n", dev->print_name());
    }
 
    if ((status = weof_dev(dev, 1)) < 0) {
       Pmsg2(0, "Bad status from weof %d. ERR=%s\n", status, strerror_dev(dev));
       goto bail_out;
    } else {
-      Pmsg1(0, "Wrote EOF to %s\n", dev_name(dev));
+      Pmsg1(0, "Wrote EOF to %s\n", dev->print_name());
    }
 
    if (sleep_time) {
@@ -1768,7 +1768,7 @@ static void fillcmd()
       return;
    }
 
-   Dmsg1(20, "Begin append device=%s\n", dev_name(dev));
+   Dmsg1(20, "Begin append device=%s\n", dev->print_name());
    Dmsg1(20, "MaxVolSize=%s\n", edit_uint64(dev->max_volume_size, ec1));
 
    /* Use fixed block size to simplify read back */
@@ -2627,10 +2627,10 @@ bool dir_ask_sysop_to_mount_volume(DCR *dcr)
    Pmsg1(-1, "%s", dev->errmsg);           /* print reason */
    if (dcr->VolumeName[0] == 0 || strcmp(dcr->VolumeName, "TestVolume2") == 0) {
       fprintf(stderr, "Mount second Volume on device %s and press return when ready: ",
-        dev_name(dev));
+        dev->print_name());
    } else {
       fprintf(stderr, "Mount Volume \"%s\" on device %s and press return when ready: ",
-        dcr->VolumeName, dev_name(dev));
+        dcr->VolumeName, dev->print_name());
    }
    getchar();
    return true;
@@ -2654,7 +2654,7 @@ bool dir_ask_sysop_to_create_appendable_volume(DCR *dcr)
    if (!autochanger) {
       force_close_dev(dev);
       fprintf(stderr, "Mount blank Volume on device %s and press return when ready: ",
-        dev_name(dev));
+        dev->print_name());
       getchar();
    }
    open_device(dcr);
@@ -2698,7 +2698,7 @@ static bool my_mount_next_read_volume(DCR *dcr)
    close_dev(dev);
    dev->state &= ~ST_READ;
    if (!acquire_device_for_read(jcr, dev)) {
-      Pmsg2(0, "Cannot open Dev=%s, Vol=%s\n", dev_name(dev), dcr->VolumeName);
+      Pmsg2(0, "Cannot open Dev=%s, Vol=%s\n", dev->print_name(), dcr->VolumeName);
       return false;
    }
    return true;                   /* next volume mounted */
index e34856ec894596cfbc24a18dca1df5056eb959fc..bd8a9fe3f08717b664bf2ef73d835af6b3555d54 100644 (file)
@@ -149,6 +149,8 @@ init_dev(JCR *jcr, DEVICE *dev, DEVRES *device)
    /* Copy user supplied device parameters from Resource */
    dev->dev_name = get_memory(strlen(device->device_name)+1);
    pm_strcpy(dev->dev_name, device->device_name);
+   dev->prt_name = get_memory(strlen(device->device_name) + strlen(device->hdr.name) + 10);
+   Mmsg(dev->prt_name, "\"%s\" (%s)", device->device_name, device->hdr.name);
    dev->capabilities = device->cap_bits;
    dev->min_block_size = device->min_block_size;
    dev->max_block_size = device->max_block_size;
@@ -1584,13 +1586,6 @@ dev_can_write(DEVICE *dev)
    }
 }
 
-/* This returns the physical device name */
-char *
-dev_name(DEVICE *dev)
-{
-   return dev->dev_name;
-}
-
 /* Return the resource name for the device */
 const char *DEVICE::name() const
 {
index 4f562e753913cdace1c4086b1488d242d8b756b5..62e7648605bf181f54eb30f040cdd6efc212337a 100644 (file)
@@ -197,7 +197,8 @@ public:
    bool autoselect;                   /* Autoselect in autochanger */
    int label_type;                    /* Bacula/ANSI/IBM label types */
    uint32_t drive_index;              /* Autochanger drive index */
-   POOLMEM *dev_name;                 /* device name */
+   POOLMEM *dev_name;                 /* Physical device name */
+   POOLMEM *prt_name;                 /* Name used for display purposes */
    char *errmsg;                      /* nicely edited error message */
    uint32_t block_num;                /* current block number base 0 */
    uint32_t file;                     /* current file number base 0 */
@@ -264,6 +265,7 @@ public:
    const char *strerror() const;
    const char *archive_name() const;
    const char *name() const;
+   const char *print_name() const;    /* Name for display purposes */
    void set_eof();
    void set_eot();
    void set_append();
@@ -297,6 +299,7 @@ inline void DEVICE::clear_label() { state &= ~ST_LABEL; }
 inline void DEVICE::clear_offline() { state &= ~ST_OFFLINE; }
 inline const char *DEVICE::strerror() const { return errmsg; }
 inline const char *DEVICE::archive_name() const { return dev_name; }
+inline const char *DEVICE::print_name() const { return prt_name; }
 
 /*
  * Device Context (or Control) Record.
index 2807a97404bcb69ec4a9139dcba20f6a6dbc1df3..d6bdf470cfc35b373104da8fbe5446eb43ce020e 100644 (file)
@@ -134,7 +134,7 @@ bool fixup_device_block_write_error(DCR *dcr)
    P(dev->mutex);                 /* lock again */
 
    Jmsg(jcr, M_INFO, 0, _("New volume \"%s\" mounted on device %s at %s.\n"),
-      dcr->VolumeName, dev_name(dev), bstrftime(dt, sizeof(dt), time(NULL)));
+      dcr->VolumeName, dev->print_name(), bstrftime(dt, sizeof(dt), time(NULL)));
 
    /*
     * If this is a new tape, the label_blk will contain the
@@ -290,7 +290,7 @@ bool first_open_device(DEVICE *dev)
         return false;
       }
    }
-   Dmsg1(129, "open_dev %s OK\n", dev_name(dev));
+   Dmsg1(129, "open_dev %s OK\n", dev->print_name());
 
    unlock_device(dev);
    return true;
@@ -313,10 +313,10 @@ bool open_device(DCR *dcr)
       if (open_dev(dev, dcr->VolCatInfo.VolCatName, mode) < 0) {
         /* If polling, ignore the error */
         if (!dev->poll) {
-            Jmsg2(dcr->jcr, M_FATAL, 0, _("Unable to open archive %s. ERR=%s\n"),
-              dev_name(dev), strerror_dev(dev));
-            Pmsg2(000, "Unable to open archive %s. ERR=%s\n", 
-              dev_name(dev), strerror_dev(dev));
+            Jmsg2(dcr->jcr, M_FATAL, 0, _("Unable to open archive %s: ERR=%s\n"),
+              dev->print_name(), strerror_dev(dev));
+            Pmsg2(000, "Unable to open archive %s: ERR=%s\n", 
+              dev->print_name(), strerror_dev(dev));
         }
         return false;
       }
index aee4e99270120692588287180524f712896ee757..f4ac283fcf84a75e37546fd2354be85f2705051e 100644 (file)
@@ -420,8 +420,8 @@ static void label_volume_if_ok(JCR *jcr, DEVICE *dev, char *oldname,
       }
       bstrncpy(dcr->VolumeName, newname, sizeof(dcr->VolumeName));
       /* The following 3000 OK label. string is scanned in ua_label.c */
-      bnet_fsend(dir, "3000 OK label. Volume=%s Device=\"%s\" (%s)\n",
-        newname, dev->name(), dev->archive_name());
+      bnet_fsend(dir, "3000 OK label. Volume=%s Device=%s\n",
+        newname, dev->print_name());
       break;
    case VOL_NO_MEDIA:
       bnet_fsend(dir, _("3912 Failed to label Volume: ERR=%s\n"), strerror_dev(dev));
@@ -461,8 +461,8 @@ static bool read_label(DCR *dcr)
       ok = true;
       break;
    default:
-      bnet_fsend(dir, _("3902 Cannot mount Volume on Storage Device \"%s\" (%s) because:\n%s"),
-        dev->name(), dev->archive_name(), jcr->errmsg);
+      bnet_fsend(dir, _("3902 Cannot mount Volume on Storage Device %s because:\n%s"),
+        dev->print_name(), jcr->errmsg);
       ok = false;
       break;
    }
@@ -553,8 +553,8 @@ static bool mount_cmd(JCR *jcr)
            /* Someone is waiting, wake him */
             Dmsg0(100, "Waiting for mount. Attempting to wake thread\n");
            dev->dev_blocked = BST_MOUNT;
-            bnet_fsend(dir, "3001 OK mount. Device=\"%s\" (%s)\n", 
-              dev->name(), dev->archive_name());
+            bnet_fsend(dir, "3001 OK mount. Device=%s\n", 
+              dev->print_name());
            pthread_cond_signal(&dev->wait_next_vol);
            break;
 
@@ -578,35 +578,35 @@ static bool mount_cmd(JCR *jcr)
               dev->dev_blocked = BST_MOUNT;
            }
            if (dev->is_labeled()) {
-               bnet_fsend(dir, _("3001 Device \"%s\" (%s) is mounted with Volume \"%s\"\n"),
-                 dev->name(), dev->archive_name(), dev->VolHdr.VolName);
+               bnet_fsend(dir, _("3001 Device %s is mounted with Volume \"%s\"\n"),
+                 dev->print_name(), dev->VolHdr.VolName);
            } else {
-               bnet_fsend(dir, _("3905 Device \"%s\" (%s) open but no Bacula volume is mounted.\n"
+               bnet_fsend(dir, _("3905 Device %s open but no Bacula volume is mounted.\n"
                                  "If this is not a blank tape, try unmounting and remounting the Volume.\n"),
-                         dev->name(), dev->archive_name());
+                         dev->print_name());
            }
            pthread_cond_signal(&dev->wait_next_vol);
            break;
 
         case BST_DOING_ACQUIRE:
-            bnet_fsend(dir, _("3001 Device \"%s\" (%s) is mounted; doing acquire.\n"),
-                      dev->name(), dev->archive_name());
+            bnet_fsend(dir, _("3001 Device %s is mounted; doing acquire.\n"),
+                      dev->print_name());
            break;
 
         case BST_WRITING_LABEL:
-            bnet_fsend(dir, _("3903 Device \"%s\" (%s) is being labeled.\n"), 
-              dev->name(), dev->archive_name());
+            bnet_fsend(dir, _("3903 Device %s is being labeled.\n"), 
+              dev->print_name());
            break;
 
         case BST_NOT_BLOCKED:
            if (dev->is_open()) {
               if (dev->is_labeled()) {
-                  bnet_fsend(dir, _("3001 Device \"%s\" (%s) is mounted with Volume \"%s\"\n"),
-                    dev->name(), dev->archive_name(), dev->VolHdr.VolName);
+                  bnet_fsend(dir, _("3001 Device %s is mounted with Volume \"%s\"\n"),
+                    dev->print_name(), dev->VolHdr.VolName);
               } else {
-                  bnet_fsend(dir, _("3905 Device \"%s\" (%s) open but no Bacula volume is mounted.\n"
+                  bnet_fsend(dir, _("3905 Device %s open but no Bacula volume is mounted.\n"
                                  "If this is not a blank tape, try unmounting and remounting the Volume.\n"),
-                            dev->name(), dev->archive_name());
+                            dev->print_name());
               }
            } else {
               if (!dev_is_tape(dev)) {
@@ -620,12 +620,12 @@ static bool mount_cmd(JCR *jcr)
               }
               read_label(dcr);
               if (dev->is_labeled()) {
-                  bnet_fsend(dir, _("3001 Device \"%s\" (%s) is already mounted with Volume \"%s\"\n"),
-                    dev->name(), dev->archive_name(), dev->VolHdr.VolName);
+                  bnet_fsend(dir, _("3001 Device %s is already mounted with Volume \"%s\"\n"),
+                    dev->print_name(), dev->VolHdr.VolName);
               } else {
-                  bnet_fsend(dir, _("3905 Device \"%s\" (%s) open but no Bacula volume is mounted.\n"
+                  bnet_fsend(dir, _("3905 Device %s open but no Bacula volume is mounted.\n"
                                     "If this is not a blank tape, try unmounting and remounting the Volume.\n"),
-                            dev->name(), dev->archive_name());
+                            dev->print_name());
               }
            }
            break;
@@ -661,8 +661,8 @@ static bool unmount_cmd(JCR *jcr)
         P(dev->mutex);               /* Use P to avoid indefinite block */
         if (!dev->is_open()) {
             Dmsg0(90, "Device already unmounted\n");
-            bnet_fsend(dir, _("3901 Device \"%s\" (%s) is already unmounted.\n"), 
-              dev->name(), dev->archive_name());
+            bnet_fsend(dir, _("3901 Device %s is already unmounted.\n"), 
+              dev->print_name());
 
         } else if (dev->dev_blocked == BST_WAITING_FOR_SYSOP) {
             Dmsg2(90, "%d waiter dev_block=%d. doing unmount\n", dev->num_waiting,
@@ -671,16 +671,16 @@ static bool unmount_cmd(JCR *jcr)
            offline_or_rewind_dev(dev);
            force_close_dev(dev);
            dev->dev_blocked = BST_UNMOUNTED_WAITING_FOR_SYSOP;
-            bnet_fsend(dir, _("3001 Device \"%s\" (%s) unmounted.\n"), 
-              dev->name(), dev->archive_name());
+            bnet_fsend(dir, _("3001 Device %s unmounted.\n"), 
+              dev->print_name());
 
         } else if (dev->dev_blocked == BST_DOING_ACQUIRE) {
-            bnet_fsend(dir, _("3902 Device \"%s\" (%s) is busy in acquire.\n"), 
-              dev->name(), dev->archive_name());
+            bnet_fsend(dir, _("3902 Device %s is busy in acquire.\n"), 
+              dev->print_name());
 
         } else if (dev->dev_blocked == BST_WRITING_LABEL) {
-            bnet_fsend(dir, _("3903 Device \"%s\" (%s) is being labeled.\n"), 
-              dev->name(), dev->archive_name());
+            bnet_fsend(dir, _("3903 Device %s is being labeled.\n"), 
+              dev->print_name());
 
         } else if (dev->is_busy()) {
            send_dir_busy_message(dir, dev);
@@ -697,8 +697,8 @@ static bool unmount_cmd(JCR *jcr)
            open_dev(dev, NULL, 0);     /* fake open for close */
            offline_or_rewind_dev(dev);
            force_close_dev(dev);
-            bnet_fsend(dir, _("3002 Device \"%s\" (%s) unmounted.\n"), 
-              dev->name(), dev->archive_name());
+            bnet_fsend(dir, _("3002 Device %s unmounted.\n"), 
+              dev->print_name());
         }
         V(dev->mutex);
       } else {
@@ -732,31 +732,31 @@ static bool release_cmd(JCR *jcr)
         P(dev->mutex);               /* Use P to avoid indefinite block */
         if (!dev->is_open()) {
             Dmsg0(90, "Device already released\n");
-            bnet_fsend(dir, _("3911 Device \"%s\" (%s) already released.\n"), 
-              dev->name(), dev->archive_name());
+            bnet_fsend(dir, _("3911 Device %s already released.\n"), 
+              dev->print_name());
 
         } else if (dev->dev_blocked == BST_WAITING_FOR_SYSOP ||
                    dev->dev_blocked == BST_UNMOUNTED_WAITING_FOR_SYSOP) {
             Dmsg2(90, "%d waiter dev_block=%d. doing unmount\n", dev->num_waiting,
               dev->dev_blocked);
-            bnet_fsend(dir, _("3912 Device \"%s\" (%s) waiting for mount.\n"), 
-              dev->name(), dev->archive_name());
+            bnet_fsend(dir, _("3912 Device %s waiting for mount.\n"), 
+              dev->print_name());
 
         } else if (dev->dev_blocked == BST_DOING_ACQUIRE) {
-            bnet_fsend(dir, _("3913 Device \"%s\" (%s) is busy in acquire.\n"), 
-              dev->name(), dev->archive_name());
+            bnet_fsend(dir, _("3913 Device %s is busy in acquire.\n"), 
+              dev->print_name());
 
         } else if (dev->dev_blocked == BST_WRITING_LABEL) {
-            bnet_fsend(dir, _("3914 Device \"%s\" (%s) is being labeled.\n"), 
-              dev->name(), dev->archive_name());
+            bnet_fsend(dir, _("3914 Device %s is being labeled.\n"), 
+              dev->print_name());
 
         } else if (dev->is_busy()) {
            send_dir_busy_message(dir, dev);
         } else {                     /* device not being used */
             Dmsg0(90, "Device not in use, unmounting\n");
            release_volume(jcr->dcr);
-            bnet_fsend(dir, _("3012 Device \"%s\" (%s) released.\n"), 
-              dev->name(), dev->archive_name());
+            bnet_fsend(dir, _("3012 Device %s released.\n"), 
+              dev->print_name());
         }
         V(dev->mutex);
       } else {
@@ -789,8 +789,8 @@ static bool autochanger_cmd(JCR *jcr)
       if (dev) {
         P(dev->mutex);               /* Use P to avoid indefinite block */
         if (!dev_is_tape(dev)) {
-            bnet_fsend(dir, _("3995 Device \"%s\" (%s) is not an autochanger.\n"), 
-              dev->name(), dev->archive_name());
+            bnet_fsend(dir, _("3995 Device %s is not an autochanger.\n"), 
+              dev->print_name());
         } else if (!dev->is_open()) {
            autochanger_list(dcr, dir);
          /* Under certain "safe" conditions, we can steal the lock */
@@ -883,8 +883,8 @@ static void read_volume_label(JCR *jcr, DEVICE *dev, int Slot)
       Dmsg1(100, "Volume: %s\n", dev->VolHdr.VolName);
       break;
    default:
-      bnet_fsend(dir, _("3902 Cannot mount Volume on Storage Device \"%s\" (%s) because:\n%s"),
-                dev->name(), dev->archive_name(), jcr->errmsg);
+      bnet_fsend(dir, _("3902 Cannot mount Volume on Storage Device %s because:\n%s"),
+                dev->print_name(), jcr->errmsg);
       break;
    }
 
@@ -909,8 +909,8 @@ static bool try_autoload_device(JCR *jcr, int slot, const char *VolName)
    /* Ensure that the device is open -- autoload_device() closes it */
    for ( ; !dev->is_open(); ) {
       if (open_dev(dev, dcr->VolumeName, OPEN_READ_WRITE) < 0) {
-         bnet_fsend(dir, _("3910 Unable to open device \"%s\" (%s): ERR=%s\n"),
-           dev->name(), dev->archive_name(), dev->strerror());
+         bnet_fsend(dir, _("3910 Unable to open device %s: ERR=%s\n"),
+           dev->print_name(), dev->strerror());
         return false;
       }
    }
@@ -920,10 +920,10 @@ static bool try_autoload_device(JCR *jcr, int slot, const char *VolName)
 static void send_dir_busy_message(BSOCK *dir, DEVICE *dev)
 {
    if (dev->can_read()) {
-       bnet_fsend(dir, _("3911 Device \"%s\" (%s) is busy reading.\n"),
-                  dev->name(), dev->archive_name());;
+       bnet_fsend(dir, _("3911 Device %s is busy reading.\n"),
+                  dev->print_name());;
    } else {
-       bnet_fsend(dir, _("3912 Device \"%s\" (%s) is busy with %d writer(s).\n"),
-         dev->name(), dev->archive_name(), dev->num_writers);
+       bnet_fsend(dir, _("3912 Device %s is busy with %d writer(s).\n"),
+         dev->print_name(), dev->num_writers);
    }
 }
index 8e7584b779a33c73b44d2deda80ec2587fa041c7..907ee187b5e952da475389042adb5726acb51fc2 100644 (file)
@@ -79,8 +79,8 @@ int read_dev_volume_label(DCR *dcr)
    if (dev->is_labeled()) {             /* did we already read label? */
       /* Compare Volume Names allow special wild card */
       if (VolName && *VolName && *VolName != '*' && strcmp(dev->VolHdr.VolName, VolName) != 0) {
-         Mmsg(jcr->errmsg, _("Wrong Volume mounted on device \"%s\" (%s): Wanted %s have %s\n"),
-           dev->name(), dev->archive_name(), VolName, dev->VolHdr.VolName);
+         Mmsg(jcr->errmsg, _("Wrong Volume mounted on device %s: Wanted %s have %s\n"),
+           dev->print_name(), VolName, dev->VolHdr.VolName);
         /*
          * Cancel Job if too many label errors
          *  => we are in a loop
@@ -98,8 +98,8 @@ int read_dev_volume_label(DCR *dcr)
    dev->label_type = B_BACULA_LABEL;
 
    if (!rewind_dev(dev)) {
-      Mmsg(jcr->errmsg, _("Couldn't rewind device \"%s\" (%s): ERR=%s\n"), 
-        dev->name(), dev->archive_name(), strerror_dev(dev));
+      Mmsg(jcr->errmsg, _("Couldn't rewind device %s: ERR=%s\n"), 
+        dev->print_name(), strerror_dev(dev));
       Dmsg1(30, "%s", jcr->errmsg);
       return VOL_NO_MEDIA;
    }
@@ -118,8 +118,8 @@ int read_dev_volume_label(DCR *dcr)
         return stat;
       }
       if (stat == VOL_NAME_ERROR || stat == VOL_LABEL_ERROR) {
-         Mmsg(jcr->errmsg, _("Wrong Volume mounted on device \"%s\" (%s): Wanted %s have %s\n"),
-             dev->name(), dev->archive_name(), VolName, dev->VolHdr.VolName);
+         Mmsg(jcr->errmsg, _("Wrong Volume mounted on device %s: Wanted %s have %s\n"),
+             dev->print_name(), VolName, dev->VolHdr.VolName);
         if (!dev->poll && jcr->label_errors++ > 100) {
             Jmsg(jcr, M_FATAL, 0, "Too many tries: %s", jcr->errmsg);
         }
@@ -138,9 +138,9 @@ int read_dev_volume_label(DCR *dcr)
 
    Dmsg0(90, "Big if statement in read_volume_label\n");
    if (!read_block_from_dev(dcr, NO_BLOCK_NUMBER_CHECK)) {
-      Mmsg(jcr->errmsg, _("Requested Volume \"%s\" on \"%s\" (%s) is not a Bacula "
+      Mmsg(jcr->errmsg, _("Requested Volume \"%s\" on %s is not a Bacula "
            "labeled Volume, because: ERR=%s"), NPRT(VolName), 
-          dev->name(), dev->archive_name(), strerror_dev(dev));
+          dev->print_name(), strerror_dev(dev));
       Dmsg1(30, "%s", jcr->errmsg);
    } else if (!read_record_from_block(block, record)) {
       Mmsg(jcr->errmsg, _("Could not read Volume label from block.\n"));
@@ -182,8 +182,8 @@ int read_dev_volume_label(DCR *dcr)
    if (dev->VolHdr.VerNum != BaculaTapeVersion &&
        dev->VolHdr.VerNum != OldCompatibleBaculaTapeVersion1 &&
        dev->VolHdr.VerNum != OldCompatibleBaculaTapeVersion2) {
-      Mmsg(jcr->errmsg, _("Volume on \"%s\" (%s) has wrong Bacula version. Wanted %d got %d\n"),
-        dev->name(), dev->archive_name(), BaculaTapeVersion, dev->VolHdr.VerNum);
+      Mmsg(jcr->errmsg, _("Volume on %s has wrong Bacula version. Wanted %d got %d\n"),
+        dev->print_name(), BaculaTapeVersion, dev->VolHdr.VerNum);
       Dmsg1(30, "%s", jcr->errmsg);
       return VOL_VERSION_ERROR;
    }
@@ -192,8 +192,8 @@ int read_dev_volume_label(DCR *dcr)
     * a Bacula volume label (VOL_LABEL)
     */
    if (dev->VolHdr.LabelType != PRE_LABEL && dev->VolHdr.LabelType != VOL_LABEL) {
-      Mmsg(jcr->errmsg, _("Volume on \"%s\" (%s) has bad Bacula label type: %x\n"),
-         dev->name(), dev->archive_name(), dev->VolHdr.LabelType);
+      Mmsg(jcr->errmsg, _("Volume on %s has bad Bacula label type: %x\n"),
+         dev->print_name(), dev->VolHdr.LabelType);
       Dmsg1(30, "%s", jcr->errmsg);
       if (!dev->poll && jcr->label_errors++ > 100) {
          Jmsg(jcr, M_FATAL, 0, "Too many tries: %s", jcr->errmsg);
@@ -206,8 +206,8 @@ int read_dev_volume_label(DCR *dcr)
    /* Compare Volume Names */
    Dmsg2(30, "Compare Vol names: VolName=%s hdr=%s\n", VolName?VolName:"*", dev->VolHdr.VolName);
    if (VolName && *VolName && *VolName != '*' && strcmp(dev->VolHdr.VolName, VolName) != 0) {
-      Mmsg(jcr->errmsg, _("Wrong Volume mounted on device \"%s\" (%s): Wanted %s have %s\n"),
-          dev->name(), dev->archive_name(), VolName, dev->VolHdr.VolName);
+      Mmsg(jcr->errmsg, _("Wrong Volume mounted on device %s: Wanted %s have %s\n"),
+          dev->print_name(), VolName, dev->VolHdr.VolName);
       Dmsg1(30, "%s", jcr->errmsg);
       /*
        * Cancel Job if too many label errors
@@ -256,8 +256,8 @@ int read_dev_volume_label_guess(DCR *dcr, bool write)
    */
    if (open_guess_name_dev(dev) < 0) {    
       if (!write || dcr->VolCatInfo.VolCatParts > 0) {
-         Mmsg3(jcr->errmsg, _("Requested Volume \"%s\" on \"%s\" (%s) is not a Bacula labeled Volume."),
-              dev->name(), dev->archive_name(), dcr->VolumeName);
+         Mmsg2(jcr->errmsg, _("Requested Volume \"%s\" on %s is not a Bacula labeled Volume."),
+              dev->print_name(), dcr->VolumeName);
          Dmsg0(100, "Leave read_dev_volume_label_guess VOL_IO_ERROR (!open_guess_name_dev)\n");
         return VOL_NO_LABEL;
       }
@@ -340,8 +340,8 @@ bool write_volume_label_to_block(DCR *dcr)
    block->BlockNumber = 0;
    if (!write_record_to_block(block, &rec)) {
       free_pool_memory(rec.data);
-      Jmsg2(jcr, M_FATAL, 0, _("Cannot write Volume label to block for device \"%s\" (%s)\n"),
-        dev->name(), dev->archive_name());
+      Jmsg1(jcr, M_FATAL, 0, _("Cannot write Volume label to block for device %s\n"),
+        dev->print_name());
       return false;
    } else {
       Dmsg1(90, "Wrote label of %d bytes to block\n", rec.data_len);
@@ -458,13 +458,13 @@ bool rewrite_volume_label(DCR *dcr, bool recycle)
     */
    if (!dev_cap(dev, CAP_STREAM)) {
       if (!rewind_dev(dev)) {
-         Jmsg3(jcr, M_WARNING, 0, _("Rewind error on device \"%s\" (%s): ERR=%s\n"),
-              dev->name(), dev->archive_name(), strerror_dev(dev));
+         Jmsg2(jcr, M_WARNING, 0, _("Rewind error on device %s: ERR=%s\n"),
+              dev->print_name(), strerror_dev(dev));
       }
       if (recycle) {
         if (!truncate_dev(dev)) {
-            Jmsg3(jcr, M_WARNING, 0, _("Truncate error on device \"%s\" (%s): ERR=%s\n"),
-                 dev->name(), dev->archive_name(), strerror_dev(dev));
+            Jmsg2(jcr, M_WARNING, 0, _("Truncate error on device %s: ERR=%s\n"),
+                 dev->print_name(), strerror_dev(dev));
         }
       }
 
@@ -485,8 +485,8 @@ bool rewrite_volume_label(DCR *dcr, bool recycle)
       /* Attempt write to check write permission */
       Dmsg0(200, "Attempt to write to device.\n");
       if (!write_block_to_dev(dcr)) {
-         Jmsg3(jcr, M_ERROR, 0, _("Unable to write device \"%s\" (%s): ERR=%s\n"),
-           dev->name(), dev->archive_name(), strerror_dev(dev));
+         Jmsg2(jcr, M_ERROR, 0, _("Unable to write device %s: ERR=%s\n"),
+           dev->print_name(), strerror_dev(dev));
          Dmsg0(200, "===ERROR write block to dev\n");
         return false;
       }
@@ -513,11 +513,11 @@ bool rewrite_volume_label(DCR *dcr, bool recycle)
       return false;
    }
    if (recycle) {
-      Jmsg(jcr, M_INFO, 0, _("Recycled volume \"%s\" on device \"%s\" (%s), all previous data lost.\n"),
-        dcr->VolumeName, dev->name(), dev->archive_name());
+      Jmsg(jcr, M_INFO, 0, _("Recycled volume \"%s\" on device %s, all previous data lost.\n"),
+        dcr->VolumeName, dev->print_name());
    } else {
-      Jmsg(jcr, M_INFO, 0, _("Wrote label to prelabeled Volume \"%s\" on device \"%s\" (%s)\n"),
-        dcr->VolumeName, dev->name(), dev->archive_name());
+      Jmsg(jcr, M_INFO, 0, _("Wrote label to prelabeled Volume \"%s\" on device %s\n"),
+        dcr->VolumeName, dev->print_name());
    }
    /*
     * End writing real Volume label (from pre-labeled tape), or recycling
index 27d1ecebe38b93618addf85e6e4a2321f50c131c..a7485b04489eb9955900ee07ee062161d9ae8951 100644 (file)
@@ -68,7 +68,7 @@ mount_next_vol:
       dcr->VolCatInfo.Slot = 0;
       if (!dir_ask_sysop_to_mount_volume(dcr)) {
          Jmsg(jcr, M_FATAL, 0, _("Too many errors trying to mount device %s.\n"),
-             dev_name(dev));
+             dev->print_name());
         return false;
       }
    }
@@ -214,7 +214,7 @@ read_volume:
       /* If not removable, Volume is broken */
       if (!dev_cap(dev, CAP_REM)) {
          Jmsg(jcr, M_WARNING, 0, _("Volume \"%s\" not on device %s.\n"),
-           dcr->VolumeName, dev_name(dev));
+           dcr->VolumeName, dev->print_name());
         mark_volume_in_error(dcr);
         goto mount_next_vol;
       }
@@ -285,13 +285,13 @@ read_volume:
            return false;
         }
          Jmsg(jcr, M_INFO, 0, _("Labeled new Volume \"%s\" on device %s.\n"),
-           dcr->VolumeName, dev_name(dev));
+           dcr->VolumeName, dev->print_name());
         goto read_volume;      /* read label we just wrote */
       }
       /* If not removable, Volume is broken */
       if (!dev_cap(dev, CAP_REM)) {
          Jmsg(jcr, M_WARNING, 0, _("Volume \"%s\" not on device %s.\n"),
-           dcr->VolumeName, dev_name(dev));
+           dcr->VolumeName, dev->print_name());
         mark_volume_in_error(dcr);
         if (autochanger) {
            mark_volume_not_inchanger(dcr);
@@ -342,8 +342,8 @@ read_volume:
       Jmsg(jcr, M_INFO, 0, _("Volume \"%s\" previously written, moving to end of data.\n"),
         dcr->VolumeName);
       if (!eod_dev(dev)) {
-         Jmsg(jcr, M_ERROR, 0, _("Unable to position to end of data on device \"%s\". ERR=%s\n"),
-           dev_name(dev), strerror_dev(dev));
+         Jmsg(jcr, M_ERROR, 0, _("Unable to position to end of data on device %s: ERR=%s\n"),
+           dev->print_name(), strerror_dev(dev));
         mark_volume_in_error(dcr);
         goto mount_next_vol;
       }
@@ -408,7 +408,7 @@ bool mount_next_read_volume(DCR *dcr)
       close_dev(dev);
       dev->state &= ~ST_READ;
       if (!acquire_device_for_read(jcr, dev)) {
-         Jmsg2(jcr, M_FATAL, 0, "Cannot open Dev=%s, Vol=%s\n", dev_name(dev),
+         Jmsg2(jcr, M_FATAL, 0, "Cannot open Dev=%s, Vol=%s\n", dev->print_name(),
               dcr->VolumeName);
         return false;
       }
index 820fda9bd0b4f3737a9e8ce8bd13a682fb581f41..7730845939977a6172cca6a008204cd3d2ad9a28 100644 (file)
 uint32_t new_VolSessionId();
 
 /* From acquire.c */
-bool    reserve_device_for_append(JCR *jcr, DEVICE *dev);
-DCR    *acquire_device_for_append(JCR *jcr, DEVICE *dev);
-bool    reserve_device_for_read(JCR *jcr, DEVICE *dev);
-DCR    *acquire_device_for_read(JCR *jcr, DEVICE *dev);
-bool    release_device(DCR *dcr);
-DCR    *new_dcr(JCR *jcr, DEVICE *dev);
-void    free_dcr(DCR *dcr);
+bool     reserve_device_for_append(JCR *jcr, DEVICE *dev);
+DCR     *acquire_device_for_append(JCR *jcr, DEVICE *dev);
+bool     reserve_device_for_read(JCR *jcr, DEVICE *dev);
+DCR     *acquire_device_for_read(JCR *jcr, DEVICE *dev);
+bool     release_device(DCR *dcr);
+DCR     *new_dcr(JCR *jcr, DEVICE *dev);
+void     free_dcr(DCR *dcr);
 
 /* From askdir.c */
 enum get_vol_info_rw {
    GET_VOL_INFO_FOR_WRITE,
    GET_VOL_INFO_FOR_READ
 };
-bool   dir_get_volume_info(DCR *dcr, enum get_vol_info_rw);
-bool   dir_find_next_appendable_volume(DCR *dcr);
-bool   dir_update_volume_info(DCR *dcr, bool label);
-bool   dir_ask_sysop_to_create_appendable_volume(DCR *dcr);
-bool   dir_ask_sysop_to_mount_volume(DCR *dcr);
-bool   dir_update_file_attributes(DCR *dcr, DEV_RECORD *rec);
-bool   dir_send_job_status(JCR *jcr);
-bool   dir_create_jobmedia_record(DCR *dcr);
-bool   dir_update_device(JCR *jcr, DEVICE *dev);
-bool   dir_update_changer(JCR *jcr, AUTOCHANGER *changer);
+bool    dir_get_volume_info(DCR *dcr, enum get_vol_info_rw);
+bool    dir_find_next_appendable_volume(DCR *dcr);
+bool    dir_update_volume_info(DCR *dcr, bool label);
+bool    dir_ask_sysop_to_create_appendable_volume(DCR *dcr);
+bool    dir_ask_sysop_to_mount_volume(DCR *dcr);
+bool    dir_update_file_attributes(DCR *dcr, DEV_RECORD *rec);
+bool    dir_send_job_status(JCR *jcr);
+bool    dir_create_jobmedia_record(DCR *dcr);
+bool    dir_update_device(JCR *jcr, DEVICE *dev);
+bool    dir_update_changer(JCR *jcr, AUTOCHANGER *changer);
 
 /* authenticate.c */
-int    authenticate_director(JCR *jcr);
-int    authenticate_filed(JCR *jcr);
+int     authenticate_director(JCR *jcr);
+int     authenticate_filed(JCR *jcr);
 
 /* From autochanger.c */
-int     autoload_device(DCR *dcr, int writing, BSOCK *dir);
-bool    autochanger_list(DCR *dcr, BSOCK *dir);
-void    mark_volume_not_inchanger(DCR *dcr);
-char   *edit_device_codes(DCR *dcr, char *omsg, const char *cmd);
+int      autoload_device(DCR *dcr, int writing, BSOCK *dir);
+bool     autochanger_list(DCR *dcr, BSOCK *dir);
+void     mark_volume_not_inchanger(DCR *dcr);
+char    *edit_device_codes(DCR *dcr, char *omsg, const char *cmd);
 
 /* From block.c */
-void   dump_block(DEV_BLOCK *b, const char *msg);
+void    dump_block(DEV_BLOCK *b, const char *msg);
 DEV_BLOCK *new_block(DEVICE *dev);
 DEV_BLOCK *dup_block(DEV_BLOCK *eblock);
-void   init_block_write(DEV_BLOCK *block);
-void   empty_block(DEV_BLOCK *block);
-void   free_block(DEV_BLOCK *block);
-bool   write_block_to_device(DCR *dcr);
-bool   write_block_to_dev(DCR *dcr);
-void   print_block_read_errors(JCR *jcr, DEV_BLOCK *block);
-void   ser_block_header(DEV_BLOCK *block);
+void    init_block_write(DEV_BLOCK *block);
+void    empty_block(DEV_BLOCK *block);
+void    free_block(DEV_BLOCK *block);
+bool    write_block_to_device(DCR *dcr);
+bool    write_block_to_dev(DCR *dcr);
+void    print_block_read_errors(JCR *jcr, DEV_BLOCK *block);
+void    ser_block_header(DEV_BLOCK *block);
 
 #define CHECK_BLOCK_NUMBERS    true
 #define NO_BLOCK_NUMBER_CHECK  false
-bool   read_block_from_device(DCR *dcr, bool check_block_numbers);
-bool   read_block_from_dev(DCR *dcr, bool check_block_numbers);
+bool    read_block_from_device(DCR *dcr, bool check_block_numbers);
+bool    read_block_from_dev(DCR *dcr, bool check_block_numbers);
 
 /* From butil.c -- utilities for SD tool programs */
-void   print_ls_output(const char *fname, const char *link, int type, struct stat *statp);
+void    print_ls_output(const char *fname, const char *link, int type, struct stat *statp);
 JCR    *setup_jcr(const char *name, char *dev_name, BSR *bsr,
-                 const char *VolumeName, int mode);
-void   display_tape_error_status(JCR *jcr, DEVICE *dev);
+                  const char *VolumeName, int mode);
+void    display_tape_error_status(JCR *jcr, DEVICE *dev);
 
 
 /* From dev.c */
-DEVICE *init_dev(JCR *jcr, DEVICE *dev, DEVRES *device);
-int     open_dev(DEVICE *dev, char *VolName, int mode);
-off_t   lseek_dev(DEVICE *dev, off_t offset, int whence);
-int     open_first_part(DEVICE *dev);
-int     open_next_part(DEVICE *dev);
-int     open_guess_name_dev(DEVICE *dev);
-void    close_dev(DEVICE *dev);
-void    force_close_dev(DEVICE *dev);
-bool    truncate_dev(DEVICE *dev);
-void    term_dev(DEVICE *dev);
-char *  strerror_dev(DEVICE *dev);
-void    clrerror_dev(DEVICE *dev, int func);
-bool    update_pos_dev(DEVICE *dev);
-bool    rewind_dev(DEVICE *dev);
-bool    load_dev(DEVICE *dev);
-bool    offline_dev(DEVICE *dev);
-int     flush_dev(DEVICE *dev);
-int     weof_dev(DEVICE *dev, int num);
-int     write_block(DEVICE *dev);
+DEVICE  *init_dev(JCR *jcr, DEVICE *dev, DEVRES *device);
+int      open_dev(DEVICE *dev, char *VolName, int mode);
+off_t    lseek_dev(DEVICE *dev, off_t offset, int whence);
+int      open_first_part(DEVICE *dev);
+int      open_next_part(DEVICE *dev);
+int      open_guess_name_dev(DEVICE *dev);
+void     close_dev(DEVICE *dev);
+void     force_close_dev(DEVICE *dev);
+bool     truncate_dev(DEVICE *dev);
+void     term_dev(DEVICE *dev);
+char *   strerror_dev(DEVICE *dev);
+void     clrerror_dev(DEVICE *dev, int func);
+bool     update_pos_dev(DEVICE *dev);
+bool     rewind_dev(DEVICE *dev);
+bool     load_dev(DEVICE *dev);
+bool     offline_dev(DEVICE *dev);
+int      flush_dev(DEVICE *dev);
+int      weof_dev(DEVICE *dev, int num);
+int      write_block(DEVICE *dev);
 uint32_t status_dev(DEVICE *dev);
-int     eod_dev(DEVICE *dev);
-bool    fsf_dev(DEVICE *dev, int num);
-bool    fsr_dev(DEVICE *dev, int num);
-bool    bsf_dev(DEVICE *dev, int num);
-bool    bsr_dev(DEVICE *dev, int num);
-void    attach_jcr_to_device(DEVICE *dev, JCR *jcr);
-void    detach_jcr_from_device(DEVICE *dev, JCR *jcr);
-JCR    *next_attached_jcr(DEVICE *dev, JCR *jcr);
-bool    dev_can_write(DEVICE *dev);
-bool    offline_or_rewind_dev(DEVICE *dev);
-bool    reposition_dev(DEVICE *dev, uint32_t file, uint32_t block);
-void    init_dev_wait_timers(DEVICE *dev);
-bool    double_dev_wait_time(DEVICE *dev);
+int      eod_dev(DEVICE *dev);
+bool     fsf_dev(DEVICE *dev, int num);
+bool     fsr_dev(DEVICE *dev, int num);
+bool     bsf_dev(DEVICE *dev, int num);
+bool     bsr_dev(DEVICE *dev, int num);
+void     attach_jcr_to_device(DEVICE *dev, JCR *jcr);
+void     detach_jcr_from_device(DEVICE *dev, JCR *jcr);
+JCR     *next_attached_jcr(DEVICE *dev, JCR *jcr);
+bool     dev_can_write(DEVICE *dev);
+bool     offline_or_rewind_dev(DEVICE *dev);
+bool     reposition_dev(DEVICE *dev, uint32_t file, uint32_t block);
+void     init_dev_wait_timers(DEVICE *dev);
+bool     double_dev_wait_time(DEVICE *dev);
 
 /* Get info about device */
-char *  dev_name(DEVICE *dev);
-char *  dev_vol_name(DEVICE *dev);
+char *   dev_vol_name(DEVICE *dev);
 uint32_t dev_block(DEVICE *dev);
 uint32_t dev_file(DEVICE *dev);
-bool    dev_is_tape(DEVICE *dev);
+bool     dev_is_tape(DEVICE *dev);
 
 /* From device.c */
-bool    open_device(DCR *dcr);
-bool    first_open_device(DEVICE *dev);
-bool    fixup_device_block_write_error(DCR *dcr);
-void    _lock_device(const char *file, int line, DEVICE *dev);
-void    _unlock_device(const char *file, int line, DEVICE *dev);
-void    _block_device(const char *file, int line, DEVICE *dev, int state);
-void    _unblock_device(const char *file, int line, DEVICE *dev);
-void    _steal_device_lock(const char *file, int line, DEVICE *dev, bsteal_lock_t *hold, int state);
-void    _give_back_device_lock(const char *file, int line, DEVICE *dev, bsteal_lock_t *hold);
-void    set_new_volume_parameters(DCR *dcr);
-void    set_new_file_parameters(DCR *dcr);
-bool    device_is_unmounted(DEVICE *dev);
-void    dev_lock(DEVICE *dev);
-void    dev_unlock(DEVICE *dev);
+bool     open_device(DCR *dcr);
+bool     first_open_device(DEVICE *dev);
+bool     fixup_device_block_write_error(DCR *dcr);
+void     _lock_device(const char *file, int line, DEVICE *dev);
+void     _unlock_device(const char *file, int line, DEVICE *dev);
+void     _block_device(const char *file, int line, DEVICE *dev, int state);
+void     _unblock_device(const char *file, int line, DEVICE *dev);
+void     _steal_device_lock(const char *file, int line, DEVICE *dev, bsteal_lock_t *hold, int state);
+void     _give_back_device_lock(const char *file, int line, DEVICE *dev, bsteal_lock_t *hold);
+void     set_new_volume_parameters(DCR *dcr);
+void     set_new_file_parameters(DCR *dcr);
+bool     device_is_unmounted(DEVICE *dev);
+void     dev_lock(DEVICE *dev);
+void     dev_unlock(DEVICE *dev);
 const char *edit_blocked_reason(DEVICE *dev);
 
 /* From dircmd.c */
-void    *handle_connection_request(void *arg);
+void     *handle_connection_request(void *arg);
 
 
 /* From fd_cmds.c */
-void    run_job(JCR *jcr);
-bool    bootstrap_cmd(JCR *jcr);
+void     run_job(JCR *jcr);
+bool     bootstrap_cmd(JCR *jcr);
 
 /* From job.c */
-void    stored_free_jcr(JCR *jcr);
-void    connection_from_filed(void *arg);
-void    handle_filed_connection(BSOCK *fd, char *job_name);
+void     stored_free_jcr(JCR *jcr);
+void     connection_from_filed(void *arg);
+void     handle_filed_connection(BSOCK *fd, char *job_name);
 
 /* From label.c */
-int     read_dev_volume_label(DCR *dcr);
-int     read_dev_volume_label_guess(DCR *dcr, bool write);
-void    create_session_label(DCR *dcr, DEV_RECORD *rec, int label);
-void    create_volume_label(DEVICE *dev, const char *VolName, const char *PoolName);
-bool    write_new_volume_label_to_dev(DCR *dcr, const char *VolName, const char *PoolName);
-bool    write_ansi_ibm_label(DCR *dcr, const char *VolName);
-int     read_ansi_ibm_label(DCR *dcr);
-bool    write_session_label(DCR *dcr, int label);
-bool    write_volume_label_to_block(DCR *dcr);
-bool    rewrite_volume_label(DCR *dcr, bool recycle);
-void    dump_volume_label(DEVICE *dev);
-void    dump_label_record(DEVICE *dev, DEV_RECORD *rec, int verbose);
-bool    unser_volume_label(DEVICE *dev, DEV_RECORD *rec);
-bool    unser_session_label(SESSION_LABEL *label, DEV_RECORD *rec);
+int      read_dev_volume_label(DCR *dcr);
+int      read_dev_volume_label_guess(DCR *dcr, bool write);
+void     create_session_label(DCR *dcr, DEV_RECORD *rec, int label);
+void     create_volume_label(DEVICE *dev, const char *VolName, const char *PoolName);
+bool     write_new_volume_label_to_dev(DCR *dcr, const char *VolName, const char *PoolName);
+bool     write_ansi_ibm_label(DCR *dcr, const char *VolName);
+int      read_ansi_ibm_label(DCR *dcr);
+bool     write_session_label(DCR *dcr, int label);
+bool     write_volume_label_to_block(DCR *dcr);
+bool     rewrite_volume_label(DCR *dcr, bool recycle);
+void     dump_volume_label(DEVICE *dev);
+void     dump_label_record(DEVICE *dev, DEV_RECORD *rec, int verbose);
+bool     unser_volume_label(DEVICE *dev, DEV_RECORD *rec);
+bool     unser_session_label(SESSION_LABEL *label, DEV_RECORD *rec);
 
 /* From match_bsr.c */
-int     match_bsr(BSR *bsr, DEV_RECORD *rec, VOLUME_LABEL *volrec,
-             SESSION_LABEL *sesrec);
-int     match_bsr_block(BSR *bsr, DEV_BLOCK *block);
-void    position_bsr_block(BSR *bsr, DEV_BLOCK *block);
-BSR    *find_next_bsr(BSR *root_bsr, DEVICE *dev);
-bool    match_set_eof(BSR *bsr, DEV_RECORD *rec);
+int      match_bsr(BSR *bsr, DEV_RECORD *rec, VOLUME_LABEL *volrec,
+              SESSION_LABEL *sesrec);
+int      match_bsr_block(BSR *bsr, DEV_BLOCK *block);
+void     position_bsr_block(BSR *bsr, DEV_BLOCK *block);
+BSR     *find_next_bsr(BSR *root_bsr, DEVICE *dev);
+bool     match_set_eof(BSR *bsr, DEV_RECORD *rec);
 
 /* From mount.c */
-bool    mount_next_write_volume(DCR *dcr, bool release);
-bool    mount_next_read_volume(DCR *dcr);
-void    release_volume(DCR *ddr);
-void    mark_volume_in_error(DCR *dcr);
+bool     mount_next_write_volume(DCR *dcr, bool release);
+bool     mount_next_read_volume(DCR *dcr);
+void     release_volume(DCR *ddr);
+void     mark_volume_in_error(DCR *dcr);
 
 /* From parse_bsr.c */
-BSR    *parse_bsr(JCR *jcr, char *lf);
-void    dump_bsr(BSR *bsr, bool recurse);
-void    free_bsr(BSR *bsr);
+BSR     *parse_bsr(JCR *jcr, char *lf);
+void     dump_bsr(BSR *bsr, bool recurse);
+void     free_bsr(BSR *bsr);
 VOL_LIST *new_vol();
-int     add_vol(JCR *jcr, VOL_LIST *vol);
-void    free_vol_list(JCR *jcr);
-void    create_vol_list(JCR *jcr);
+int      add_vol(JCR *jcr, VOL_LIST *vol);
+void     free_vol_list(JCR *jcr);
+void     create_vol_list(JCR *jcr);
 
 /* From record.c */
 const char *FI_to_ascii(int fi);
 const char *stream_to_ascii(int stream, int fi);
-bool       write_record_to_block(DEV_BLOCK *block, DEV_RECORD *rec);
-bool       can_write_record_to_block(DEV_BLOCK *block, DEV_RECORD *rec);
-bool       read_record_from_block(DEV_BLOCK *block, DEV_RECORD *rec);
+bool        write_record_to_block(DEV_BLOCK *block, DEV_RECORD *rec);
+bool        can_write_record_to_block(DEV_BLOCK *block, DEV_RECORD *rec);
+bool        read_record_from_block(DEV_BLOCK *block, DEV_RECORD *rec);
 DEV_RECORD *new_record();
-void       free_record(DEV_RECORD *rec);
-void       empty_record(DEV_RECORD *rec);
+void        free_record(DEV_RECORD *rec);
+void        empty_record(DEV_RECORD *rec);
 
 /* From read_record.c */
 bool read_records(DCR *dcr,
@@ -213,12 +212,12 @@ bool read_records(DCR *dcr,
        bool mount_cb(DCR *dcr));
 
 /* From spool.c */
-bool   begin_data_spool          (DCR *dcr);
-bool   discard_data_spool        (DCR *dcr);
-bool   commit_data_spool         (DCR *dcr);
-bool   are_attributes_spooled    (JCR *jcr);
-bool   begin_attribute_spool     (JCR *jcr);
-bool   discard_attribute_spool   (JCR *jcr);
-bool   commit_attribute_spool    (JCR *jcr);
-bool   write_block_to_spool_file (DCR *dcr);
-void   list_spool_stats          (BSOCK *bs);
+bool    begin_data_spool          (DCR *dcr);
+bool    discard_data_spool        (DCR *dcr);
+bool    commit_data_spool         (DCR *dcr);
+bool    are_attributes_spooled    (JCR *jcr);
+bool    begin_attribute_spool     (JCR *jcr);
+bool    discard_attribute_spool   (JCR *jcr);
+bool    commit_attribute_spool    (JCR *jcr);
+bool    write_block_to_spool_file (DCR *dcr);
+void    list_spool_stats          (BSOCK *bs);
index bd50623332eaa79f1104395fd7ced1db57eff8c5..bfecbc4e7eb276230bb9fdea698ca9db2781f3b7 100644 (file)
@@ -68,7 +68,7 @@ bool read_records(DCR *dcr,
            DEV_RECORD *trec = new_record();
 
             Jmsg(jcr, M_INFO, 0, "End of Volume at file %u on device %s, Volume \"%s\"\n",
-                dev->file, dev_name(dev), dcr->VolumeName);
+                dev->file, dev->print_name(), dcr->VolumeName);
            if (!mount_cb(dcr)) {
                Jmsg(jcr, M_INFO, 0, "End of all volumes.\n");
               ok = false;
@@ -100,10 +100,10 @@ bool read_records(DCR *dcr,
         } else if (dev->at_eof()) {
            if (verbose) {
                Jmsg(jcr, M_INFO, 0, "Got EOF at file %u  on device %s, Volume \"%s\"\n",
-                 dev->file, dev_name(dev), dcr->VolumeName);
+                 dev->file, dev->print_name(), dcr->VolumeName);
            }
             Dmsg3(200, "Got EOF at file %u  on device %s, Volume \"%s\"\n",
-                 dev->file, dev_name(dev), dcr->VolumeName);
+                 dev->file, dev->print_name(), dcr->VolumeName);
            continue;
         } else if (dev_state(dev, ST_SHORT)) {
             Jmsg1(jcr, M_ERROR, 0, "%s", dev->errmsg);
index 679a101a89b91710c2d189b61014668a9fc6568a..adc31aba44b0450194c05769e2846f1d17aac7d0 100644 (file)
@@ -100,11 +100,11 @@ bool status_cmd(JCR *jcr)
       dev = device->dev;
       if (dev && dev->is_open()) {
         if (dev->is_labeled()) {
-            bnet_fsend(user, _("Device \"%s\" (%s) is mounted with Volume \"%s\"\n"),
-              dev->name(), dev->archive_name(), dev->VolHdr.VolName);
+            bnet_fsend(user, _("Device %s is mounted with Volume \"%s\"\n"),
+              dev->print_name(), dev->VolHdr.VolName);
         } else {
-            bnet_fsend(user, _("Device \"%s\" (%s) open but no Bacula volume is mounted.\n"), 
-              dev->name(), dev->archive_name());
+            bnet_fsend(user, _("Device %s open but no Bacula volume is mounted.\n"), 
+              dev->print_name());
         }
         send_blocked_status(jcr, dev);
         if (dev->can_append()) {