From: Kern Sibbald Date: Fri, 23 Apr 2004 13:05:47 +0000 (+0000) Subject: Update utilities to accept Device name X-Git-Tag: Release-1.34.3~127 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=c59dfb7b6e9679b8a36dbfff74dbc98df41ebdda;p=bacula%2Fbacula Update utilities to accept Device name git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@1272 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/ReleaseNotes b/bacula/ReleaseNotes index 7b7789ac45..ddf25a9208 100644 --- a/bacula/ReleaseNotes +++ b/bacula/ReleaseNotes @@ -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. diff --git a/bacula/kernstodo b/bacula/kernstodo index 81bafc8813..b51a173b0f 100644 --- a/bacula/kernstodo +++ b/bacula/kernstodo @@ -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 diff --git a/bacula/src/stored/acquire.c b/bacula/src/stored/acquire.c index fb95102ce2..80e6ce3af8 100644 --- a/bacula/src/stored/acquire.c +++ b/bacula/src/stored/acquire.c @@ -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; /* diff --git a/bacula/src/stored/bscan.c b/bacula/src/stored/bscan.c index dcb141e083..1e11d8560a 100644 --- a/bacula/src/stored/bscan.c +++ b/bacula/src/stored/bscan.c @@ -104,7 +104,7 @@ static void usage() { fprintf(stderr, _( "\nVersion: " VERSION " (" BDATE ")\n\n" -"Usage: bscan [-d debug_level] \n" +"Usage: bscan [ options ] \n" " -b bootstrap specify a bootstrap file\n" " -c specify configuration file\n" " -d set debug level to nn\n" diff --git a/bacula/src/stored/butil.c b/bacula/src/stored/butil.c index 7b936eccf9..4d439b5048 100644 --- a/bacula/src/stored/butil.c +++ b/bacula/src/stored/butil.c @@ -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; }