From: Kern Sibbald Date: Wed, 13 Sep 2006 19:15:15 +0000 (+0000) Subject: kes Apply Richard Mortimer's patches for printing an error X-Git-Tag: Release-2.0.0~452 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=77ab14c62897f5c7fbfa3538846908c75d3ea40a;p=bacula%2Fbacula kes Apply Richard Mortimer's patches for printing an error message in btape when a DVD is used, and to initialize traceback. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@3465 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/src/dird/protos.h b/bacula/src/dird/protos.h index f25fac5c78..9645cb99d3 100644 --- a/bacula/src/dird/protos.h +++ b/bacula/src/dird/protos.h @@ -176,6 +176,7 @@ void parse_ua_args(UAContext *ua); /* ua_label.c */ bool is_volume_name_legal(UAContext *ua, const char *name); int get_num_drives_from_SD(UAContext *ua); +void update_slots(UAContext *ua); /* ua_output.c */ void prtit(void *ctx, const char *msg); diff --git a/bacula/src/dird/ua_update.c b/bacula/src/dird/ua_update.c index 2eaf0617e7..29487ca394 100644 --- a/bacula/src/dird/ua_update.c +++ b/bacula/src/dird/ua_update.c @@ -25,11 +25,6 @@ #include "bacula.h" #include "dird.h" -/* Imported functions */ -void update_slots(UAContext *ua); - - - /* Forward referenced functions */ static int update_volume(UAContext *ua); static bool update_pool(UAContext *ua); diff --git a/bacula/src/stored/bcopy.c b/bacula/src/stored/bcopy.c index 930003ebd7..a086360c88 100644 --- a/bacula/src/stored/bcopy.c +++ b/bacula/src/stored/bcopy.c @@ -80,6 +80,7 @@ int main (int argc, char *argv[]) setlocale(LC_ALL, ""); bindtextdomain("bacula", LOCALEDIR); textdomain("bacula"); + init_stack_dump(); my_name_is(argc, argv, "bcopy"); init_msg(NULL, NULL); diff --git a/bacula/src/stored/bextract.c b/bacula/src/stored/bextract.c index 9c7c0de1b7..9b6c1213b2 100644 --- a/bacula/src/stored/bextract.c +++ b/bacula/src/stored/bextract.c @@ -87,6 +87,7 @@ int main (int argc, char *argv[]) setlocale(LC_ALL, ""); bindtextdomain("bacula", LOCALEDIR); textdomain("bacula"); + init_stack_dump(); working_directory = "/tmp"; my_name_is(argc, argv, "bextract"); diff --git a/bacula/src/stored/bls.c b/bacula/src/stored/bls.c index bdc20604dc..3a75cae22b 100644 --- a/bacula/src/stored/bls.c +++ b/bacula/src/stored/bls.c @@ -91,6 +91,7 @@ int main (int argc, char *argv[]) setlocale(LC_ALL, ""); bindtextdomain("bacula", LOCALEDIR); textdomain("bacula"); + init_stack_dump(); working_directory = "/tmp"; my_name_is(argc, argv, "bls"); diff --git a/bacula/src/stored/bscan.c b/bacula/src/stored/bscan.c index 85e6c15899..1a71b1825e 100644 --- a/bacula/src/stored/bscan.c +++ b/bacula/src/stored/bscan.c @@ -129,6 +129,7 @@ int main (int argc, char *argv[]) setlocale(LC_ALL, ""); bindtextdomain("bacula", LOCALEDIR); textdomain("bacula"); + init_stack_dump(); my_name_is(argc, argv, "bscan"); init_msg(NULL, NULL); diff --git a/bacula/src/stored/btape.c b/bacula/src/stored/btape.c index 10b64c4377..43c00d64d9 100644 --- a/bacula/src/stored/btape.c +++ b/bacula/src/stored/btape.c @@ -152,6 +152,7 @@ int main(int margc, char *margv[]) setlocale(LC_ALL, ""); bindtextdomain("bacula", LOCALEDIR); textdomain("bacula"); + init_stack_dump(); /* Sanity checks */ if (TAPE_BSIZE % B_DEV_BSIZE != 0 || TAPE_BSIZE / B_DEV_BSIZE == 0) { @@ -269,6 +270,16 @@ int main(int margc, char *margv[]) if (!dev) { exit(1); } + if (dev->is_dvd()) { + Pmsg0(000, _("btape does not work with DVD storage.\n")); + usage(); + exit(1); + } + if (!dev->is_tape()) { + Pmsg0(000, _("btape only works with tape storage.\n")); + usage(); + exit(1); + } dcr = jcr->dcr; if (!open_the_device()) { goto terminate; diff --git a/bacula/src/stored/reserve.c b/bacula/src/stored/reserve.c index 250bd4f7c9..a7763839bf 100644 --- a/bacula/src/stored/reserve.c +++ b/bacula/src/stored/reserve.c @@ -911,7 +911,7 @@ static int can_reserve_drive(DCR *dcr, RCTX &rctx) /* Check for prefer mounted volumes */ if (rctx.PreferMountedVols && !dev->VolHdr.VolumeName[0] && dev->is_tape()) { - Mmsg(jcr->errmsg, _("3606 JobId=%u wants mounted, but drive %s has no Volume.\n"), + Mmsg(jcr->errmsg, _("3606 JobId=%u prefers mounted drives, but drive %s has no Volume.\n"), jcr->JobId, dev->print_name()); queue_reserve_message(jcr); Dmsg1(110, "failed: want mounted -- no vol JobId=%u\n", jcr->JobId); @@ -1000,7 +1000,7 @@ static int can_reserve_drive(DCR *dcr, RCTX &rctx) return 1; } else { /* Drive Pool not suitable for us */ - Mmsg(jcr->errmsg, _("3609 JobId=%u wants Pool=\"%s\" but have Pool=\"%s\" on drive %s.\n"), + Mmsg(jcr->errmsg, _("3609 JobId=%u wants Pool=\"%s\" but has Pool=\"%s\" on drive %s.\n"), jcr->JobId, dcr->pool_name, dev->pool_name, dev->print_name()); queue_reserve_message(jcr); Dmsg2(110, "failed: busy num_writers>0, can_append, pool=%s wanted=%s\n", diff --git a/bacula/src/version.h b/bacula/src/version.h index b2b8a8ebc8..fadd83a787 100644 --- a/bacula/src/version.h +++ b/bacula/src/version.h @@ -4,8 +4,8 @@ #undef VERSION #define VERSION "1.39.23" -#define BDATE "12 September 2006" -#define LSMDATE "12Sep06" +#define BDATE "13 September 2006" +#define LSMDATE "13Sep06" #define BYEAR "2006" /* year for copyright messages in progs */ /* Debug flags */ diff --git a/bacula/technotes-1.39 b/bacula/technotes-1.39 index 95499379b4..28ed985244 100644 --- a/bacula/technotes-1.39 +++ b/bacula/technotes-1.39 @@ -1,6 +1,11 @@ Technical notes on version 1.39 General: +13Sep06 +kes Apply Richard Mortimer's patches for printing an error + message in btape when a DVD is used, and to initialize traceback. +kes Added error message to btape when trying to access a file. +kes Move prototype of update_slots() to protos.h. 12Sep06 kes Add JobErrors, JobFiles, SDJobFiles, SDJobErrors, SDJobStatus, and FDJobStatus to the Director Python variables.