]> git.sur5r.net Git - bacula/bacula/commitdiff
Update utilities to accept Device name
authorKern Sibbald <kern@sibbald.com>
Fri, 23 Apr 2004 13:05:47 +0000 (13:05 +0000)
committerKern Sibbald <kern@sibbald.com>
Fri, 23 Apr 2004 13:05:47 +0000 (13:05 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@1272 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/ReleaseNotes
bacula/kernstodo
bacula/src/stored/acquire.c
bacula/src/stored/bscan.c
bacula/src/stored/butil.c

index 7b7789ac456dad53db01a69facbc2418f9652c12..ddf25a9208483dd42bbeea64574e363f46ab90f8 100644 (file)
@@ -1,9 +1,20 @@
 
-          Release Notes for Bacula 1.34.1
+          Release Notes for Bacula 1.34.2
 
   Bacula code: Total files = 344 Total lines = 98,746 (*.h *.c *.in)
 
-Changes for 1.34.1:  
+Changes for 1.34.2:
+23Apr04
+- Make SD utility programs accept device name as well as archive device
+  on command line.
+- Update docs
+22Apr04
+- Fix one off bug in StartBlock in bscan -- thanks to Gregory Brauer for
+  reporting this.
+- Remove old debug code from Win32 FD.
+
+
+Release 1.34.1:  
 - Autochanger users, please note you must add %d to the end of the
   changer command line in your Device resource in your bacula-sd.conf
   file.
index 81bafc88133884b7af81c963e2e8e73dc3bcf0ac..b51a173b0f6814f557267b7d3eab3bf73950ff61 100644 (file)
@@ -38,13 +38,13 @@ For 1.33 Testing/Documentation:
   non-existent directories will not be restored properly.
 
 1.34 Cleanup
-- Add ms disk example
 - Add multiple-media-types.txt
 - look at mxt-changer.html
 
-- Why is Files Expected zero on restore from tape?
 
 For version 1.35:
+- Setup lrrd graphs: (http://www.linpro.no/projects/lrrd/) Mike Acar.
+- Revisit the question of multiple Volumes (disk) on a single device.
 - Finish SIGHUP work.
 - Check that all change in wait status in the SD are        
   signaled to the Director.
@@ -1407,3 +1407,4 @@ Block Position: 0
   job is "stuck" in the run queue.
 - Test work on conio.c -- particularly linking.
 - Complete Win32 installer
+- Add ms disk example
index fb95102ce2f935ece4a00b34b1f549e7a501a114..80e6ce3af8392d0b784ee25f0dc152c0eb4a079d 100644 (file)
@@ -204,6 +204,8 @@ default_path:
    dev->state &= ~ST_APPEND;         /* clear any previous append mode */
    dev->state |= ST_READ;            /* set read mode */
    attach_jcr_to_device(dev, jcr);    /* attach jcr to device */
+   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"),
       jcr->VolumeName, dev_name(dev));
 
@@ -330,6 +332,8 @@ DCR *acquire_device_for_append(JCR *jcr)
       jcr->NumVolumes = 1;
    }
    attach_jcr_to_device(dev, jcr);    /* attach jcr to device */
+   set_jcr_job_status(jcr, JS_Running);
+   dir_send_job_status(jcr);
    goto ok_out;
 
 /*
index dcb141e083b44a0046fca656ba02a15a44891896..1e11d8560a0f2953472f791b918b5121832da02c 100644 (file)
@@ -104,7 +104,7 @@ static void usage()
 {
    fprintf(stderr, _(
 "\nVersion: " VERSION " (" BDATE ")\n\n"
-"Usage: bscan [-d debug_level] <bacula-archive>\n"
+"Usage: bscan [ options ] <bacula-archive>\n"
 "       -b bootstrap      specify a bootstrap file\n"
 "       -c <file>         specify configuration file\n"
 "       -d <nn>           set debug level to nn\n"
index 7b936eccf90f2428bee10293e49aa05513cd9a7a..4d439b5048a49c4112c72bc34433d27816355895 100644 (file)
@@ -92,11 +92,12 @@ DEVICE *setup_to_access_device(JCR *jcr, int read_access)
    }
 
    if ((device=find_device_res(jcr->dev_name, read_access)) == NULL) {
-      Jmsg2(jcr, M_FATAL, 0, _("Cannot find device %s in config file %s.\n"), 
+      Jmsg2(jcr, M_FATAL, 0, _("Cannot find device \"%s\" in config file %s.\n"), 
           jcr->dev_name, configfile);
       return NULL;
    }
    jcr->device = device;
+   pm_strcpy(&jcr->dev_name, device->device_name);
    
    dev = init_dev(NULL, device);
    jcr->device->dev = dev;
@@ -127,23 +128,39 @@ DEVICE *setup_to_access_device(JCR *jcr, int read_access)
  */
 DEVRES *find_device_res(char *device_name, int read_access)
 {
-   int found = 0;
+   bool found = false;
    DEVRES *device;
 
    LockRes();
-   for (device=NULL; (device=(DEVRES *)GetNextRes(R_DEVICE, (RES *)device)); ) {
+   foreach_res(device, R_DEVICE) {
       if (strcmp(device->device_name, device_name) == 0) {
-        found = 1;
+        found = true;
         break;
       }
    } 
+   if (!found) {
+      /* Search for name of Device resource rather than archive name */
+      if (device_name[0] == '"') {
+        strcpy(device_name, device_name+1);
+        int len = strlen(device_name);
+        if (len > 0) {
+           device_name[len-1] = 0;
+        }
+      }
+      foreach_res(device, R_DEVICE) {
+        if (strcmp(device->hdr.name, device_name) == 0) {
+           found = true;
+           break;
+        }
+      } 
+   }
    UnlockRes();
    if (!found) {
-      Pmsg2(0, _("Could not find device %s in config file %s.\n"), device_name,
+      Pmsg2(0, _("Could not find device \"%s\" in config file %s.\n"), device_name,
            configfile);
       return NULL;
    }
-   Pmsg2(0, _("Using device: %s for %s.\n"), device_name,
+   Pmsg2(0, _("Using device: \"%s\" for %s.\n"), device_name,
              read_access?"reading":"writing");
    return device;
 }