From: Kern Sibbald Date: Mon, 7 May 2007 12:39:55 +0000 (+0000) Subject: kes Implement bconsole memory command that prints current memory X-Git-Tag: Release-7.0.0~6413 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=ab54e24ec150b9593621e898207605a94f135b29;p=bacula%2Fbacula kes Implement bconsole memory command that prints current memory usage, plus smartalloc dump. kes Clarify some error messages in backup, admin, and migrate. kes Shrink label dialog to smaller size. kes Invert Cancel OK buttons on restore to be OK Cancel. kes More strerror() to bstrerror() conversions. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@4718 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/src/console/console.c b/bacula/src/console/console.c index f62b155ce9..983637a8c9 100644 --- a/bacula/src/console/console.c +++ b/bacula/src/console/console.c @@ -898,7 +898,7 @@ static int do_outputcmd(FILE *input, BSOCK *UA_sock) if (!fd) { berrno be; senditf(_("Cannot open file %s for output. ERR=%s\n"), - argk[1], be.strerror(errno)); + argk[1], be.bstrerror(errno)); return 1; } output = fd; @@ -926,7 +926,7 @@ static int execcmd(FILE *input, BSOCK *UA_sock) if (!bpipe) { berrno be; senditf(_("Cannot popen(\"%s\", \"r\"): ERR=%s\n"), - argk[1], be.strerror(errno)); + argk[1], be.bstrerror(errno)); return 1; } @@ -937,7 +937,7 @@ static int execcmd(FILE *input, BSOCK *UA_sock) if (stat != 0) { berrno be; be.set_errno(stat); - senditf(_("Autochanger error: ERR=%s\n"), be.strerror()); + senditf(_("Autochanger error: ERR=%s\n"), be.bstrerror()); } return 1; } diff --git a/bacula/src/dird/admin.c b/bacula/src/dird/admin.c index 5ccbb80dc5..2dec96b262 100644 --- a/bacula/src/dird/admin.c +++ b/bacula/src/dird/admin.c @@ -1,18 +1,7 @@ -/* - * - * Bacula Director -- admin.c -- responsible for doing admin jobs - * - * Kern Sibbald, May MMIII - * - * Basic tasks done here: - * Display the job report. - * - * Version $Id$ - */ /* Bacula® - The Network Backup Solution - Copyright (C) 2003-2006 Free Software Foundation Europe e.V. + Copyright (C) 2003-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. @@ -36,6 +25,17 @@ (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich, Switzerland, email:ftf@fsfeurope.org. */ +/* + * + * Bacula Director -- admin.c -- responsible for doing admin jobs + * + * Kern Sibbald, May MMIII + * + * Basic tasks done here: + * Display the job report. + * + * Version $Id$ + */ #include "bacula.h" #include "dird.h" @@ -86,7 +86,7 @@ void admin_cleanup(JCR *jcr, int TermCode) update_job_end(jcr, TermCode); if (!db_get_job_record(jcr, jcr->db, &jcr->jr)) { - Jmsg(jcr, M_WARNING, 0, _("Error getting job record for stats: %s"), + Jmsg(jcr, M_WARNING, 0, _("Error getting Job record for Job report: ERR=%s"), db_strerror(jcr->db)); set_jcr_job_status(jcr, JS_ErrorTerminated); } diff --git a/bacula/src/dird/backup.c b/bacula/src/dird/backup.c index 6b062a2727..294b849bf2 100644 --- a/bacula/src/dird/backup.c +++ b/bacula/src/dird/backup.c @@ -348,14 +348,14 @@ void backup_cleanup(JCR *jcr, int TermCode) update_job_end(jcr, TermCode); if (!db_get_job_record(jcr, jcr->db, &jcr->jr)) { - Jmsg(jcr, M_WARNING, 0, _("Error getting job record for stats: %s"), + Jmsg(jcr, M_WARNING, 0, _("Error getting Job record for Job report: ERR=%s"), db_strerror(jcr->db)); set_jcr_job_status(jcr, JS_ErrorTerminated); } bstrncpy(cr.Name, jcr->client->hdr.name, sizeof(cr.Name)); if (!db_get_client_record(jcr, jcr->db, &cr)) { - Jmsg(jcr, M_WARNING, 0, _("Error getting client record for stats: %s"), + Jmsg(jcr, M_WARNING, 0, _("Error getting Client record for Job report: ERR=%s"), db_strerror(jcr->db)); } diff --git a/bacula/src/dird/migrate.c b/bacula/src/dird/migrate.c index b45c9876b3..ba49810cd6 100644 --- a/bacula/src/dird/migrate.c +++ b/bacula/src/dird/migrate.c @@ -1070,7 +1070,7 @@ void migration_cleanup(JCR *jcr, int TermCode) } if (!db_get_job_record(jcr, jcr->db, &jcr->jr)) { - Jmsg(jcr, M_WARNING, 0, _("Error getting job record for stats: %s"), + Jmsg(jcr, M_WARNING, 0, _("Error getting Job record for Job report: ERR=%s"), db_strerror(jcr->db)); set_jcr_job_status(jcr, JS_ErrorTerminated); } diff --git a/bacula/src/dird/protos.h b/bacula/src/dird/protos.h index 0d34d664a4..71c4dd095b 100644 --- a/bacula/src/dird/protos.h +++ b/bacula/src/dird/protos.h @@ -254,6 +254,9 @@ int do_keyword_prompt(UAContext *ua, const char *msg, const char **list); int confirm_retention(UAContext *ua, utime_t *ret, const char *msg); bool get_level_from_name(JCR *jcr, const char *level_name); +/* ua_status.c */ +void list_dir_status_header(UAContext *ua); + /* ua_tree.c */ bool user_select_files_from_tree(TREE_CTX *tree); int insert_tree_handler(void *ctx, int num_fields, char **row); diff --git a/bacula/src/dird/ua_cmds.c b/bacula/src/dird/ua_cmds.c index 6739db320b..917910f4b8 100644 --- a/bacula/src/dird/ua_cmds.c +++ b/bacula/src/dird/ua_cmds.c @@ -47,51 +47,53 @@ extern jobq_t job_queue; /* job queue */ /* Imported functions */ -extern int status_cmd(UAContext *ua, const char *cmd); +extern int autodisplay_cmd(UAContext *ua, const char *cmd); +extern int gui_cmd(UAContext *ua, const char *cmd); +extern int label_cmd(UAContext *ua, const char *cmd); extern int list_cmd(UAContext *ua, const char *cmd); extern int llist_cmd(UAContext *ua, const char *cmd); -extern int show_cmd(UAContext *ua, const char *cmd); extern int messagescmd(UAContext *ua, const char *cmd); -extern int autodisplay_cmd(UAContext *ua, const char *cmd); -extern int gui_cmd(UAContext *ua, const char *cmd); -extern int sqlquerycmd(UAContext *ua, const char *cmd); -extern int querycmd(UAContext *ua, const char *cmd); -extern int retentioncmd(UAContext *ua, const char *cmd); extern int prunecmd(UAContext *ua, const char *cmd); extern int purgecmd(UAContext *ua, const char *cmd); -extern int restore_cmd(UAContext *ua, const char *cmd); -extern int label_cmd(UAContext *ua, const char *cmd); +extern int querycmd(UAContext *ua, const char *cmd); extern int relabel_cmd(UAContext *ua, const char *cmd); +extern int restore_cmd(UAContext *ua, const char *cmd); +extern int retentioncmd(UAContext *ua, const char *cmd); +extern int show_cmd(UAContext *ua, const char *cmd); +extern int sqlquerycmd(UAContext *ua, const char *cmd); +extern int status_cmd(UAContext *ua, const char *cmd); extern int update_cmd(UAContext *ua, const char *cmd); /* Forward referenced functions */ static int add_cmd(UAContext *ua, const char *cmd); -static int create_cmd(UAContext *ua, const char *cmd); +static int automount_cmd(UAContext *ua, const char *cmd); static int cancel_cmd(UAContext *ua, const char *cmd); -static int enable_cmd(UAContext *ua, const char *cmd); +static int create_cmd(UAContext *ua, const char *cmd); +static int delete_cmd(UAContext *ua, const char *cmd); static int disable_cmd(UAContext *ua, const char *cmd); -static int setdebug_cmd(UAContext *ua, const char *cmd); -static int trace_cmd(UAContext *ua, const char *cmd); -static int var_cmd(UAContext *ua, const char *cmd); +static int enable_cmd(UAContext *ua, const char *cmd); static int estimate_cmd(UAContext *ua, const char *cmd); static int help_cmd(UAContext *ua, const char *cmd); -static int delete_cmd(UAContext *ua, const char *cmd); -static int use_cmd(UAContext *ua, const char *cmd); -static int unmount_cmd(UAContext *ua, const char *cmd); -static int version_cmd(UAContext *ua, const char *cmd); -static int automount_cmd(UAContext *ua, const char *cmd); -static int time_cmd(UAContext *ua, const char *cmd); -static int reload_cmd(UAContext *ua, const char *cmd); -static int delete_volume(UAContext *ua); -static int delete_pool(UAContext *ua); -static void delete_job(UAContext *ua); +static int memory_cmd(UAContext *ua, const char *cmd); static int mount_cmd(UAContext *ua, const char *cmd); +static int python_cmd(UAContext *ua, const char *cmd); static int release_cmd(UAContext *ua, const char *cmd); -static int wait_cmd(UAContext *ua, const char *cmd); +static int reload_cmd(UAContext *ua, const char *cmd); +static int setdebug_cmd(UAContext *ua, const char *cmd); static int setip_cmd(UAContext *ua, const char *cmd); -static int python_cmd(UAContext *ua, const char *cmd); +static int time_cmd(UAContext *ua, const char *cmd); +static int trace_cmd(UAContext *ua, const char *cmd); +static int unmount_cmd(UAContext *ua, const char *cmd); +static int use_cmd(UAContext *ua, const char *cmd); +static int var_cmd(UAContext *ua, const char *cmd); +static int version_cmd(UAContext *ua, const char *cmd); +static int wait_cmd(UAContext *ua, const char *cmd); + static void do_job_delete(UAContext *ua, JobId_t JobId); static void delete_job_id_range(UAContext *ua, char *tok); +static int delete_volume(UAContext *ua); +static int delete_pool(UAContext *ua); +static void delete_job(UAContext *ua); int qhelp_cmd(UAContext *ua, const char *cmd); int quit_cmd(UAContext *ua, const char *cmd); @@ -114,6 +116,7 @@ static struct cmdstruct commands[] = { { NT_("list"), list_cmd, _("list [pools | jobs | jobtotals | media | files ]; from catalog")}, { NT_("label"), label_cmd, _("label a tape")}, { NT_("llist"), llist_cmd, _("full or long list like list command")}, + { NT_("memory"), memory_cmd, _("print current memory usage")}, { NT_("messages"), messagescmd, _("messages")}, { NT_("mount"), mount_cmd, _("mount ")}, { NT_("prune"), prunecmd, _("prune expired records from catalog")}, @@ -1399,6 +1402,12 @@ static int delete_pool(UAContext *ua) return 1; } +int memory_cmd(UAContext *ua, const char *cmd) +{ + list_dir_status_header(ua); + sm_dump(false); + return 1; +} static void do_mount_cmd(UAContext *ua, const char *command) { diff --git a/bacula/src/dird/ua_status.c b/bacula/src/dird/ua_status.c index 6cf7e3e8ac..7b264d28cd 100644 --- a/bacula/src/dird/ua_status.c +++ b/bacula/src/dird/ua_status.c @@ -253,7 +253,7 @@ static void do_all_status(UAContext *ua) } -static void do_director_status(UAContext *ua) +void list_dir_status_header(UAContext *ua) { char dt[MAX_TIME_LENGTH]; char b1[35], b2[35], b3[35], b4[35]; @@ -273,6 +273,11 @@ static void do_director_status(UAContext *ua) edit_uint64_with_commas(sm_max_bytes, b2), edit_uint64_with_commas(sm_buffers, b3), edit_uint64_with_commas(sm_max_buffers, b4)); +} + +static void do_director_status(UAContext *ua) +{ + list_dir_status_header(ua); /* * List scheduled Jobs diff --git a/bacula/src/findlib/attribs.c b/bacula/src/findlib/attribs.c index f04acee3b2..bbb9117911 100644 --- a/bacula/src/findlib/attribs.c +++ b/bacula/src/findlib/attribs.c @@ -432,20 +432,20 @@ bool set_attributes(JCR *jcr, ATTR *attr, BFILE *ofd) if (lchown(attr->ofname, attr->statp.st_uid, attr->statp.st_gid) < 0) { berrno be; Jmsg2(jcr, M_ERROR, 0, _("Unable to set file owner %s: ERR=%s\n"), - attr->ofname, be.strerror()); + attr->ofname, be.bstrerror()); ok = false; } } else { if (chown(attr->ofname, attr->statp.st_uid, attr->statp.st_gid) < 0) { berrno be; Jmsg2(jcr, M_ERROR, 0, _("Unable to set file owner %s: ERR=%s\n"), - attr->ofname, be.strerror()); + attr->ofname, be.bstrerror()); ok = false; } if (chmod(attr->ofname, attr->statp.st_mode) < 0) { berrno be; Jmsg2(jcr, M_ERROR, 0, _("Unable to set file modes %s: ERR=%s\n"), - attr->ofname, be.strerror()); + attr->ofname, be.bstrerror()); ok = false; } @@ -455,7 +455,7 @@ bool set_attributes(JCR *jcr, ATTR *attr, BFILE *ofd) if (utime(attr->ofname, &ut) < 0) { berrno be; Jmsg2(jcr, M_ERROR, 0, _("Unable to set file times %s: ERR=%s\n"), - attr->ofname, be.strerror()); + attr->ofname, be.bstrerror()); ok = false; } #ifdef HAVE_CHFLAGS @@ -469,7 +469,7 @@ bool set_attributes(JCR *jcr, ATTR *attr, BFILE *ofd) if (chflags(attr->ofname, attr->statp.st_flags) < 0) { berrno be; Jmsg2(jcr, M_ERROR, 0, _("Unable to set file flags %s: ERR=%s\n"), - attr->ofname, be.strerror()); + attr->ofname, be.bstrerror()); ok = false; } #endif diff --git a/bacula/src/findlib/create_file.c b/bacula/src/findlib/create_file.c index ab5b5e28b7..6f6d656aeb 100644 --- a/bacula/src/findlib/create_file.c +++ b/bacula/src/findlib/create_file.c @@ -159,7 +159,7 @@ int create_file(JCR *jcr, ATTR *attr, BFILE *bfd, int replace) if (unlink(attr->ofname) == -1) { berrno be; Qmsg(jcr, M_ERROR, 0, _("File %s already exists and could not be replaced. ERR=%s.\n"), - attr->ofname, be.strerror()); + attr->ofname, be.bstrerror()); /* Continue despite error */ } } @@ -219,7 +219,7 @@ int create_file(JCR *jcr, ATTR *attr, BFILE *bfd, int replace) berrno be; be.set_errno(bfd->berrno); Qmsg2(jcr, M_ERROR, 0, _("Could not create %s: ERR=%s\n"), - attr->ofname, be.strerror()); + attr->ofname, be.bstrerror()); return CF_ERROR; } return CF_EXTRACT; @@ -233,7 +233,7 @@ int create_file(JCR *jcr, ATTR *attr, BFILE *bfd, int replace) if (mkfifo(attr->ofname, attr->statp.st_mode) != 0 && errno != EEXIST) { berrno be; Qmsg2(jcr, M_ERROR, 0, _("Cannot make fifo %s: ERR=%s\n"), - attr->ofname, be.strerror()); + attr->ofname, be.bstrerror()); return CF_ERROR; } } else if (S_ISSOCK(attr->statp.st_mode)) { @@ -251,7 +251,7 @@ int create_file(JCR *jcr, ATTR *attr, BFILE *bfd, int replace) if (mknod(attr->ofname, attr->statp.st_mode, attr->statp.st_rdev) != 0 && errno != EEXIST) { berrno be; Qmsg2(jcr, M_ERROR, 0, _("Cannot make node %s: ERR=%s\n"), - attr->ofname, be.strerror()); + attr->ofname, be.bstrerror()); return CF_ERROR; } } @@ -280,8 +280,8 @@ int create_file(JCR *jcr, ATTR *attr, BFILE *bfd, int replace) berrno be; be.set_errno(bfd->berrno); Qmsg2(jcr, M_ERROR, 0, _("Could not open %s: ERR=%s\n"), - attr->ofname, be.strerror()); - Dmsg2(400, "Could not open %s: ERR=%s\n", attr->ofname, be.strerror()); + attr->ofname, be.bstrerror()); + Dmsg2(400, "Could not open %s: ERR=%s\n", attr->ofname, be.bstrerror()); stop_thread_timer(tid); return CF_ERROR; } @@ -296,7 +296,7 @@ int create_file(JCR *jcr, ATTR *attr, BFILE *bfd, int replace) if (symlink(attr->olname, attr->ofname) != 0 && errno != EEXIST) { berrno be; Qmsg3(jcr, M_ERROR, 0, _("Could not symlink %s -> %s: ERR=%s\n"), - attr->ofname, attr->olname, be.strerror()); + attr->ofname, attr->olname, be.bstrerror()); return CF_ERROR; } return CF_CREATED; @@ -321,26 +321,26 @@ int create_file(JCR *jcr, ATTR *attr, BFILE *bfd, int replace) /* restore original file flags even when linking failed */ if (chflags(attr->olname, s.st_flags) < 0) { Qmsg2(jcr, M_ERROR, 0, _("Could not restore file flags for file %s: ERR=%s\n"), - attr->olname, be.strerror()); + attr->olname, be.bstrerror()); } #endif /* HAVE_CHFLAGS */ Qmsg3(jcr, M_ERROR, 0, _("Could not hard link %s -> %s: ERR=%s\n"), - attr->ofname, attr->olname, be.strerror()); + attr->ofname, attr->olname, be.bstrerror()); return CF_ERROR; #ifdef HAVE_CHFLAGS } /* finally restore original file flags */ if (chflags(attr->olname, s.st_flags) < 0) { Qmsg2(jcr, M_ERROR, 0, _("Could not restore file flags for file %s: ERR=%s\n"), - attr->olname, be.strerror()); + attr->olname, be.bstrerror()); } } else { Qmsg2(jcr, M_ERROR, 0, _("Could not reset file flags for file %s: ERR=%s\n"), - attr->olname, be.strerror()); + attr->olname, be.bstrerror()); } } else { Qmsg3(jcr, M_ERROR, 0, _("Could not hard link %s -> %s: ERR=%s\n"), - attr->ofname, attr->olname, be.strerror()); + attr->ofname, attr->olname, be.bstrerror()); return CF_ERROR; } #endif /* HAVE_CHFLAGS */ @@ -377,7 +377,7 @@ int create_file(JCR *jcr, ATTR *attr, BFILE *bfd, int replace) } #endif Qmsg2(jcr, M_ERROR, 0, _("Could not open %s: ERR=%s\n"), - attr->ofname, be.strerror()); + attr->ofname, be.bstrerror()); return CF_ERROR; } return CF_EXTRACT; diff --git a/bacula/src/findlib/find_one.c b/bacula/src/findlib/find_one.c index 47b877b820..106a519a62 100644 --- a/bacula/src/findlib/find_one.c +++ b/bacula/src/findlib/find_one.c @@ -225,7 +225,7 @@ bool has_file_changed(JCR *jcr, FF_PKT *ff_pkt) if (lstat(ff_pkt->fname, &statp) != 0) { berrno be; Jmsg(jcr, M_WARNING, 0, - _("Cannot stat file %s: ERR=%s\n"),ff_pkt->fname,be.strerror()); + _("Cannot stat file %s: ERR=%s\n"),ff_pkt->fname,be.bstrerror()); return true; } diff --git a/bacula/src/findlib/makepath.c b/bacula/src/findlib/makepath.c index 4b292e828f..c995277fbe 100644 --- a/bacula/src/findlib/makepath.c +++ b/bacula/src/findlib/makepath.c @@ -142,7 +142,7 @@ make_dir(JCR *jcr, const char *dir, const char *dirpath, mode_t mode, int *creat berrno be; be.set_errno(save_errno); Jmsg(jcr, M_ERROR, 0, _("Cannot create directory %s: ERR=%s\n"), - dirpath, be.strerror()); + dirpath, be.bstrerror()); fail = 1; } else if (!S_ISDIR(stats.st_mode)) { Jmsg(jcr, M_ERROR, 0, _("%s exists but is not a directory\n"), quote(dirpath)); @@ -322,7 +322,7 @@ make_path( /* Note, if we are restoring as NON-root, this may not be fatal */ berrno be; Jmsg(jcr, M_ERROR, 0, _("Cannot change owner and/or group of %s: ERR=%s\n"), - quote(dirpath), be.strerror()); + quote(dirpath), be.bstrerror()); } Dmsg0(300, "Chown done.\n"); @@ -343,7 +343,7 @@ make_path( if (cwd.do_chdir && chdir(basename_dir) < 0) { berrno be; Jmsg(jcr, M_ERROR, 0, _("Cannot chdir to directory, %s: ERR=%s\n"), - quote(dirpath), be.strerror()); + quote(dirpath), be.bstrerror()); umask(oldmask); cleanup(&cwd); return 1; @@ -383,7 +383,7 @@ make_path( { berrno be; Jmsg(jcr, M_WARNING, 0, _("Cannot change owner and/or group of %s: ERR=%s\n"), - quote(dirpath), be.strerror()); + quote(dirpath), be.bstrerror()); } } @@ -398,7 +398,7 @@ make_path( if ((mode & ~S_IRWXUGO) && chmod(basename_dir, mode)) { berrno be; Jmsg(jcr, M_WARNING, 0, _("Cannot change permissions of %s: ERR=%s\n"), - quote(dirpath), be.strerror()); + quote(dirpath), be.bstrerror()); } if (cleanup(&cwd)) { @@ -414,7 +414,7 @@ make_path( if (chmod(dirpath, parent_mode)) { berrno be; Jmsg(jcr, M_WARNING, 0, _("Cannot change permissions of %s: ERR=%s\n"), - quote(dirpath), be.strerror()); + quote(dirpath), be.bstrerror()); } } } else { @@ -443,12 +443,12 @@ make_path( ) { berrno be; Jmsg(jcr, M_WARNING, 0, _("Cannot change owner and/or group of %s: ERR=%s\n"), - quote(dirpath), be.strerror()); + quote(dirpath), be.bstrerror()); } if (chmod(dirpath, mode)) { berrno be; Jmsg(jcr, M_WARNING, 0, _("Cannot change permissions of %s: ERR=%s\n"), - quote(dirpath), be.strerror()); + quote(dirpath), be.bstrerror()); } Dmsg2(300, "pathexists chmod mode=%o dir=%s\n", mode, dirpath); } diff --git a/bacula/src/findlib/save-cwd.c b/bacula/src/findlib/save-cwd.c index 3550801402..9601e35d9c 100644 --- a/bacula/src/findlib/save-cwd.c +++ b/bacula/src/findlib/save-cwd.c @@ -74,7 +74,7 @@ save_cwd(struct saved_cwd *cwd) cwd->desc = open(".", O_RDONLY); if (cwd->desc < 0) { berrno be; - Emsg1(M_ERROR, 0, _("Cannot open current directory: %s\n"), be.strerror()); + Emsg1(M_ERROR, 0, _("Cannot open current directory: %s\n"), be.bstrerror()); return 1; } @@ -88,7 +88,7 @@ save_cwd(struct saved_cwd *cwd) have_working_fchdir = 0; } else { berrno be; - Emsg1(M_ERROR, 0, _("Current directory: %s\n"), be.strerror()); + Emsg1(M_ERROR, 0, _("Current directory: %s\n"), be.bstrerror()); close(cwd->desc); cwd->desc = -1; return 1; @@ -110,7 +110,7 @@ save_cwd(struct saved_cwd *cwd) cwd->name = (POOLMEM *)getcwd(buf, sizeof_pool_memory(buf)); if (cwd->name == NULL) { berrno be; - Emsg1(M_ERROR, 0, _("Cannot get current directory: %s\n"), be.strerror()); + Emsg1(M_ERROR, 0, _("Cannot get current directory: %s\n"), be.bstrerror()); free_pool_memory(buf); return 1; } @@ -132,28 +132,28 @@ restore_cwd(const struct saved_cwd *cwd, const char *dest, const char *from) if (from) { if (dest) { Emsg3(M_ERROR, 0, _("Cannot return to %s from %s: %s\n"), - dest, from, be.strerror()); + dest, from, be.bstrerror()); } else { Emsg2(M_ERROR, 0, _("Cannot return to saved working directory from %s: %s\n"), - from, be.strerror()); + from, be.bstrerror()); } } else { if (dest) { Emsg2(M_ERROR, 0, _("Cannot return to %s: %s\n"), - dest, be.strerror()); + dest, be.bstrerror()); } else { Emsg1(M_ERROR, 0, _("Cannot return to saved working directory: %s\n"), - be.strerror()); + be.bstrerror()); } } fail = 1; } } else if (chdir(cwd->name) < 0) { berrno be; - Emsg2(M_ERROR, 0, "%s: %s\n", cwd->name, be.strerror()); + Emsg2(M_ERROR, 0, "%s: %s\n", cwd->name, be.bstrerror()); fail = 1; } return fail; diff --git a/bacula/src/qt-console/fileset/fileset.cpp b/bacula/src/qt-console/fileset/fileset.cpp index 6a92c31fa8..567ca77b81 100644 --- a/bacula/src/qt-console/fileset/fileset.cpp +++ b/bacula/src/qt-console/fileset/fileset.cpp @@ -64,6 +64,8 @@ void FileSet::populateTree() { QTreeWidgetItem *filesetItem, *topItem; + + Dmsg0(000, "Populate fileset tree called.\n"); m_checkcurwidget = false; mp_treeWidget->clear(); m_checkcurwidget = true; @@ -81,7 +83,7 @@ void FileSet::populateTree() /* This could be a log item */ //printf("In FileSet::populateTree()\n"); - foreach(QString filesetName, m_console->fileset_list){ + foreach(QString filesetName, m_console->fileset_list) { filesetItem = new QTreeWidgetItem(topItem); filesetItem->setText(0, filesetName); filesetItem->setData(0, Qt::UserRole, 1); @@ -134,10 +136,10 @@ void FileSet::populateTree() */ void FileSet::PgSeltreeWidgetClicked() { - if(!m_populated) { + if (!m_populated) { populateTree(); createContextMenu(); - m_populated=true; + m_populated = true; } } @@ -145,14 +147,15 @@ void FileSet::PgSeltreeWidgetClicked() * Added to set the context menu policy based on currently active treeWidgetItem * signaled by currentItemChanged */ -void FileSet::treeItemChanged(QTreeWidgetItem *currentwidgetitem, QTreeWidgetItem *previouswidgetitem ) +void FileSet::treeItemChanged(QTreeWidgetItem *currentwidgetitem, + QTreeWidgetItem *previouswidgetitem ) { /* m_checkcurwidget checks to see if this is during a refresh, which will segfault */ if (m_checkcurwidget) { /* The Previous item */ if (previouswidgetitem) { /* avoid a segfault if first time */ int treedepth = previouswidgetitem->data(0, Qt::UserRole).toInt(); - if (treedepth == 1){ + if (treedepth == 1) { mp_treeWidget->removeAction(actionStatusFileSetInConsole); } } diff --git a/bacula/src/qt-console/label/label.ui b/bacula/src/qt-console/label/label.ui index cc245bd957..ed81225c89 100644 --- a/bacula/src/qt-console/label/label.ui +++ b/bacula/src/qt-console/label/label.ui @@ -25,7 +25,7 @@ Qt::Vertical - QSizePolicy::Maximum + QSizePolicy::Expanding @@ -229,7 +229,7 @@ p, li { white-space: pre-wrap; } Qt::Vertical - QSizePolicy::Maximum + QSizePolicy::Expanding diff --git a/bacula/src/qt-console/restore/restore.ui b/bacula/src/qt-console/restore/restore.ui index e890eb8f3f..a20984e33d 100644 --- a/bacula/src/qt-console/restore/restore.ui +++ b/bacula/src/qt-console/restore/restore.ui @@ -422,16 +422,16 @@ - + - Cancel + OK - + - OK + Cancel diff --git a/bacula/src/qt-console/run/runcmd.cpp b/bacula/src/qt-console/run/runcmd.cpp index e1f70c93a8..a7c516b027 100644 --- a/bacula/src/qt-console/run/runcmd.cpp +++ b/bacula/src/qt-console/run/runcmd.cpp @@ -31,7 +31,9 @@ * * This is called when a Run Command signal is received from the * Director. We parse the Director's output and throw up a - * dialog box. + * dialog box. This happens, for example, after the user finishes + * selecting files to be restored. The Director will then submit a + * run command, that causes this page to be popped up. * * Kern Sibbald, March MMVII * diff --git a/bacula/src/stored/askdir.c b/bacula/src/stored/askdir.c index d64ab163b7..8a60555b36 100644 --- a/bacula/src/stored/askdir.c +++ b/bacula/src/stored/askdir.c @@ -571,8 +571,16 @@ bool dir_ask_sysop_to_mount_volume(DCR *dcr) * Otherwise skip it. */ if (!dev->poll && (stat == W_TIMEOUT || stat == W_MOUNT)) { - Jmsg(jcr, M_MOUNT, 0, _("Please mount Volume \"%s\" on Storage Device %s for Job %s\n"), - dcr->VolumeName, dev->print_name(), jcr->Job); + Jmsg(jcr, M_MOUNT, 0, _("Please mount Volume \"%s\" or label a new one for:\n" + " Job: %s\n" + " Storage: %s\n" + " Media type: %s\n" + " Pool: %s\n"), + dcr->VolumeName, + jcr->Job, + dev->print_name(), + dcr->media_type, + dcr->pool_name); Dmsg3(400, "Mount \"%s\" on device \"%s\" for Job %s\n", dcr->VolumeName, dev->print_name(), jcr->Job); } diff --git a/bacula/src/stored/block.c b/bacula/src/stored/block.c index db36345cf3..2db124e5ba 100644 --- a/bacula/src/stored/block.c +++ b/bacula/src/stored/block.c @@ -1081,11 +1081,6 @@ reread: dev->VolCatInfo.VolCatReads++; dev->VolCatInfo.VolCatRBytes += block->read_len; - dev->VolCatInfo.VolCatBytes += block->block_len; - dev->VolCatInfo.VolCatBlocks++; - if (dev->VolCatInfo.VolFirstWritten == 0) { - dev->VolCatInfo.VolFirstWritten = (utime_t)time(NULL); /* Set first written time */ - } dev->EndBlock = dev->block_num; dev->EndFile = dev->file; dev->block_num++; diff --git a/bacula/src/stored/mount.c b/bacula/src/stored/mount.c index 9d542b98f4..f88867f362 100644 --- a/bacula/src/stored/mount.c +++ b/bacula/src/stored/mount.c @@ -387,7 +387,7 @@ read_volume: " part=%d size=%s\n"), dcr->VolumeName, dev->part, edit_uint64(dev->VolCatInfo.VolCatBytes,ed1)); } else { - Jmsg(jcr, M_ERROR, 0, _("I cannot write on DVD Volume \"%s\" because: " + Jmsg(jcr, M_ERROR, 0, _("Bacula cannot write on DVD Volume \"%s\" because: " "The sizes do not match! Volume=%s Catalog=%s\n"), dcr->VolumeName, edit_uint64(dev->part_start + dev->part_size, ed1), @@ -404,7 +404,7 @@ read_volume: Jmsg(jcr, M_INFO, 0, _("Ready to append to end of Volume \"%s\" at file=%d.\n"), dcr->VolumeName, dev->get_file()); } else { - Jmsg(jcr, M_ERROR, 0, _("I cannot write on tape Volume \"%s\" because:\n" + Jmsg(jcr, M_ERROR, 0, _("Bacula cannot write on tape Volume \"%s\" because:\n" "The number of files mismatch! Volume=%u Catalog=%u\n"), dcr->VolumeName, dev->get_file(), dev->VolCatInfo.VolCatFiles); mark_volume_in_error(dcr); @@ -419,7 +419,7 @@ read_volume: " size=%s\n"), dcr->VolumeName, edit_uint64(dev->VolCatInfo.VolCatBytes, ed1)); } else { - Jmsg(jcr, M_ERROR, 0, _("I cannot write on disk Volume \"%s\" because: " + Jmsg(jcr, M_ERROR, 0, _("Bacula cannot write on disk Volume \"%s\" because: " "The sizes do not match! Volume=%s Catalog=%s\n"), dcr->VolumeName, edit_uint64(pos, ed1), @@ -453,9 +453,9 @@ read_volume: dcr->VolumeName, (unsigned int)dev->file_addr); } else { - Jmsg(jcr, M_ERROR, 0, _("I cannot write on Volume \"%s\" because:\n" + Jmsg(jcr, M_ERROR, 0, _("Bacula cannot write on Volume \"%s\" because:\n" "The EOD file address is wrong: Volume file address=%u != Catalog Endblock=%u(+1)\n" - "You probably removed DVD last part in spool directory.\n"), + "Perhaps You removed the DVD last part in spool directory.\n"), dcr->VolumeName, (unsigned int)dev->file_addr, (unsigned int)dev->VolCatInfo.EndBlock); mark_volume_in_error(dcr); goto mount_next_vol; diff --git a/bacula/technotes-2.1 b/bacula/technotes-2.1 index 567acd443c..3300a15d49 100644 --- a/bacula/technotes-2.1 +++ b/bacula/technotes-2.1 @@ -1,6 +1,13 @@ Technical notes on version 2.1 General: +07May07 +kes Implement bconsole memory command that prints current memory + usage, plus smartalloc dump. +kes Clarify some error messages in backup, admin, and migrate. +kes Shrink label dialog to smaller size. +kes Invert Cancel OK buttons on restore to be OK Cancel. +kes More strerror() to bstrerror() conversions. 06May07 kes Start implementing bstrerror() in place of strerror(). kes First cut at stripping path -- seems to work.