From: Kern Sibbald Date: Wed, 3 Sep 2008 19:13:35 +0000 (+0000) Subject: kes Add Slot if it is non-zero to writing bsr file after a X-Git-Tag: Release-3.0.0~1020 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=35a2b2f6c0740960829abcabda248ebb2aae2919;p=bacula%2Fbacula kes Add Slot if it is non-zero to writing bsr file after a backup. kes Change a number of bnet_fsend() into class method calls. kes Begin audit of 2.4 branch to trunk code changes git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@7553 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/src/dird/backup.c b/bacula/src/dird/backup.c index ae3ee7e88e..5219780c41 100644 --- a/bacula/src/dird/backup.c +++ b/bacula/src/dird/backup.c @@ -651,6 +651,9 @@ void update_bootstrap_file(JCR *jcr) /* Write the record */ fprintf(fd, "Volume=\"%s\"\n", VolParams[i].VolumeName); fprintf(fd, "MediaType=\"%s\"\n", VolParams[i].MediaType); + if (VolParams[i].Slot > 0) { + fprintf(fd, "Slot=%d\n", VolParams[i].Slot); + } fprintf(fd, "VolSessionId=%u\n", jcr->VolSessionId); fprintf(fd, "VolSessionTime=%u\n", jcr->VolSessionTime); fprintf(fd, "VolFile=%u-%u\n", VolParams[i].StartFile, diff --git a/bacula/src/dird/job.c b/bacula/src/dird/job.c index 74ec03e80c..e34eb335ec 100644 --- a/bacula/src/dird/job.c +++ b/bacula/src/dird/job.c @@ -399,12 +399,12 @@ bool cancel_job(UAContext *ua, JCR *jcr) } Dmsg0(200, "Connected to file daemon\n"); fd = ua->jcr->file_bsock; - bnet_fsend(fd, "cancel Job=%s\n", jcr->Job); - while (bnet_recv(fd) >= 0) { + fd->fsend("cancel Job=%s\n", jcr->Job); + while (fd->recv() >= 0) { ua->send_msg("%s", fd->msg); } - bnet_sig(fd, BNET_TERMINATE); - bnet_close(fd); + fd->signal(BNET_TERMINATE); + fd->close(); ua->jcr->file_bsock = NULL; } diff --git a/bacula/src/filed/job.c b/bacula/src/filed/job.c index 5025a9a32a..b685a971d4 100644 --- a/bacula/src/filed/job.c +++ b/bacula/src/filed/job.c @@ -229,7 +229,7 @@ void *handle_client_request(void *dirp) for (quit=false; !quit;) { /* Read command */ - if (bnet_recv(dir) < 0) { + if (dir->recv() < 0) { break; /* connection terminated */ } dir->msg[dir->msglen] = 0; @@ -239,14 +239,14 @@ void *handle_client_request(void *dirp) if (strncmp(cmds[i].cmd, dir->msg, strlen(cmds[i].cmd)) == 0) { found = true; /* indicate command found */ if (!jcr->authenticated && cmds[i].func != hello_cmd) { - bnet_fsend(dir, no_auth); - bnet_sig(dir, BNET_EOD); + dir->fsend(no_auth); + dir->signal(BNET_EOD); break; } if ((jcr->authenticated) && (!cmds[i].monitoraccess) && (jcr->director->monitor)) { Dmsg1(100, "Command \"%s\" is invalid.\n", cmds[i].cmd); - bnet_fsend(dir, invalid_cmd); - bnet_sig(dir, BNET_EOD); + dir->fsend(invalid_cmd); + dir->signal(BNET_EOD); break; } Dmsg1(100, "Executing %s command.\n", cmds[i].cmd); @@ -258,7 +258,7 @@ void *handle_client_request(void *dirp) } } if (!found) { /* command not found */ - bnet_fsend(dir, errmsg); + dir->fsend(errmsg); quit = true; break; } @@ -266,7 +266,7 @@ void *handle_client_request(void *dirp) /* Inform Storage daemon that we are done */ if (jcr->store_bsock) { - bnet_sig(jcr->store_bsock, BNET_TERMINATE); + jcr->store_bsock->signal(BNET_TERMINATE); } /* Run the after job */ @@ -275,7 +275,7 @@ void *handle_client_request(void *dirp) if (jcr->JobId) { /* send EndJob if running a job */ char ed1[50], ed2[50]; /* Send termination status back to Dir */ - bnet_fsend(dir, EndJob, jcr->JobStatus, jcr->JobFiles, + dir->fsend(EndJob, jcr->JobStatus, jcr->JobFiles, edit_uint64(jcr->ReadBytes, ed1), edit_uint64(jcr->JobBytes, ed2), jcr->Errors, jcr->VSS, jcr->crypto.pki_encrypt); @@ -1348,7 +1348,7 @@ static int session_cmd(JCR *jcr) return 0; } - return bnet_fsend(dir, OKsession); + return dir->fsend(OKsession); } /* @@ -1778,7 +1778,7 @@ static int open_sd_read_session(JCR *jcr) /* * Open Read Session with Storage daemon */ - bnet_fsend(sd, read_open, "DummyVolume", + sd->fsend(read_open, "DummyVolume", jcr->VolSessionId, jcr->VolSessionTime, jcr->StartFile, jcr->EndFile, jcr->StartBlock, jcr->EndBlock); Dmsg1(110, ">stored: %s", sd->msg); @@ -1805,7 +1805,7 @@ static int open_sd_read_session(JCR *jcr) /* * Start read of data with Storage daemon */ - bnet_fsend(sd, read_data, jcr->Ticket); + sd->fsend(read_data, jcr->Ticket); Dmsg1(110, ">stored: %s", sd->msg); /* @@ -1824,7 +1824,7 @@ static int open_sd_read_session(JCR *jcr) static void filed_free_jcr(JCR *jcr) { if (jcr->store_bsock) { - bnet_close(jcr->store_bsock); + jcr->store_bsock->close(); } free_bootstrap(jcr); if (jcr->last_fname) { @@ -1891,12 +1891,12 @@ static int send_bootstrap_file(JCR *jcr) goto bail_out; } sd->msglen = pm_strcpy(sd->msg, bootstrap); - bnet_send(sd); + sd->send(); while (fgets(buf, sizeof(buf), bs)) { sd->msglen = Mmsg(sd->msg, "%s", buf); - bnet_send(sd); + sd->send(); } - bnet_sig(sd, BNET_EOD); + sd->signal(BNET_EOD); fclose(bs); if (!response(jcr, sd, OKSDbootstrap, "Bootstrap")) { set_jcr_job_status(jcr, JS_ErrorTerminated); diff --git a/bacula/src/version.h b/bacula/src/version.h index 8171ec097f..0153028c76 100644 --- a/bacula/src/version.h +++ b/bacula/src/version.h @@ -4,8 +4,8 @@ #undef VERSION #define VERSION "2.5.3" -#define BDATE "30 Aug 2008" -#define LSMDATE "30Aug08" +#define BDATE "03 September 2008" +#define LSMDATE "3Sep08" #define PROG_COPYRIGHT "Copyright (C) %d-2008 Free Software Foundation Europe e.V.\n" #define BYEAR "2008" /* year for copyright messages in progs */ diff --git a/bacula/technotes-2.5 b/bacula/technotes-2.5 index 4accf9d0d3..9be8a02c8d 100644 --- a/bacula/technotes-2.5 +++ b/bacula/technotes-2.5 @@ -30,10 +30,42 @@ Add long term statistics job table *vtape driver *Ignore Dir separator in console (!$%&'()*+,-/:;<>?[]^`{|}~) -Copy jobs +*Copy jobs +examples/database/dbcheck.sql +dbi database driver + --enable-libdb + dbdriver in bacula-dir.conf +--with-db-port +support for Ubuntu +status_slots??? +spoolSize by Job??? +recyclepool in dird/ua_select.co??? +enhancement to wait command: wait mount ... +parse config +plugindirectory +dbport +dbdriver +maxrunschedtime??? +fullmaxwaittime??? +incrementalmaxwaittime??? +differentialmaxwaittime??? +fullmaxruntime??? +differentialmaxruntime??? +incrementalmaxruntime??? +optimizejobscheduling??? +spoolsize??? +usestatistics??? +pluginoptions +plugin +remove reader/writer in FOPTS???? General: +03Sep08 +kes Add Slot if it is non-zero to writing bsr file after a + backup. +kes Change a number of bnet_fsend() into class method calls. +kes Begin audit of diff of 2.4 branch to trunk code. 01Sep08 ebl Fix the mysql creation script that double-created an index of the same field on the Media table.