[prev in list] [next in list] [prev in thread] [next in thread] 

List:       bacula-commits
Subject:    [Bacula-commits] git: Bacula branch, Branch-5.1,
From:       "Kern Sibbald" <kerns () users ! sourceforge ! net>
Date:       2011-02-23 12:40:50
Message-ID: E1PsE1b-00046Q-Oq () sfs-ml-2 ! v29 ! ch3 ! sourceforge ! com
[Download RAW message or body]

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Bacula".

The branch, Branch-5.1 has been updated
       via  64732ce01e39bc4d2787a84f33892ad4b03dcead (commit)
       via  5e0a0f3c0462dabe032c6df639c33d08d1ff71cb (commit)
      from  214d6945061429f90dafd358e8a9a6e0946f29fa (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 64732ce01e39bc4d2787a84f33892ad4b03dcead
Author: Kern Sibbald <kern@sibbald.com>
Date:   Wed Feb 23 13:39:18 2011 +0100

    Use jcr->setJobStatus() in favor of set_jcr_job_status(jcr...)

commit 5e0a0f3c0462dabe032c6df639c33d08d1ff71cb
Author: Kern Sibbald <kern@sibbald.com>
Date:   Wed Feb 23 12:18:51 2011 +0100

    replace set_Jobxxx by setJobxxx

-----------------------------------------------------------------------

Summary of changes:
diff --git a/bacula/src/dird/admin.c b/bacula/src/dird/admin.c
index 155a78a..fc41f78 100644
--- a/bacula/src/dird/admin.c
+++ b/bacula/src/dird/admin.c
@@ -66,7 +66,7 @@ bool do_admin(JCR *jcr)
    Jmsg(jcr, M_INFO, 0, _("Start Admin JobId %d, Job=%s\n"),
         jcr->JobId, jcr->Job);
 
-   set_jcr_job_status(jcr, JS_Running);
+   jcr->setJobStatus(JS_Running);
    admin_cleanup(jcr, JS_Terminated);
    return true;
 }
@@ -91,7 +91,7 @@ void admin_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 Job report: ERR=%s"),
          db_strerror(jcr->db));
-      set_jcr_job_status(jcr, JS_ErrorTerminated);
+      jcr->setJobStatus(JS_ErrorTerminated);
    }
 
    msg_type = M_INFO;                 /* by default INFO message */
diff --git a/bacula/src/dird/dir_plugins.c b/bacula/src/dird/dir_plugins.c
index ea6685b..2c289a3 100644
--- a/bacula/src/dird/dir_plugins.c
+++ b/bacula/src/dird/dir_plugins.c
@@ -371,7 +371,7 @@ static bRC baculaSetValue(bpContext *ctx, bwVariable var, void \
*value)  for (int i=0; ok && joblevels[i].level_name; i++) {
             if (strcasecmp(strval, joblevels[i].level_name) == 0) {
                if (joblevels[i].job_type == jcr->getJobType()) {
-                  jcr->set_JobLevel(joblevels[i].level);
+                  jcr->setJobLevel(joblevels[i].level);
                   jcr->jr.JobLevel = jcr->getJobLevel();
                   ok = false;
                }
diff --git a/bacula/src/dird/fd_cmds.c b/bacula/src/dird/fd_cmds.c
index dc7c47d..1eb0399 100644
--- a/bacula/src/dird/fd_cmds.c
+++ b/bacula/src/dird/fd_cmds.c
@@ -105,7 +105,7 @@ int connect_to_file_daemon(JCR *jcr, int retry_interval, int \
max_retry_time,  }
 
       if (fd == NULL) {
-         set_jcr_job_status(jcr, JS_ErrorTerminated);
+         jcr->setJobStatus(JS_ErrorTerminated);
          return 0;
       }
       Dmsg0(10, "Opened connection with File daemon\n");
@@ -114,10 +114,10 @@ int connect_to_file_daemon(JCR *jcr, int retry_interval, int \
max_retry_time,  }
    fd->res = (RES *)jcr->client;      /* save resource in BSOCK */
    jcr->file_bsock = fd;
-   set_jcr_job_status(jcr, JS_Running);
+   jcr->setJobStatus(JS_Running);
 
    if (!authenticate_file_daemon(jcr)) {
-      set_jcr_job_status(jcr, JS_ErrorTerminated);
+      jcr->setJobStatus(JS_ErrorTerminated);
       return 0;
    }
 
@@ -138,7 +138,7 @@ int connect_to_file_daemon(JCR *jcr, int retry_interval, int \
max_retry_time,  if (strncmp(fd->msg, OKjob, strlen(OKjob)) != 0) {
           Jmsg(jcr, M_FATAL, 0, _("File daemon \"%s\" rejected Job command: %s\n"),
              jcr->client->hdr.name, fd->msg);
-          set_jcr_job_status(jcr, JS_ErrorTerminated);
+          jcr->setJobStatus(JS_ErrorTerminated);
           return 0;
        } else if (jcr->db) {
           CLIENT_DBR cr;
@@ -156,7 +156,7 @@ int connect_to_file_daemon(JCR *jcr, int retry_interval, int \
max_retry_time,  } else {
       Jmsg(jcr, M_FATAL, 0, _("FD gave bad response to JobId command: %s\n"),
          bnet_strerror(fd));
-      set_jcr_job_status(jcr, JS_ErrorTerminated);
+      jcr->setJobStatus(JS_ErrorTerminated);
       return 0;
    }
    return 1;
@@ -248,13 +248,13 @@ void get_level_since_time(JCR *jcr, char *since, int since_len)
          Jmsg(jcr, M_INFO, 0, _("No prior or suitable Full backup found in catalog. \
Doing FULL backup.\n"));  bsnprintf(since, since_len, _(" (upgraded from %s)"),
             level_to_str(jcr->getJobLevel()));
-         jcr->set_JobLevel(jcr->jr.JobLevel = L_FULL);
+         jcr->setJobLevel(jcr->jr.JobLevel = L_FULL);
        } else if (do_diff) {
          /* No recent diff job found, so upgrade this one to Diff */
          Jmsg(jcr, M_INFO, 0, _("No prior or suitable Differential backup found in \
catalog. Doing Differential backup.\n"));  bsnprintf(since, since_len, _(" (upgraded \
from %s)"),  level_to_str(jcr->getJobLevel()));
-         jcr->set_JobLevel(jcr->jr.JobLevel = L_DIFFERENTIAL);
+         jcr->setJobLevel(jcr->jr.JobLevel = L_DIFFERENTIAL);
       } else {
          if (jcr->job->rerun_failed_levels) {
             if (db_find_failed_job_since(jcr, jcr->db, &jcr->jr, jcr->stime, \
JobLevel)) { @@ -262,7 +262,7 @@ void get_level_since_time(JCR *jcr, char *since, int \
since_len)  level_to_str(JobLevel));
                bsnprintf(since, since_len, _(" (upgraded from %s)"),
                   level_to_str(jcr->getJobLevel()));
-               jcr->set_JobLevel(jcr->jr.JobLevel = JobLevel);
+               jcr->setJobLevel(jcr->jr.JobLevel = JobLevel);
                jcr->jr.JobId = jcr->JobId;
                break;
             }
@@ -486,7 +486,7 @@ static bool send_fileset(JCR *jcr)
    return true;
 
 bail_out:
-   set_jcr_job_status(jcr, JS_ErrorTerminated);
+   jcr->setJobStatus(JS_ErrorTerminated);
    return false;
 
 }
@@ -805,7 +805,7 @@ int get_attributes_and_put_in_catalog(JCR *jcr)
       if ((len = sscanf(fd->msg, "%ld %d %s", &file_index, &stream, Digest)) != 3) {
          Jmsg(jcr, M_FATAL, 0, _("<filed: bad attributes, expected 3 fields got \
%d\n"  "msglen=%d msg=%s\n"), len, fd->msglen, fd->msg);
-         set_jcr_job_status(jcr, JS_ErrorTerminated);
+         jcr->setJobStatus(JS_ErrorTerminated);
          return 0;
       }
       p = fd->msg;
@@ -884,6 +884,6 @@ int get_attributes_and_put_in_catalog(JCR *jcr)
       }
       jcr->cached_attribute = false; 
    }
-   set_jcr_job_status(jcr, JS_Terminated);
+   jcr->setJobStatus(JS_Terminated);
    return 1;
 }
diff --git a/bacula/src/dird/job.c b/bacula/src/dird/job.c
index 626f6bb..056c4cb 100644
--- a/bacula/src/dird/job.c
+++ b/bacula/src/dird/job.c
@@ -1114,15 +1114,15 @@ void get_job_storage(USTORE *store, JOB *job, RUN *run)
 void set_jcr_defaults(JCR *jcr, JOB *job)
 {
    jcr->job = job;
-   jcr->set_JobType(job->JobType);
+   jcr->setJobType(job->JobType);
    jcr->JobStatus = JS_Created;
 
    switch (jcr->getJobType()) {
    case JT_ADMIN:
-      jcr->set_JobLevel(L_NONE);
+      jcr->setJobLevel(L_NONE);
       break;
    default:
-      jcr->set_JobLevel(job->JobLevel);
+      jcr->setJobLevel(job->JobLevel);
       break;
    }
 
@@ -1182,17 +1182,17 @@ void set_jcr_defaults(JCR *jcr, JOB *job)
    if (jcr->getJobLevel() == 0) {
       switch (jcr->getJobType()) {
       case JT_VERIFY:
-         jcr->set_JobLevel(L_VERIFY_CATALOG);
+         jcr->setJobLevel(L_VERIFY_CATALOG);
          break;
       case JT_BACKUP:
-         jcr->set_JobLevel(L_INCREMENTAL);
+         jcr->setJobLevel(L_INCREMENTAL);
          break;
       case JT_RESTORE:
       case JT_ADMIN:
-         jcr->set_JobLevel(L_NONE);
+         jcr->setJobLevel(L_NONE);
          break;
       default:
-         jcr->set_JobLevel(L_FULL);
+         jcr->setJobLevel(L_FULL);
          break;
       }
    }
diff --git a/bacula/src/dird/jobq.c b/bacula/src/dird/jobq.c
index a94235a..7c19ac6 100644
--- a/bacula/src/dird/jobq.c
+++ b/bacula/src/dird/jobq.c
@@ -174,7 +174,7 @@ void *sched_wait(void *arg)
    Dmsg0(2300, "Enter sched_wait.\n");
    free(arg);
    time_t wtime = jcr->sched_time - time(NULL);
-   set_jcr_job_status(jcr, JS_WaitStartTime);
+   jcr->setJobStatus(JS_WaitStartTime);
    /* Wait until scheduled time arrives */
    if (wtime > 0) {
       Jmsg(jcr, M_INFO, 0, _("Job %s waiting %d seconds for scheduled start \
time.\n"), @@ -533,7 +533,7 @@ void *jobq_server(void *arg)
             if (!(jcr->JobPriority == Priority
                   || (jcr->JobPriority < Priority &&
                       jcr->job->allow_mixed_priority && running_allow_mix))) {
-               set_jcr_job_status(jcr, JS_WaitPriority);
+               jcr->setJobStatus(JS_WaitPriority);
                break;
             }
 
@@ -649,7 +649,7 @@ static bool reschedule_job(JCR *jcr, jobq_t *jq, jobq_item_t *je)
            jcr->Job, dt, (int)jcr->job->RescheduleInterval, dt2);
       dird_free_jcr_pointers(jcr);     /* partial cleanup old stuff */
       jcr->JobStatus = -1;
-      set_jcr_job_status(jcr, JS_WaitStartTime);
+      jcr->setJobStatus(JS_WaitStartTime);
       jcr->SDJobStatus = 0;
       jcr->JobErrors = 0;
       if (!allow_duplicate_job(jcr)) {
@@ -675,7 +675,7 @@ static bool reschedule_job(JCR *jcr, jobq_t *jq, jobq_item_t *je)
       set_jcr_defaults(njcr, jcr->job);
       njcr->reschedule_count = jcr->reschedule_count;
       njcr->sched_time = jcr->sched_time;
-      njcr->set_JobLevel(jcr->getJobLevel());
+      njcr->setJobLevel(jcr->getJobLevel());
       njcr->pool = jcr->pool;
       njcr->run_pool_override = jcr->run_pool_override;
       njcr->full_pool = jcr->full_pool;
@@ -684,7 +684,7 @@ static bool reschedule_job(JCR *jcr, jobq_t *jq, jobq_item_t *je)
       njcr->run_inc_pool_override = jcr->run_inc_pool_override;
       njcr->diff_pool = jcr->diff_pool;
       njcr->JobStatus = -1;
-      set_jcr_job_status(njcr, jcr->JobStatus);
+      njcr->setJobStatus(jcr->JobStatus);
       if (jcr->rstore) {
          copy_rstorage(njcr, jcr->rstorage, _("previous Job"));
       } else {
@@ -731,7 +731,7 @@ static bool acquire_resources(JCR *jcr)
       Jmsg(jcr, M_FATAL, 0, _("Job canceled. Attempt to read and write same \
                device.\n"
          "    Read storage \"%s\" (From %s) -- Write storage \"%s\" (From %s)\n"), 
          jcr->rstore->name(), jcr->rstore_source, jcr->wstore->name(), \
                jcr->wstore_source);
-      set_jcr_job_status(jcr, JS_Canceled);
+      jcr->setJobStatus(JS_Canceled);
       return false;
    }
 #endif
@@ -739,7 +739,7 @@ static bool acquire_resources(JCR *jcr)
       Dmsg1(200, "Rstore=%s\n", jcr->rstore->name());
       if (!inc_read_store(jcr)) {
          Dmsg1(200, "Fail rncj=%d\n", jcr->rstore->NumConcurrentJobs);
-         set_jcr_job_status(jcr, JS_WaitStoreRes);
+         jcr->setJobStatus(JS_WaitStoreRes);
          return false;
       }
    }
@@ -758,7 +758,7 @@ static bool acquire_resources(JCR *jcr)
       }
    }
    if (skip_this_jcr) {
-      set_jcr_job_status(jcr, JS_WaitStoreRes);
+      jcr->setJobStatus(JS_WaitStoreRes);
       return false;
    }
 
@@ -768,7 +768,7 @@ static bool acquire_resources(JCR *jcr)
       /* Back out previous locks */
       dec_write_store(jcr);
       dec_read_store(jcr);
-      set_jcr_job_status(jcr, JS_WaitClientRes);
+      jcr->setJobStatus(JS_WaitClientRes);
       return false;
    }
    if (jcr->job->NumConcurrentJobs < jcr->job->MaxConcurrentJobs) {
@@ -778,7 +778,7 @@ static bool acquire_resources(JCR *jcr)
       dec_write_store(jcr);
       dec_read_store(jcr);
       jcr->client->NumConcurrentJobs--;
-      set_jcr_job_status(jcr, JS_WaitJobRes);
+      jcr->setJobStatus(JS_WaitJobRes);
       return false;
    }
 
diff --git a/bacula/src/dird/migrate.c b/bacula/src/dird/migrate.c
index 2104b4d..9b29c61 100644
--- a/bacula/src/dird/migrate.c
+++ b/bacula/src/dird/migrate.c
@@ -157,7 +157,7 @@ bool do_migration_init(JCR *jcr)
    }
 
    if (jcr->previous_jr.JobId == 0 || jcr->ExpectedFiles == 0) {
-      set_jcr_job_status(jcr, JS_Terminated);
+      jcr->setJobStatus(JS_Terminated);
       Dmsg1(dbglevel, "JobId=%d expected files == 0\n", (int)jcr->JobId);
       if (jcr->previous_jr.JobId == 0) {
          Jmsg(jcr, M_INFO, 0, _("No previous Job found to %s.\n"), \
jcr->get_ActionName(0)); @@ -301,7 +301,7 @@ bool do_migration(JCR *jcr)
     *  so set a normal status, cleanup and return OK.
     */
    if (!mig_jcr) {
-      set_jcr_job_status(jcr, JS_Terminated);
+      jcr->setJobStatus(JS_Terminated);
       migration_cleanup(jcr, jcr->JobStatus);
       return true;
    }
@@ -311,7 +311,7 @@ bool do_migration(JCR *jcr)
            edit_int64(jcr->previous_jr.JobId, ed1),
            jcr->get_ActionName(0),
            db_strerror(jcr->db));
-      set_jcr_job_status(jcr, JS_Terminated);
+      jcr->setJobStatus(JS_Terminated);
       migration_cleanup(jcr, jcr->JobStatus);
       return true;
    }
@@ -322,7 +322,7 @@ bool do_migration(JCR *jcr)
          edit_int64(jcr->previous_jr.JobId, ed1),
          jcr->get_ActionName(1),
          jcr->get_OperationName());
-      set_jcr_job_status(jcr, JS_Terminated);
+      jcr->setJobStatus(JS_Terminated);
       migration_cleanup(jcr, jcr->JobStatus);
       return true;
    }
@@ -338,8 +338,8 @@ bool do_migration(JCR *jcr)
     *
     */
    Dmsg0(110, "Open connection with storage daemon\n");
-   set_jcr_job_status(jcr, JS_WaitSD);
-   set_jcr_job_status(mig_jcr, JS_WaitSD);
+   jcr->setJobStatus(JS_WaitSD);
+   mig_jcr->setJobStatus(JS_WaitSD);
    /*
     * Start conversation with Storage daemon
     */
@@ -373,7 +373,7 @@ bool do_migration(JCR *jcr)
    jcr->start_time = time(NULL);
    jcr->jr.StartTime = jcr->start_time;
    jcr->jr.JobTDate = jcr->start_time;
-   set_jcr_job_status(jcr, JS_Running);
+   jcr->setJobStatus(JS_Running);
 
    /* Update job start record for this migration control job */
    if (!db_update_job_start_record(jcr, jcr->db, &jcr->jr)) {
@@ -385,7 +385,7 @@ bool do_migration(JCR *jcr)
    mig_jcr->start_time = time(NULL);
    mig_jcr->jr.StartTime = mig_jcr->start_time;
    mig_jcr->jr.JobTDate = mig_jcr->start_time;
-   set_jcr_job_status(mig_jcr, JS_Running);
+   mig_jcr->setJobStatus(JS_Running);
 
    /* Update job start record for the real migration backup job */
    if (!db_update_job_start_record(mig_jcr, mig_jcr->db, &mig_jcr->jr)) {
@@ -415,13 +415,13 @@ bool do_migration(JCR *jcr)
    }
 
 
-   set_jcr_job_status(jcr, JS_Running);
-   set_jcr_job_status(mig_jcr, JS_Running);
+   jcr->setJobStatus(JS_Running);
+   mig_jcr->setJobStatus(JS_Running);
 
    /* Pickup Job termination data */
    /* Note, the SD stores in jcr->JobFiles/ReadBytes/JobBytes/JobErrors */
    wait_for_storage_daemon_termination(jcr);
-   set_jcr_job_status(jcr, jcr->SDJobStatus);
+   jcr->setJobStatus(jcr->SDJobStatus);
    db_write_batch_file_records(jcr);    /* used by bulk batch file insert */
    if (jcr->JobStatus != JS_Terminated) {
       return false;
@@ -1210,7 +1210,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 Job report: \
ERR=%s"),  db_strerror(jcr->db));
-         set_jcr_job_status(jcr, JS_ErrorTerminated);
+         jcr->setJobStatus(JS_ErrorTerminated);
       }
 
       update_bootstrap_file(mig_jcr);
diff --git a/bacula/src/dird/msgchan.c b/bacula/src/dird/msgchan.c
index 9f2e96a..2b1d3f5 100644
--- a/bacula/src/dird/msgchan.c
+++ b/bacula/src/dird/msgchan.c
@@ -439,7 +439,7 @@ void wait_for_storage_daemon_termination(JCR *jcr)
          break;
       }
    }
-   set_jcr_job_status(jcr, JS_Terminated);
+   jcr->setJobStatus(JS_Terminated);
 }
 
 /*
@@ -462,7 +462,7 @@ bool send_bootstrap_file(JCR *jcr, BSOCK *sd)
       berrno be;
       Jmsg(jcr, M_FATAL, 0, _("Could not open bootstrap file %s: ERR=%s\n"),
          jcr->RestoreBootstrap, be.bstrerror());
-      set_jcr_job_status(jcr, JS_ErrorTerminated);
+      jcr->setJobStatus(JS_ErrorTerminated);
       return false;
    }
    sd->fsend(bootstrap);
diff --git a/bacula/src/dird/pythondir.c b/bacula/src/dird/pythondir.c
index e3e8fb7..20a78ab 100644
--- a/bacula/src/dird/pythondir.c
+++ b/bacula/src/dird/pythondir.c
@@ -294,7 +294,7 @@ int job_setattr(PyObject *self, char *attrname, PyObject *value)
          for (i=0; joblevels[i].level_name; i++) {
             if (strcmp(strval, joblevels[i].level_name) == 0) {
                if (joblevels[i].job_type == jcr->getJobType()) {
-                  jcr->set_JobLevel(joblevels[i].level);
+                  jcr->setJobLevel(joblevels[i].level);
                   jcr->jr.JobLevel = jcr->getJobLevel();
                   return 0;
                }
diff --git a/bacula/src/dird/restore.c b/bacula/src/dird/restore.c
index a5cce85..741f73b 100644
--- a/bacula/src/dird/restore.c
+++ b/bacula/src/dird/restore.c
@@ -136,7 +136,7 @@ static bool open_bootstrap_file(JCR *jcr, bootstrap_info &info)
       berrno be;
       Jmsg(jcr, M_FATAL, 0, _("Could not open bootstrap file %s: ERR=%s\n"),
          jcr->RestoreBootstrap, be.bstrerror());
-      set_jcr_job_status(jcr, JS_ErrorTerminated);
+      jcr->setJobStatus(JS_ErrorTerminated);
       return false;
    }
 
@@ -183,7 +183,7 @@ static bool is_on_same_storage(JCR *jcr, char *new_one)
    if (!new_store) {
       Jmsg(jcr, M_FATAL, 0,
            _("Could not get storage resource '%s'.\n"), new_one);
-      set_jcr_job_status(jcr, JS_ErrorTerminated);
+      jcr->setJobStatus(JS_ErrorTerminated);
       return false;
    }
    /* if Port and Hostname/IP are same, we are talking to the same
@@ -275,7 +275,7 @@ static bool select_rstore(JCR *jcr, bootstrap_info &info)
    if (!(ustore.store = (STORE *)GetResWithName(R_STORAGE,info.storage))) {
       Jmsg(jcr, M_FATAL, 0,
            _("Could not get storage resource '%s'.\n"), info.storage);
-      set_jcr_job_status(jcr, JS_ErrorTerminated);
+      jcr->setJobStatus(JS_ErrorTerminated);
       return false;
    }
    
@@ -293,14 +293,14 @@ static bool select_rstore(JCR *jcr, bootstrap_info &info)
    dec_read_store(jcr);
    free_rstorage(jcr);
    set_rstorage(jcr, &ustore);
-   set_jcr_job_status(jcr, JS_WaitSD);
+   jcr->setJobStatus(JS_WaitSD);
    /*
     * Wait for up to 6 hours to increment read stoage counter 
     */
    for (i=0; i < MAX_TRIES; i++) {
       /* try to get read storage counter incremented */
       if (inc_read_store(jcr)) {
-         set_jcr_job_status(jcr, JS_Running);
+         jcr->setJobStatus(JS_Running);
          return true;
       }
       bmicrosleep(10, 0);       /* sleep 10 secs */
@@ -368,7 +368,7 @@ bool restore_bootstrap(JCR *jcr)
        *
        */
       Dmsg0(10, "Open connection with storage daemon\n");
-      set_jcr_job_status(jcr, JS_WaitSD);
+      jcr->setJobStatus(JS_WaitSD);
       /*
        * Start conversation with Storage daemon
        */
@@ -387,7 +387,7 @@ bool restore_bootstrap(JCR *jcr)
          /*
           * Start conversation with File daemon
           */
-         set_jcr_job_status(jcr, JS_WaitFD);
+         jcr->setJobStatus(JS_WaitFD);
          jcr->keep_sd_auth_key = true; /* don't clear the sd_auth_key now */
          if (!connect_to_file_daemon(jcr, 10, FDConnectTimeout, 1)) {
             goto bail_out;
@@ -395,7 +395,7 @@ bool restore_bootstrap(JCR *jcr)
          fd = jcr->file_bsock;
       }
 
-      set_jcr_job_status(jcr, JS_WaitSD);
+      jcr->setJobStatus(JS_WaitSD);
 
       /*
        * Send the bootstrap file -- what Volumes/files to restore
diff --git a/bacula/src/dird/scheduler.c b/bacula/src/dird/scheduler.c
index 6bcc3da..95c80be 100644
--- a/bacula/src/dird/scheduler.c
+++ b/bacula/src/dird/scheduler.c
@@ -200,7 +200,7 @@ again:
    ASSERT(job);
    set_jcr_defaults(jcr, job);
    if (run->level) {
-      jcr->set_JobLevel(run->level);  /* override run level */
+      jcr->setJobLevel(run->level);  /* override run level */
    }
    if (run->pool) {
       jcr->pool = run->pool;          /* override pool */
diff --git a/bacula/src/dird/ua_cmds.c b/bacula/src/dird/ua_cmds.c
index 55cba71..284f275 100644
--- a/bacula/src/dird/ua_cmds.c
+++ b/bacula/src/dird/ua_cmds.c
@@ -1150,7 +1150,7 @@ static int estimate_cmd(UAContext *ua, const char *cmd)
    JCR *jcr = ua->jcr;
    int accurate=-1;
 
-   jcr->set_JobLevel(L_FULL);
+   jcr->setJobLevel(L_FULL);
    for (int i=1; i<ua->argc; i++) {
       if (strcasecmp(ua->argk[i], NT_("client")) == 0 ||
           strcasecmp(ua->argk[i], NT_("fd")) == 0) {
@@ -1263,7 +1263,7 @@ static int estimate_cmd(UAContext *ua, const char *cmd)
    }
 
    jcr->job = job;
-   jcr->set_JobType(JT_BACKUP);
+   jcr->setJobType(JT_BACKUP);
    init_jcr_job_record(jcr);
 
    if (!get_or_create_client_record(jcr)) {
diff --git a/bacula/src/dird/ua_run.c b/bacula/src/dird/ua_run.c
index 06470ab..95036f5 100644
--- a/bacula/src/dird/ua_run.c
+++ b/bacula/src/dird/ua_run.c
@@ -700,19 +700,19 @@ static void select_job_level(UAContext *ua, JCR *jcr)
 //       jcr->JobLevel = L_BASE;
 //       break;
       case 0:
-         jcr->set_JobLevel(L_FULL);
+         jcr->setJobLevel(L_FULL);
          break;
       case 1:
-         jcr->set_JobLevel(L_INCREMENTAL);
+         jcr->setJobLevel(L_INCREMENTAL);
          break;
       case 2:
-         jcr->set_JobLevel(L_DIFFERENTIAL);
+         jcr->setJobLevel(L_DIFFERENTIAL);
          break;
       case 3:
-         jcr->set_JobLevel(L_SINCE);
+         jcr->setJobLevel(L_SINCE);
          break;
       case 4:
-         jcr->set_JobLevel(L_VIRTUAL_FULL);
+         jcr->setJobLevel(L_VIRTUAL_FULL);
          break;
       default:
          break;
@@ -726,19 +726,19 @@ static void select_job_level(UAContext *ua, JCR *jcr)
       add_prompt(ua, _("Verify Volume Data (not yet implemented)"));
       switch (do_prompt(ua, "",  _("Select level"), NULL, 0)) {
       case 0:
-         jcr->set_JobLevel(L_VERIFY_INIT);
+         jcr->setJobLevel(L_VERIFY_INIT);
          break;
       case 1:
-         jcr->set_JobLevel(L_VERIFY_CATALOG);
+         jcr->setJobLevel(L_VERIFY_CATALOG);
          break;
       case 2:
-         jcr->set_JobLevel(L_VERIFY_VOLUME_TO_CATALOG);
+         jcr->setJobLevel(L_VERIFY_VOLUME_TO_CATALOG);
          break;
       case 3:
-         jcr->set_JobLevel(L_VERIFY_DISK_TO_CATALOG);
+         jcr->setJobLevel(L_VERIFY_DISK_TO_CATALOG);
          break;
       case 4:
-         jcr->set_JobLevel(L_VERIFY_DATA);
+         jcr->setJobLevel(L_VERIFY_DATA);
          break;
       default:
          break;
@@ -789,7 +789,7 @@ static bool display_job_parameters(UAContext *ua, JCR *jcr, JOB \
*job, const char  bstrutime(dt, sizeof(dt), jcr->sched_time),
                  jcr->JobPriority);
       }
-      jcr->set_JobLevel(L_FULL);
+      jcr->setJobLevel(L_FULL);
       break;
    case JT_BACKUP:
    case JT_VERIFY:
@@ -924,7 +924,7 @@ static bool display_job_parameters(UAContext *ua, JCR *jcr, JOB \
*job, const char  jcr->RestoreJobId = ua->int64_val;
          }
       }
-      jcr->set_JobLevel(L_FULL);      /* default level */
+      jcr->setJobLevel(L_FULL);      /* default level */
       Dmsg1(800, "JobId to restore=%d\n", jcr->RestoreJobId);
       if (jcr->RestoreJobId == 0) {
          /* RegexWhere is take before RestoreWhere */
@@ -1081,7 +1081,7 @@ static bool display_job_parameters(UAContext *ua, JCR *jcr, JOB \
*job, const char  case JT_COPY:
    case JT_MIGRATE:
       char *prt_type;
-      jcr->set_JobLevel(L_FULL);      /* default level */
+      jcr->setJobLevel(L_FULL);      /* default level */
       if (ua->api) {
          ua->signal(BNET_RUN_CMD);
          if (jcr->getJobType() == JT_COPY) {
diff --git a/bacula/src/dird/ua_select.c b/bacula/src/dird/ua_select.c
index 829ab36..ed8798b 100644
--- a/bacula/src/dird/ua_select.c
+++ b/bacula/src/dird/ua_select.c
@@ -1079,7 +1079,7 @@ bool get_level_from_name(JCR *jcr, const char *level_name)
    bool found = false;
    for (int i=0; joblevels[i].level_name; i++) {
       if (strcasecmp(level_name, joblevels[i].level_name) == 0) {
-         jcr->set_JobLevel(joblevels[i].level);
+         jcr->setJobLevel(joblevels[i].level);
          found = true;
          break;
       }
diff --git a/bacula/src/dird/ua_server.c b/bacula/src/dird/ua_server.c
index 0be9b9d..b602e0a 100644
--- a/bacula/src/dird/ua_server.c
+++ b/bacula/src/dird/ua_server.c
@@ -103,9 +103,9 @@ JCR *new_control_jcr(const char *base_name, int job_type)
    jcr->sd_auth_key = bstrdup("dummy"); /* dummy Storage daemon key */
    create_unique_job_name(jcr, base_name);
    jcr->sched_time = jcr->start_time;
-   jcr->set_JobType(job_type);
-   jcr->set_JobLevel(L_NONE);
-   set_jcr_job_status(jcr, JS_Running);
+   jcr->setJobType(job_type);
+   jcr->setJobLevel(L_NONE);
+   jcr->setJobStatus(JS_Running);
    jcr->JobId = 0;
    return jcr;
 }
diff --git a/bacula/src/dird/ua_status.c b/bacula/src/dird/ua_status.c
index b1483f8..26f03e5 100644
--- a/bacula/src/dird/ua_status.c
+++ b/bacula/src/dird/ua_status.c
@@ -496,7 +496,7 @@ static void prt_runtime(UAContext *ua, sched_pkt *sp)
       db_close_database(jcr, jcr->db);
    }
    jcr->db = ua->db;                  /* restore ua db to jcr */
-   jcr->set_JobType(orig_jobtype);
+   jcr->setJobType(orig_jobtype);
 }
 
 /*
diff --git a/bacula/src/dird/vbackup.c b/bacula/src/dird/vbackup.c
index c579f99..0375a0d 100644
--- a/bacula/src/dird/vbackup.c
+++ b/bacula/src/dird/vbackup.c
@@ -193,7 +193,7 @@ _("This Job is not an Accurate backup so is not equivalent to a \
                Full backup.\n")
     *
     */
    Dmsg0(110, "Open connection with storage daemon\n");
-   set_jcr_job_status(jcr, JS_WaitSD);
+   jcr->setJobStatus(JS_WaitSD);
    /*
     * Start conversation with Storage daemon
     */
@@ -223,7 +223,7 @@ _("This Job is not an Accurate backup so is not equivalent to a \
Full backup.\n")  jcr->start_time = time(NULL);
    jcr->jr.StartTime = jcr->start_time;
    jcr->jr.JobTDate = jcr->start_time;
-   set_jcr_job_status(jcr, JS_Running);
+   jcr->setJobStatus(JS_Running);
 
    /* Update job start record */
    if (!db_update_job_start_record(jcr, jcr->db, &jcr->jr)) {
@@ -247,12 +247,12 @@ _("This Job is not an Accurate backup so is not equivalent to a \
Full backup.\n")  return false;
    }
 
-   set_jcr_job_status(jcr, JS_Running);
+   jcr->setJobStatus(JS_Running);
 
    /* Pickup Job termination data */
    /* Note, the SD stores in jcr->JobFiles/ReadBytes/JobBytes/JobErrors */
    wait_for_storage_daemon_termination(jcr);
-   set_jcr_job_status(jcr, jcr->SDJobStatus);
+   jcr->setJobStatus(jcr->SDJobStatus);
    db_write_batch_file_records(jcr);    /* used by bulk batch file insert */
    if (jcr->JobStatus != JS_Terminated) {
       return false;
@@ -284,7 +284,7 @@ void vbackup_cleanup(JCR *jcr, int TermCode)
    memset(&mr, 0, sizeof(mr));
    memset(&cr, 0, sizeof(cr));
 
-   jcr->set_JobLevel(L_FULL);         /* we want this to appear as a Full backup */
+   jcr->setJobLevel(L_FULL);         /* we want this to appear as a Full backup */
    jcr->jr.JobLevel = L_FULL;         /* we want this to appear as a Full backup */
    jcr->JobFiles = jcr->SDJobFiles;
    jcr->JobBytes = jcr->SDJobBytes;
@@ -302,7 +302,7 @@ void vbackup_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 Job report: ERR=%s"),
          db_strerror(jcr->db));
-      set_jcr_job_status(jcr, JS_ErrorTerminated);
+      jcr->setJobStatus(JS_ErrorTerminated);
    }
 
    bstrncpy(cr.Name, jcr->client->name(), sizeof(cr.Name));
@@ -315,7 +315,7 @@ void vbackup_cleanup(JCR *jcr, int TermCode)
    if (!db_get_media_record(jcr, jcr->db, &mr)) {
       Jmsg(jcr, M_WARNING, 0, _("Error getting Media record for Volume \"%s\": \
ERR=%s"),  mr.VolumeName, db_strerror(jcr->db));
-      set_jcr_job_status(jcr, JS_ErrorTerminated);
+      jcr->setJobStatus(JS_ErrorTerminated);
    }
 
    update_bootstrap_file(jcr);
diff --git a/bacula/src/dird/verify.c b/bacula/src/dird/verify.c
index 2e4ecbc..41cb901 100644
--- a/bacula/src/dird/verify.c
+++ b/bacula/src/dird/verify.c
@@ -224,7 +224,7 @@ bool do_verify(JCR *jcr)
       /*
        * Start conversation with Storage daemon
        */
-      set_jcr_job_status(jcr, JS_Blocked);
+      jcr->setJobStatus(JS_Blocked);
       if (!connect_to_storage_daemon(jcr, 10, SDConnectTimeout, 1)) {
          return false;
       }
@@ -258,12 +258,12 @@ bool do_verify(JCR *jcr)
     * OK, now connect to the File daemon
     *  and ask him for the files.
     */
-   set_jcr_job_status(jcr, JS_Blocked);
+   jcr->setJobStatus(JS_Blocked);
    if (!connect_to_file_daemon(jcr, 10, FDConnectTimeout, 1)) {
       goto bail_out;
    }
 
-   set_jcr_job_status(jcr, JS_Running);
+   jcr->setJobStatus(JS_Running);
    fd = jcr->file_bsock;
 
 
@@ -614,7 +614,7 @@ void get_attributes_and_compare_to_catalog(JCR *jcr, JobId_t \
JobId)  &jcr->previous_jr, &fdbr)) {
             Jmsg(jcr, M_INFO, 0, _("New file: %s\n"), jcr->fname);
             Dmsg1(020, _("File not in catalog: %s\n"), jcr->fname);
-            set_jcr_job_status(jcr, JS_Differences);
+            jcr->setJobStatus(JS_Differences);
             continue;
          } else {
             /*
@@ -640,7 +640,7 @@ void get_attributes_and_compare_to_catalog(JCR *jcr, JobId_t \
                JobId)
                   Jmsg(jcr, M_INFO, 0, _("      st_ino   differ. Cat: %s File: \
%s\n"),  edit_uint64((uint64_t)statc.st_ino, ed1),
                      edit_uint64((uint64_t)statf.st_ino, ed2));
-                  set_jcr_job_status(jcr, JS_Differences);
+                  jcr->setJobStatus(JS_Differences);
                }
                break;
             case 'p':                /* permissions bits */
@@ -648,7 +648,7 @@ void get_attributes_and_compare_to_catalog(JCR *jcr, JobId_t \
JobId)  prt_fname(jcr);
                   Jmsg(jcr, M_INFO, 0, _("      st_mode  differ. Cat: %x File: \
%x\n"),  (uint32_t)statc.st_mode, (uint32_t)statf.st_mode);
-                  set_jcr_job_status(jcr, JS_Differences);
+                  jcr->setJobStatus(JS_Differences);
                }
                break;
             case 'n':                /* number of links */
@@ -656,7 +656,7 @@ void get_attributes_and_compare_to_catalog(JCR *jcr, JobId_t \
JobId)  prt_fname(jcr);
                   Jmsg(jcr, M_INFO, 0, _("      st_nlink differ. Cat: %d File: \
%d\n"),  (uint32_t)statc.st_nlink, (uint32_t)statf.st_nlink);
-                  set_jcr_job_status(jcr, JS_Differences);
+                  jcr->setJobStatus(JS_Differences);
                }
                break;
             case 'u':                /* user id */
@@ -664,7 +664,7 @@ void get_attributes_and_compare_to_catalog(JCR *jcr, JobId_t \
JobId)  prt_fname(jcr);
                   Jmsg(jcr, M_INFO, 0, _("      st_uid   differ. Cat: %u File: \
%u\n"),  (uint32_t)statc.st_uid, (uint32_t)statf.st_uid);
-                  set_jcr_job_status(jcr, JS_Differences);
+                  jcr->setJobStatus(JS_Differences);
                }
                break;
             case 'g':                /* group id */
@@ -672,7 +672,7 @@ void get_attributes_and_compare_to_catalog(JCR *jcr, JobId_t \
JobId)  prt_fname(jcr);
                   Jmsg(jcr, M_INFO, 0, _("      st_gid   differ. Cat: %u File: \
%u\n"),  (uint32_t)statc.st_gid, (uint32_t)statf.st_gid);
-                  set_jcr_job_status(jcr, JS_Differences);
+                  jcr->setJobStatus(JS_Differences);
                }
                break;
             case 's':                /* size */
@@ -681,28 +681,28 @@ void get_attributes_and_compare_to_catalog(JCR *jcr, JobId_t \
                JobId)
                   Jmsg(jcr, M_INFO, 0, _("      st_size  differ. Cat: %s File: \
%s\n"),  edit_uint64((uint64_t)statc.st_size, ed1),
                      edit_uint64((uint64_t)statf.st_size, ed2));
-                  set_jcr_job_status(jcr, JS_Differences);
+                  jcr->setJobStatus(JS_Differences);
                }
                break;
             case 'a':                /* access time */
                if (statc.st_atime != statf.st_atime) {
                   prt_fname(jcr);
                   Jmsg(jcr, M_INFO, 0, _("      st_atime differs\n"));
-                  set_jcr_job_status(jcr, JS_Differences);
+                  jcr->setJobStatus(JS_Differences);
                }
                break;
             case 'm':
                if (statc.st_mtime != statf.st_mtime) {
                   prt_fname(jcr);
                   Jmsg(jcr, M_INFO, 0, _("      st_mtime differs\n"));
-                  set_jcr_job_status(jcr, JS_Differences);
+                  jcr->setJobStatus(JS_Differences);
                }
                break;
             case 'c':                /* ctime */
                if (statc.st_ctime != statf.st_ctime) {
                   prt_fname(jcr);
                   Jmsg(jcr, M_INFO, 0, _("      st_ctime differs\n"));
-                  set_jcr_job_status(jcr, JS_Differences);
+                  jcr->setJobStatus(JS_Differences);
                }
                break;
             case 'd':                /* file size decrease */
@@ -711,7 +711,7 @@ void get_attributes_and_compare_to_catalog(JCR *jcr, JobId_t \
                JobId)
                   Jmsg(jcr, M_INFO, 0, _("      st_size  decrease. Cat: %s File: \
%s\n"),  edit_uint64((uint64_t)statc.st_size, ed1),
                      edit_uint64((uint64_t)statf.st_size, ed2));
-                  set_jcr_job_status(jcr, JS_Differences);
+                  jcr->setJobStatus(JS_Differences);
                }
                break;
             case '5':                /* compare MD5 */
@@ -748,7 +748,7 @@ void get_attributes_and_compare_to_catalog(JCR *jcr, JobId_t \
JobId)  prt_fname(jcr);
                Jmsg(jcr, M_INFO, 0, _("      %s differs. File=%s Cat=%s\n"),
                     stream_to_ascii(stream), buf, fdbr.Digest);
-               set_jcr_job_status(jcr, JS_Differences);
+               jcr->setJobStatus(JS_Differences);
             }
             do_Digest = CRYPTO_DIGEST_NONE;
          }
@@ -775,7 +775,7 @@ void get_attributes_and_compare_to_catalog(JCR *jcr, JobId_t \
JobId)  /* missing_handler is called for each file found */
    db_sql_query(jcr->db, buf, missing_handler, (void *)jcr);
    if (jcr->fn_printed) {
-      set_jcr_job_status(jcr, JS_Differences);
+      jcr->setJobStatus(JS_Differences);
    }
    free_pool_memory(fname);
 }
diff --git a/bacula/src/filed/backup.c b/bacula/src/filed/backup.c
index 7330fde..562621d 100644
--- a/bacula/src/filed/backup.c
+++ b/bacula/src/filed/backup.c
@@ -83,7 +83,7 @@ bool blast_data_to_storage_daemon(JCR *jcr, char *addr)
 
    sd = jcr->store_bsock;
 
-   set_jcr_job_status(jcr, JS_Running);
+   jcr->setJobStatus(JS_Running);
 
    Dmsg1(300, "bfiled: opened data connection %d to stored\n", sd->m_fd);
 
@@ -97,7 +97,7 @@ bool blast_data_to_storage_daemon(JCR *jcr, char *addr)
       buf_size = 0;                   /* use default */
    }
    if (!sd->set_buffer_size(buf_size, BNET_SETBUF_WRITE)) {
-      set_jcr_job_status(jcr, JS_ErrorTerminated);
+      jcr->setJobStatus(JS_ErrorTerminated);
       Jmsg(jcr, M_FATAL, 0, _("Cannot set buffer size FD->SD.\n"));
       return false;
    }
@@ -161,7 +161,7 @@ bool blast_data_to_storage_daemon(JCR *jcr, char *addr)
    /** Subroutine save_file() is called for each file */
    if (!find_files(jcr, (FF_PKT *)jcr->ff, save_file, plugin_save)) {
       ok = false;                     /* error */
-      set_jcr_job_status(jcr, JS_ErrorTerminated);
+      jcr->setJobStatus(JS_ErrorTerminated);
    }
 
    if (have_acl && jcr->acl_data->nr_errors > 0) {
@@ -831,7 +831,7 @@ static int send_data(JCR *jcr, int stream, FF_PKT *ff_pkt, DIGEST \
                *digest,
          if ((zstat=deflateParams((z_stream*)jcr->pZLIB_compress_workset, 
               ff_pkt->GZIP_level, Z_DEFAULT_STRATEGY)) != Z_OK) {
             Jmsg(jcr, M_FATAL, 0, _("Compression deflateParams error: %d\n"), \
                zstat);
-            set_jcr_job_status(jcr, JS_ErrorTerminated);
+            jcr->setJobStatus(JS_ErrorTerminated);
             goto err;
          }
       }
@@ -960,14 +960,14 @@ static int send_data(JCR *jcr, int stream, FF_PKT *ff_pkt, \
DIGEST *digest,  
          if ((zstat=deflate((z_stream*)jcr->pZLIB_compress_workset, Z_FINISH)) != \
                Z_STREAM_END) {
             Jmsg(jcr, M_FATAL, 0, _("Compression deflate error: %d\n"), zstat);
-            set_jcr_job_status(jcr, JS_ErrorTerminated);
+            jcr->setJobStatus(JS_ErrorTerminated);
             goto err;
          }
          compress_len = ((z_stream*)jcr->pZLIB_compress_workset)->total_out;
          /** reset zlib stream to be able to begin from scratch again */
          if ((zstat=deflateReset((z_stream*)jcr->pZLIB_compress_workset)) != Z_OK) {
             Jmsg(jcr, M_FATAL, 0, _("Compression deflateReset error: %d\n"), zstat);
-            set_jcr_job_status(jcr, JS_ErrorTerminated);
+            jcr->setJobStatus(JS_ErrorTerminated);
             goto err;
          }
 
diff --git a/bacula/src/filed/estimate.c b/bacula/src/filed/estimate.c
index 7888bc9..3f97794 100644
--- a/bacula/src/filed/estimate.c
+++ b/bacula/src/filed/estimate.c
@@ -47,7 +47,7 @@ int make_estimate(JCR *jcr)
 {
    int stat;
 
-   set_jcr_job_status(jcr, JS_Running);
+   jcr->setJobStatus(JS_Running);
 
    set_find_options((FF_PKT *)jcr->ff, jcr->incremental, jcr->mtime);
    /* in accurate mode, we overwrite the find_one check function */
diff --git a/bacula/src/filed/job.c b/bacula/src/filed/job.c
index 9adee31..168d17a 100644
--- a/bacula/src/filed/job.c
+++ b/bacula/src/filed/job.c
@@ -457,7 +457,7 @@ static int cancel_cmd(JCR *jcr)
          dir->fsend(_("2901 Job %s not found.\n"), Job);
       } else {
          generate_plugin_event(cjcr, bEventCancelCommand, NULL);
-         set_jcr_job_status(cjcr, JS_Canceled);
+         cjcr->setJobStatus(JS_Canceled);
          if (cjcr->store_bsock) {
             cjcr->store_bsock->set_timed_out();
             cjcr->store_bsock->set_terminated();
@@ -1522,7 +1522,7 @@ static int bootstrap_cmd(JCR *jcr)
       while (dir->recv() >= 0)
         {  }
       free_bootstrap(jcr);
-      set_jcr_job_status(jcr, JS_ErrorTerminated);
+      jcr->setJobStatus(JS_ErrorTerminated);
       return 0;
    }
 
@@ -1564,16 +1564,16 @@ static int level_cmd(JCR *jcr)
    }
    /* Base backup requested? */
    if (strcmp(level, "base") == 0) {
-      jcr->set_JobLevel(L_BASE);
+      jcr->setJobLevel(L_BASE);
    /* Full backup requested? */
    } else if (strcmp(level, "full") == 0) {
-      jcr->set_JobLevel(L_FULL);
+      jcr->setJobLevel(L_FULL);
    } else if (strstr(level, "differential")) {
-      jcr->set_JobLevel(L_DIFFERENTIAL);
+      jcr->setJobLevel(L_DIFFERENTIAL);
       free_memory(level);
       return 1;
    } else if (strstr(level, "incremental")) {
-      jcr->set_JobLevel(L_INCREMENTAL);
+      jcr->setJobLevel(L_INCREMENTAL);
       free_memory(level);
       return 1;
    /*
@@ -1585,7 +1585,7 @@ static int level_cmd(JCR *jcr)
       utime_t since_time, adj;
       btime_t his_time, bt_start, rt=0, bt_adj=0;
       if (jcr->getJobLevel() == L_NONE) {
-         jcr->set_JobLevel(L_SINCE);     /* if no other job level set, do it now */
+         jcr->setJobLevel(L_SINCE);     /* if no other job level set, do it now */
       }
       if (sscanf(dir->msg, "level = since_utime %s mtime_only=%d",
                  buf, &mtime_only) != 2) {
@@ -1834,8 +1834,8 @@ static int backup_cmd(JCR *jcr)
       goto cleanup;
    }
 
-   set_jcr_job_status(jcr, JS_Blocked);
-   jcr->set_JobType(JT_BACKUP);
+   jcr->setJobStatus(JS_Blocked);
+   jcr->setJobType(JT_BACKUP);
    Dmsg1(100, "begin backup ff=%p\n", jcr->ff);
 
    if (sd == NULL) {
@@ -1929,11 +1929,11 @@ static int backup_cmd(JCR *jcr)
     */
    Dmsg1(110, "begin blast ff=%p\n", (FF_PKT *)jcr->ff);
    if (!blast_data_to_storage_daemon(jcr, NULL)) {
-      set_jcr_job_status(jcr, JS_ErrorTerminated);
+      jcr->setJobStatus(JS_ErrorTerminated);
       bnet_suppress_error_messages(sd, 1);
       Dmsg0(110, "Error in blast_data.\n");
    } else {
-      set_jcr_job_status(jcr, JS_Terminated);
+      jcr->setJobStatus(JS_Terminated);
       /* Note, the above set status will not override an error */
       if (!(jcr->JobStatus == JS_Terminated || jcr->JobStatus == JS_Warnings)) {
          bnet_suppress_error_messages(sd, 1);
@@ -1943,7 +1943,7 @@ static int backup_cmd(JCR *jcr)
        * Expect to get response to append_data from Storage daemon
        */
       if (!response(jcr, sd, OK_append, "Append Data")) {
-         set_jcr_job_status(jcr, JS_ErrorTerminated);
+         jcr->setJobStatus(JS_ErrorTerminated);
          goto cleanup;
       }
 
@@ -1953,7 +1953,7 @@ static int backup_cmd(JCR *jcr)
       sd->fsend(append_end, jcr->Ticket);
       /* Get end OK */
       if (!response(jcr, sd, OK_end, "Append End")) {
-         set_jcr_job_status(jcr, JS_ErrorTerminated);
+         jcr->setJobStatus(JS_ErrorTerminated);
          goto cleanup;
       }
 
@@ -2000,22 +2000,22 @@ static int verify_cmd(JCR *jcr)
    BSOCK *sd  = jcr->store_bsock;
    char level[100];
 
-   jcr->set_JobType(JT_VERIFY);
+   jcr->setJobType(JT_VERIFY);
    if (sscanf(dir->msg, verifycmd, level) != 1) {
       dir->fsend(_("2994 Bad verify command: %s\n"), dir->msg);
       return 0;
    }
 
    if (strcasecmp(level, "init") == 0) {
-      jcr->set_JobLevel(L_VERIFY_INIT);
+      jcr->setJobLevel(L_VERIFY_INIT);
    } else if (strcasecmp(level, "catalog") == 0){
-      jcr->set_JobLevel(L_VERIFY_CATALOG);
+      jcr->setJobLevel(L_VERIFY_CATALOG);
    } else if (strcasecmp(level, "volume") == 0){
-      jcr->set_JobLevel(L_VERIFY_VOLUME_TO_CATALOG);
+      jcr->setJobLevel(L_VERIFY_VOLUME_TO_CATALOG);
    } else if (strcasecmp(level, "data") == 0){
-      jcr->set_JobLevel(L_VERIFY_DATA);
+      jcr->setJobLevel(L_VERIFY_DATA);
    } else if (strcasecmp(level, "disk_to_catalog") == 0) {
-      jcr->set_JobLevel(L_VERIFY_DISK_TO_CATALOG);
+      jcr->setJobLevel(L_VERIFY_DISK_TO_CATALOG);
    } else {
       dir->fsend(_("2994 Bad verify level: %s\n"), dir->msg);
       return 0;
@@ -2160,16 +2160,16 @@ static int restore_cmd(JCR *jcr)
    dir->fsend(OKrestore);
    Dmsg1(110, "filed>dird: %s", dir->msg);
 
-   jcr->set_JobType(JT_RESTORE);
+   jcr->setJobType(JT_RESTORE);
 
-   set_jcr_job_status(jcr, JS_Blocked);
+   jcr->setJobStatus(JS_Blocked);
 
    if (!open_sd_read_session(jcr)) {
-      set_jcr_job_status(jcr, JS_ErrorTerminated);
+      jcr->setJobStatus(JS_ErrorTerminated);
       goto bail_out;
    }
 
-   set_jcr_job_status(jcr, JS_Running);
+   jcr->setJobStatus(JS_Running);
 
    /**
     * Do restore of files and data
@@ -2209,7 +2209,7 @@ static int restore_cmd(JCR *jcr)
    do_restore(jcr);
    stop_dir_heartbeat(jcr);
 
-   set_jcr_job_status(jcr, JS_Terminated);
+   jcr->setJobStatus(JS_Terminated);
    if (jcr->JobStatus != JS_Terminated) {
       bnet_suppress_error_messages(sd, 1);
    }
@@ -2254,7 +2254,7 @@ bail_out:
    bfree_and_null(jcr->where);
 
    if (jcr->JobErrors) {
-      set_jcr_job_status(jcr, JS_ErrorTerminated);
+      jcr->setJobStatus(JS_ErrorTerminated);
    }
 
    Dmsg0(100, "Done in job.c\n");
@@ -2406,7 +2406,7 @@ static int send_bootstrap_file(JCR *jcr)
       berrno be;
       Jmsg(jcr, M_FATAL, 0, _("Could not open bootstrap file %s: ERR=%s\n"),
          jcr->RestoreBootstrap, be.bstrerror());
-      set_jcr_job_status(jcr, JS_ErrorTerminated);
+      jcr->setJobStatus(JS_ErrorTerminated);
       goto bail_out;
    }
    sd->msglen = pm_strcpy(sd->msg, bootstrap);
@@ -2418,7 +2418,7 @@ static int send_bootstrap_file(JCR *jcr)
    sd->signal(BNET_EOD);
    fclose(bs);
    if (!response(jcr, sd, OKSDbootstrap, "Bootstrap")) {
-      set_jcr_job_status(jcr, JS_ErrorTerminated);
+      jcr->setJobStatus(JS_ErrorTerminated);
       goto bail_out;
    }
    stat = 1;
diff --git a/bacula/src/filed/restore.c b/bacula/src/filed/restore.c
index cb71562..542ce84 100644
--- a/bacula/src/filed/restore.c
+++ b/bacula/src/filed/restore.c
@@ -177,7 +177,7 @@ void do_restore(JCR *jcr)
    int non_support_xattr = 0;
 
    sd = jcr->store_bsock;
-   set_jcr_job_status(jcr, JS_Running);
+   jcr->setJobStatus(JS_Running);
 
    LockRes();
    CLIENT *client = (CLIENT *)GetNextRes(R_CLIENT, NULL);
@@ -188,7 +188,7 @@ void do_restore(JCR *jcr)
       buf_size = 0;                   /* use default */
    }
    if (!bnet_set_buffer_size(sd, buf_size, BNET_SETBUF_WRITE)) {
-      set_jcr_job_status(jcr, JS_ErrorTerminated);
+      jcr->setJobStatus(JS_ErrorTerminated);
       return;
    }
    jcr->buf_size = sd->msglen;
@@ -791,11 +791,11 @@ void do_restore(JCR *jcr)
    }
 
    close_previous_stream(rctx);
-   set_jcr_job_status(jcr, JS_Terminated);
+   jcr->setJobStatus(JS_Terminated);
    goto ok_out;
 
 bail_out:
-   set_jcr_job_status(jcr, JS_ErrorTerminated);
+   jcr->setJobStatus(JS_ErrorTerminated);
 
 ok_out:
    /*
diff --git a/bacula/src/filed/verify.c b/bacula/src/filed/verify.c
index 287f0a4..237e771 100644
--- a/bacula/src/filed/verify.c
+++ b/bacula/src/filed/verify.c
@@ -51,7 +51,7 @@ static int read_digest(BFILE *bfd, DIGEST *digest, JCR *jcr);
  */
 void do_verify(JCR *jcr)
 {
-   set_jcr_job_status(jcr, JS_Running);
+   jcr->setJobStatus(JS_Running);
    jcr->buf_size = DEFAULT_NETWORK_BUFFER_SIZE;
    if ((jcr->big_buf = (char *) malloc(jcr->buf_size)) == NULL) {
       Jmsg1(jcr, M_ABORT, 0, _("Cannot malloc %d network read buffer\n"),
@@ -67,7 +67,7 @@ void do_verify(JCR *jcr)
       free(jcr->big_buf);
       jcr->big_buf = NULL;
    }
-   set_jcr_job_status(jcr, JS_Terminated);
+   jcr->setJobStatus(JS_Terminated);
 }
 
 /*
diff --git a/bacula/src/filed/verify_vol.c b/bacula/src/filed/verify_vol.c
index bf0ef5c..cae6a3d 100644
--- a/bacula/src/filed/verify_vol.c
+++ b/bacula/src/filed/verify_vol.c
@@ -61,11 +61,11 @@ void do_verify_volume(JCR *jcr)
    sd = jcr->store_bsock;
    if (!sd) {
       Jmsg(jcr, M_FATAL, 0, _("Storage command not issued before Verify.\n"));
-      set_jcr_job_status(jcr, JS_FatalError);
+      jcr->setJobStatus(JS_FatalError);
       return;
    }
    dir = jcr->dir_bsock;
-   set_jcr_job_status(jcr, JS_Running);
+   jcr->setJobStatus(JS_Running);
 
    LockRes();
    CLIENT *client = (CLIENT *)GetNextRes(R_CLIENT, NULL);
@@ -77,7 +77,7 @@ void do_verify_volume(JCR *jcr)
       buf_size = 0;                   /* use default */
    }
    if (!bnet_set_buffer_size(sd, buf_size, BNET_SETBUF_WRITE)) {
-      set_jcr_job_status(jcr, JS_FatalError);
+      jcr->setJobStatus(JS_FatalError);
       return;
    }
    jcr->buf_size = sd->msglen;
@@ -246,11 +246,11 @@ void do_verify_volume(JCR *jcr)
 
       } /* end switch */
    } /* end while bnet_get */
-   set_jcr_job_status(jcr, JS_Terminated);
+   jcr->setJobStatus(JS_Terminated);
    goto ok_out;
 
 bail_out:
-   set_jcr_job_status(jcr, JS_ErrorTerminated);
+   jcr->setJobStatus(JS_ErrorTerminated);
 
 ok_out:
    if (jcr->compress_buf) {
diff --git a/bacula/src/jcr.h b/bacula/src/jcr.h
index 6e13b48..24dbca6 100644
--- a/bacula/src/jcr.h
+++ b/bacula/src/jcr.h
@@ -192,10 +192,9 @@ public:
    bool is_JobLevel(int32_t JobLevel) { return JobLevel == m_JobLevel; };
    bool is_JobType(int32_t JobType) { return JobType == m_JobType; };
    bool is_JobStatus(int32_t aJobStatus) { return aJobStatus == JobStatus; };
-   void set_JobLevel(int32_t JobLevel) { m_JobLevel = JobLevel; };
    void setJobLevel(int32_t JobLevel) { m_JobLevel = JobLevel; };
-   void set_JobType(int32_t JobType) { m_JobType = JobType; };
    void setJobType(int32_t JobType) { m_JobType = JobType; };
+   void forceJobStatus(int32_t aJobStatus) { JobStatus = aJobStatus; };
    int32_t getJobType() const { return m_JobType; };
    int32_t getJobLevel() const { return m_JobLevel; };
    int32_t getJobStatus() const { return JobStatus; };
diff --git a/bacula/src/lib/jcr.c b/bacula/src/lib/jcr.c
index 2c2d89b..3df798e 100644
--- a/bacula/src/lib/jcr.c
+++ b/bacula/src/lib/jcr.c
@@ -863,12 +863,6 @@ static int get_status_priority(int JobStatus)
    return priority;
 }
 
-
-void set_jcr_job_status(JCR *jcr, int JobStatus)
-{
-   jcr->setJobStatus(JobStatus);
-}
-
 void JCR::setJobStatus(int newJobStatus)
 {
    JCR *jcr = this;
@@ -902,7 +896,7 @@ void JCR::setJobStatus(int newJobStatus)
    }
 
    if (oldJobStatus != jcr->JobStatus) {
-      Dmsg2(800, "leave set_job_status old=%c new=%c\n", oldJobStatus, \
newJobStatus); +      Dmsg2(800, "leave setJobStatus old=%c new=%c\n", oldJobStatus, \
newJobStatus);  //    generate_plugin_event(jcr, bEventStatusChange, NULL);
    }
 }
diff --git a/bacula/src/lib/message.c b/bacula/src/lib/message.c
index 87f739f..97a3a01 100644
--- a/bacula/src/lib/message.c
+++ b/bacula/src/lib/message.c
@@ -1270,7 +1270,7 @@ Jmsg(JCR *jcr, int type, utime_t mtime, const char *fmt,...)
     case M_FATAL:
        len = bsnprintf(rbuf, sizeof(rbuf), _("%s JobId %u: Fatal error: "), my_name, \
JobId);  if (jcr) {
-          set_jcr_job_status(jcr, JS_FatalError);
+          jcr->setJobStatus(JS_FatalError);
        }
        if (jcr && jcr->JobErrors == 0) {
           jcr->JobErrors = 1;
diff --git a/bacula/src/lib/runscript.c b/bacula/src/lib/runscript.c
index 47a55c6..3cb3568 100644
--- a/bacula/src/lib/runscript.c
+++ b/bacula/src/lib/runscript.c
@@ -277,7 +277,7 @@ bool RUNSCRIPT::run(JCR *jcr, const char *name)
 bail_out:
    /* cancel running job properly */
    if (fail_on_error) {
-      set_jcr_job_status(jcr, JS_ErrorTerminated);
+      jcr->setJobStatus(JS_ErrorTerminated);
    }
    Dmsg1(100, "runscript failed. fail_on_error=%d\n", fail_on_error);
    return false;
diff --git a/bacula/src/stored/acquire.c b/bacula/src/stored/acquire.c
index 146aa45..73f985e 100644
--- a/bacula/src/stored/acquire.c
+++ b/bacula/src/stored/acquire.c
@@ -317,7 +317,7 @@ default_path:
 
    dev->clear_append();
    dev->set_read();
-   set_jcr_job_status(jcr, JS_Running);
+   jcr->setJobStatus(JS_Running);
    dir_send_job_status(jcr);
    Jmsg(jcr, M_INFO, 0, _("Ready to read from volume \"%s\" on device %s.\n"),
       dcr->VolumeName, dev->print_name());
diff --git a/bacula/src/stored/append.c b/bacula/src/stored/append.c
index 72bf6ab..47af0d9 100644
--- a/bacula/src/stored/append.c
+++ b/bacula/src/stored/append.c
@@ -94,17 +94,17 @@ bool do_append_data(JCR *jcr)
    memset(&rec, 0, sizeof(rec));
 
    if (!fd->set_buffer_size(dcr->device->max_network_buffer_size, \
                BNET_SETBUF_WRITE)) {
-      set_jcr_job_status(jcr, JS_ErrorTerminated);
+      jcr->setJobStatus(JS_ErrorTerminated);
       Jmsg0(jcr, M_FATAL, 0, _("Unable to set network buffer size.\n"));
       return false;
    }
 
    if (!acquire_device_for_append(dcr)) {
-      set_jcr_job_status(jcr, JS_ErrorTerminated);
+      jcr->setJobStatus(JS_ErrorTerminated);
       return false;
    }
 
-   set_jcr_job_status(jcr, JS_Running);
+   jcr->setJobStatus(JS_Running);
    dir_send_job_status(jcr);
 
    if (dev->VolCatInfo.VolCatName[0] == 0) {
@@ -125,7 +125,7 @@ bool do_append_data(JCR *jcr)
    if (!write_session_label(dcr, SOS_LABEL)) {
       Jmsg1(jcr, M_FATAL, 0, _("Write session label failed. ERR=%s\n"),
          dev->bstrerror());
-      set_jcr_job_status(jcr, JS_ErrorTerminated);
+      jcr->setJobStatus(JS_ErrorTerminated);
       ok = false;
    }
    if (dev->VolCatInfo.VolCatName[0] == 0) {
@@ -266,7 +266,7 @@ fi_checked:
    }
 
    /* Create Job status for end of session label */
-   set_jcr_job_status(jcr, ok?JS_Terminated:JS_ErrorTerminated);
+   jcr->setJobStatus(ok?JS_Terminated:JS_ErrorTerminated);
 
    if (ok) {
       /* Terminate connection with FD */
@@ -305,7 +305,7 @@ fi_checked:
                   dev->bstrerror());
             possible_incomplete_job(jcr, last_file_index);
          }
-         set_jcr_job_status(jcr, JS_ErrorTerminated);
+         jcr->setJobStatus(JS_ErrorTerminated);
          ok = false;
       }
       if (dev->VolCatInfo.VolCatName[0] == 0) {
@@ -322,7 +322,7 @@ fi_checked:
             Dmsg0(100, _("Set ok=FALSE after write_block_to_device.\n"));
             possible_incomplete_job(jcr, last_file_index);
          }
-         set_jcr_job_status(jcr, JS_ErrorTerminated);
+         jcr->setJobStatus(JS_ErrorTerminated);
          ok = false;
       }
    }
diff --git a/bacula/src/stored/askdir.c b/bacula/src/stored/askdir.c
index 0d4b998..09eaf70 100644
--- a/bacula/src/stored/askdir.c
+++ b/bacula/src/stored/askdir.c
@@ -546,7 +546,7 @@ bool dir_ask_sysop_to_create_appendable_volume(DCR *dcr)
          }
       }
 
-      set_jcr_job_status(jcr, JS_WaitMedia);
+      jcr->setJobStatus(JS_WaitMedia);
       dir_send_job_status(jcr);
 
       stat = wait_for_sysop(dcr);
@@ -576,7 +576,7 @@ bool dir_ask_sysop_to_create_appendable_volume(DCR *dcr)
    }
 
 get_out:
-   set_jcr_job_status(jcr, JS_Running);
+   jcr->setJobStatus(JS_Running);
    dir_send_job_status(jcr);
    Dmsg0(100, "leave dir_ask_sysop_to_mount_create_appendable_volume\n");
    return true;
@@ -647,7 +647,7 @@ bool dir_ask_sysop_to_mount_volume(DCR *dcr, int mode)
                dcr->VolumeName, dev->print_name(), jcr->Job);
       }
 
-      set_jcr_job_status(jcr, JS_WaitMount);
+      jcr->setJobStatus(JS_WaitMount);
       dir_send_job_status(jcr);
 
       stat = wait_for_sysop(dcr);          /* wait on device */
@@ -679,7 +679,7 @@ bool dir_ask_sysop_to_mount_volume(DCR *dcr, int mode)
    }
 
 get_out:
-   set_jcr_job_status(jcr, JS_Running);
+   jcr->setJobStatus(JS_Running);
    dir_send_job_status(jcr);
    Dmsg0(400, "leave dir_ask_sysop_to_mount_volume\n");
    return true;
diff --git a/bacula/src/stored/bscan.c b/bacula/src/stored/bscan.c
index 1a69581..0e11790 100644
--- a/bacula/src/stored/bscan.c
+++ b/bacula/src/stored/bscan.c
@@ -539,7 +539,7 @@ static bool record_cb(DCR *dcr, DEV_RECORD *rec)
 
          jr.PoolId = pr.PoolId;
          mjcr->start_time = jr.StartTime;
-         mjcr->set_JobLevel(jr.JobLevel);
+         mjcr->setJobLevel(jr.JobLevel);
 
          mjcr->client_name = get_pool_memory(PM_FNAME);
          pm_strcpy(mjcr->client_name, label.ClientName);
@@ -1310,8 +1310,8 @@ static JCR *create_jcr(JOB_DBR *jr, DEV_RECORD *rec, uint32_t \
                JobId)
     *   the JobId and the ClientId.
     */
    jobjcr = new_jcr(sizeof(JCR), bscan_free_jcr);
-   jobjcr->set_JobType(jr->JobType);
-   jobjcr->set_JobLevel(jr->JobLevel);
+   jobjcr->setJobType(jr->JobType);
+   jobjcr->setJobLevel(jr->JobLevel);
    jobjcr->JobStatus = jr->JobStatus;
    bstrncpy(jobjcr->Job, jr->Job, sizeof(jobjcr->Job));
    jobjcr->JobId = JobId;      /* this is JobId on tape */
diff --git a/bacula/src/stored/btape.c b/bacula/src/stored/btape.c
index 871697b..bc52836 100644
--- a/bacula/src/stored/btape.c
+++ b/bacula/src/stored/btape.c
@@ -2212,7 +2212,7 @@ static void fillcmd()
     */
    Dmsg0(100, "just before acquire_device\n");
    if (!acquire_device_for_append(dcr)) {
-      set_jcr_job_status(jcr, JS_ErrorTerminated);
+      jcr->setJobStatus(JS_ErrorTerminated);
       exit_code = 1;
       return;
    }
@@ -2223,7 +2223,7 @@ static void fillcmd()
     * Write Begin Session Record
     */
    if (!write_session_label(dcr, SOS_LABEL)) {
-      set_jcr_job_status(jcr, JS_ErrorTerminated);
+      jcr->setJobStatus(JS_ErrorTerminated);
       Jmsg1(jcr, M_FATAL, 0, _("Write session label failed. ERR=%s\n"),
          dev->bstrerror());
       ok = false;
@@ -2336,10 +2336,10 @@ static void fillcmd()
       Dmsg0(100, "Write_end_session_label()\n");
       /* Create Job status for end of session label */
       if (!job_canceled(jcr) && ok) {
-         set_jcr_job_status(jcr, JS_Terminated);
+         jcr->setJobStatus(JS_Terminated);
       } else if (!ok) {
          Pmsg0(000, _("Job canceled.\n"));
-         set_jcr_job_status(jcr, JS_ErrorTerminated);
+         jcr->setJobStatus(JS_ErrorTerminated);
          exit_code = 1;
       }
       if (!write_session_label(dcr, EOS_LABEL)) {
diff --git a/bacula/src/stored/butil.c b/bacula/src/stored/butil.c
index 1cfde18..8d1f9c3 100644
--- a/bacula/src/stored/butil.c
+++ b/bacula/src/stored/butil.c
@@ -92,8 +92,8 @@ JCR *setup_jcr(const char *name, char *dev_name, BSR *bsr,
    jcr->NumReadVolumes = 0;
    jcr->NumWriteVolumes = 0;
    jcr->JobId = 0;
-   jcr->set_JobType(JT_CONSOLE);
-   jcr->set_JobLevel(L_FULL);
+   jcr->setJobType(JT_CONSOLE);
+   jcr->setJobLevel(L_FULL);
    jcr->JobStatus = JS_Terminated;
    jcr->where = bstrdup("");
    jcr->job_name = get_pool_memory(PM_FNAME);
diff --git a/bacula/src/stored/fd_cmds.c b/bacula/src/stored/fd_cmds.c
index 110a6bf..09c9b88 100644
--- a/bacula/src/stored/fd_cmds.c
+++ b/bacula/src/stored/fd_cmds.c
@@ -118,12 +118,12 @@ void run_job(JCR *jcr)
    dir->fsend(Job_start, jcr->Job);
    jcr->start_time = time(NULL);
    jcr->run_time = jcr->start_time;
-   set_jcr_job_status(jcr, JS_Running);
+   jcr->setJobStatus(JS_Running);
    dir_send_job_status(jcr);          /* update director */
    do_fd_commands(jcr);
    jcr->end_time = time(NULL);
    dequeue_messages(jcr);             /* send any queued messages */
-   set_jcr_job_status(jcr, JS_Terminated);
+   jcr->setJobStatus(JS_Terminated);
    generate_daemon_event(jcr, "JobEnd");
    dir->fsend(Job_end, jcr->Job, jcr->JobStatus, jcr->JobFiles,
       edit_uint64(jcr->JobBytes, ec1), jcr->JobErrors);
@@ -167,7 +167,7 @@ void do_fd_commands(JCR *jcr)
                   } else {
                      Jmsg0(jcr, M_FATAL, 0, _("Command error with FD, hanging \
up.\n"));  }
-                  set_jcr_job_status(jcr, JS_ErrorTerminated);
+                  jcr->setJobStatus(JS_ErrorTerminated);
                }
                quit = true;
             }
@@ -198,7 +198,7 @@ static bool append_data_cmd(JCR *jcr)
    Dmsg1(120, "Append data: %s", fd->msg);
    if (jcr->session_opened) {
       Dmsg1(110, "<bfiled: %s", fd->msg);
-      jcr->set_JobType(JT_BACKUP);
+      jcr->setJobType(JT_BACKUP);
       if (do_append_data(jcr)) {
          return true;
       } else {
@@ -331,7 +331,7 @@ static bool read_open_session(JCR *jcr)
    }
 
    jcr->session_opened = true;
-   jcr->set_JobType(JT_RESTORE);
+   jcr->setJobType(JT_RESTORE);
 
    /* Send "Ticket" to File Daemon */
    fd->fsend(OK_open, jcr->VolSessionId);
diff --git a/bacula/src/stored/job.c b/bacula/src/stored/job.c
index aab7afb..9fa42e1 100644
--- a/bacula/src/stored/job.c
+++ b/bacula/src/stored/job.c
@@ -93,7 +93,7 @@ bool job_cmd(JCR *jcr)
       pm_strcpy(jcr->errmsg, dir->msg);
       dir->fsend(BAD_job, stat, jcr->errmsg);
       Dmsg1(100, ">dird: %s", dir->msg);
-      set_jcr_job_status(jcr, JS_ErrorTerminated);
+      jcr->setJobStatus(JS_ErrorTerminated);
       return false;
    }
    Dmsg3(100, "==== incomplete=%d VolSesId=%d VolSesTime=%d\n", jcr->incomplete,
@@ -129,8 +129,8 @@ bool job_cmd(JCR *jcr)
    unbash_spaces(fileset_name);
    jcr->fileset_name = get_pool_memory(PM_NAME);
    pm_strcpy(jcr->fileset_name, fileset_name);
-   jcr->set_JobType(JobType);
-   jcr->set_JobLevel(level);
+   jcr->setJobType(JobType);
+   jcr->setJobLevel(level);
    jcr->no_attributes = no_attributes;
    jcr->spool_attributes = spool_attributes;
    jcr->spool_data = spool_data;
@@ -174,7 +174,7 @@ bool run_cmd(JCR *jcr)
       return false;
    }
 
-   set_jcr_job_status(jcr, JS_WaitFD);          /* wait for FD to connect */
+   jcr->setJobStatus(JS_WaitFD);          /* wait for FD to connect */
    dir_send_job_status(jcr);
 
    gettimeofday(&tv, &tz);
@@ -261,7 +261,7 @@ void handle_filed_connection(BSOCK *fd, char *job_name)
    }
 
    if (!jcr->authenticated) {
-      set_jcr_job_status(jcr, JS_ErrorTerminated);
+      jcr->setJobStatus(JS_ErrorTerminated);
    }
    pthread_cond_signal(&jcr->job_start_wait); /* wake waiting job */
    free_jcr(jcr);
diff --git a/bacula/src/stored/mac.c b/bacula/src/stored/mac.c
index 5641e7e..d4de7c1 100644
--- a/bacula/src/stored/mac.c
+++ b/bacula/src/stored/mac.c
@@ -94,13 +94,13 @@ bool do_mac(JCR *jcr)
    /* Ready devices for reading and writing */
    if (!acquire_device_for_read(jcr->read_dcr) ||
        !acquire_device_for_append(jcr->dcr)) {
-      set_jcr_job_status(jcr, JS_ErrorTerminated);
+      jcr->setJobStatus(JS_ErrorTerminated);
       goto bail_out;
    }
 
    Dmsg2(200, "===== After acquire pos %u:%u\n", jcr->dcr->dev->file, \
jcr->dcr->dev->block_num);  
-   set_jcr_job_status(jcr, JS_Running);
+   jcr->setJobStatus(JS_Running);
    dir_send_job_status(jcr);
 
    begin_data_spool(jcr->dcr);
@@ -164,7 +164,7 @@ ok_out:
    jcr->end_time = time(NULL);
    dequeue_messages(jcr);             /* send any queued messages */
    if (ok) {
-      set_jcr_job_status(jcr, JS_Terminated);
+      jcr->setJobStatus(JS_Terminated);
    }
    generate_daemon_event(jcr, "JobEnd");
    dir->fsend(Job_end, jcr->Job, jcr->JobStatus, jcr->JobFiles,
diff --git a/bacula/src/stored/read.c b/bacula/src/stored/read.c
index c0f87e9..c6f1c28 100644
--- a/bacula/src/stored/read.c
+++ b/bacula/src/stored/read.c
@@ -78,7 +78,7 @@ bool do_read_data(JCR *jcr)
 
    /* Tell File daemon we will send data */
    fd->fsend(OK_data);
-   set_jcr_job_status(jcr, JS_Running);
+   jcr->setJobStatus(JS_Running);
    dir_send_job_status(jcr);
    ok = read_records(dcr, record_cb, mount_next_read_volume);
 
diff --git a/bacula/src/stored/reserve.c b/bacula/src/stored/reserve.c
index 3223d88..0176e75 100644
--- a/bacula/src/stored/reserve.c
+++ b/bacula/src/stored/reserve.c
@@ -69,7 +69,7 @@ bool use_cmd(JCR *jcr)
     * Get the device, media, and pool information
     */
    if (!use_storage_cmd(jcr)) {
-      set_jcr_job_status(jcr, JS_ErrorTerminated);
+      jcr->setJobStatus(JS_ErrorTerminated);
       memset(jcr->sd_auth_key, 0, strlen(jcr->sd_auth_key));
       return false;
    }
diff --git a/bacula/src/stored/spool.c b/bacula/src/stored/spool.c
index 898700d..f152ba1 100644
--- a/bacula/src/stored/spool.c
+++ b/bacula/src/stored/spool.c
@@ -234,13 +234,13 @@ static bool despool_data(DCR *dcr, bool commit)
       Jmsg(jcr, M_INFO, 0, _("Committing spooled data to Volume \"%s\". Despooling \
%s bytes ...\n"),  jcr->dcr->VolumeName,
          edit_uint64_with_commas(jcr->dcr->job_spool_size, ec1));
-      set_jcr_job_status(jcr, JS_DataCommitting);
+      jcr->setJobStatus(JS_DataCommitting);
    } else {
       Jmsg(jcr, M_INFO, 0, _("Writing spooled data to Volume. Despooling %s bytes \
...\n"),  edit_uint64_with_commas(jcr->dcr->job_spool_size, ec1));
-      set_jcr_job_status(jcr, JS_DataDespooling);
+      jcr->setJobStatus(JS_DataDespooling);
    }
-   set_jcr_job_status(jcr, JS_DataDespooling);
+   jcr->setJobStatus(JS_DataDespooling);
    dir_send_job_status(jcr);
    dcr->despool_wait = true;
    dcr->spooling = false;
@@ -302,6 +302,8 @@ static bool despool_data(DCR *dcr, bool commit)
                dcr->dev->print_name(), dcr->dev->bstrerror());
          Dmsg2(000, "Fatal append error on device %s: ERR=%s\n",
                dcr->dev->print_name(), dcr->dev->bstrerror());
+         /* Force in case Incomplete set */
+         jcr->forceJobStatus(JS_FatalError);
       }
       Dmsg3(800, "Write block ok=%d FI=%d LI=%d\n", ok, block->FirstIndex, \
block->LastIndex);  }
@@ -319,6 +321,7 @@ static bool despool_data(DCR *dcr, bool commit)
    if (!dir_create_jobmedia_record(dcr)) {
       Jmsg2(jcr, M_FATAL, 0, _("Could not create JobMedia record for Volume=\"%s\" \
Job=%s\n"),  dcr->getVolCatName(), jcr->Job);
+      jcr->forceJobStatus(JS_FatalError);  /* override any Incomplete */
    }
    /* Set new file/block parameters for current dcr */
    set_new_file_parameters(dcr);
@@ -334,7 +337,7 @@ static bool despool_data(DCR *dcr, bool commit)
       despool_elapsed = 1;
    }
 
-   Jmsg(dcr->jcr, M_INFO, 0, _("Despooling elapsed time = %02d:%02d:%02d, Transfer \
rate = %s Bytes/second\n"), +   Jmsg(jcr, M_INFO, 0, _("Despooling elapsed time = \
                %02d:%02d:%02d, Transfer rate = %s Bytes/second\n"),
          despool_elapsed / 3600, despool_elapsed % 3600 / 60, despool_elapsed % 60,
          edit_uint64_with_suffix(jcr->dcr->job_spool_size / despool_elapsed, ec1));
 
@@ -343,7 +346,7 @@ static bool despool_data(DCR *dcr, bool commit)
    lseek(rdcr->spool_fd, 0, SEEK_SET); /* rewind */
    if (ftruncate(rdcr->spool_fd, 0) != 0) {
       berrno be;
-      Jmsg(dcr->jcr, M_ERROR, 0, _("Ftruncate spool file failed: ERR=%s\n"),
+      Jmsg(jcr, M_ERROR, 0, _("Ftruncate spool file failed: ERR=%s\n"),
          be.bstrerror());
       /* Note, try continuing despite ftruncate problem */
    }
@@ -375,7 +378,7 @@ static bool despool_data(DCR *dcr, bool commit)
    if (!commit) {
       dcr->dev->dunblock();
    }
-   set_jcr_job_status(jcr, JS_Running);
+   jcr->setJobStatus(JS_Running);
    dir_send_job_status(jcr);
    return ok;
 }
@@ -393,6 +396,7 @@ static int read_block_from_spool_file(DCR *dcr)
    ssize_t stat;
    spool_hdr hdr;
    DEV_BLOCK *block = dcr->block;
+   JCR *jcr = dcr->jcr;
 
    rlen = sizeof(hdr);
    stat = read(dcr->spool_fd, (char *)&hdr, (size_t)rlen);
@@ -406,20 +410,23 @@ static int read_block_from_spool_file(DCR *dcr)
               be.bstrerror());
       } else {
          Pmsg2(000, _("Spool read error. Wanted %u bytes, got %d\n"), rlen, stat);
-         Jmsg2(dcr->jcr, M_FATAL, 0, _("Spool header read error. Wanted %u bytes, \
got %d\n"), rlen, stat); +         Jmsg2(jcr, M_FATAL, 0, _("Spool header read error. \
Wanted %u bytes, got %d\n"), rlen, stat);  }
+      jcr->forceJobStatus(JS_FatalError);  /* override any Incomplete */
       return RB_ERROR;
    }
    rlen = hdr.len;
    if (rlen > block->buf_len) {
       Pmsg2(000, _("Spool block too big. Max %u bytes, got %u\n"), block->buf_len, \
                rlen);
-      Jmsg2(dcr->jcr, M_FATAL, 0, _("Spool block too big. Max %u bytes, got %u\n"), \
block->buf_len, rlen); +      Jmsg2(jcr, M_FATAL, 0, _("Spool block too big. Max %u \
bytes, got %u\n"), block->buf_len, rlen); +      jcr->forceJobStatus(JS_FatalError);  \
/* override any Incomplete */  return RB_ERROR;
    }
    stat = read(dcr->spool_fd, (char *)block->buf, (size_t)rlen);
    if (stat != (ssize_t)rlen) {
       Pmsg2(000, _("Spool data read error. Wanted %u bytes, got %d\n"), rlen, stat);
       Jmsg2(dcr->jcr, M_FATAL, 0, _("Spool data read error. Wanted %u bytes, got \
%d\n"), rlen, stat); +      jcr->forceJobStatus(JS_FatalError);  /* override any \
Incomplete */  return RB_ERROR;
    }
    /* Setup write pointers */
@@ -510,6 +517,7 @@ static bool write_spool_header(DCR *dcr)
    spool_hdr hdr;
    ssize_t stat;
    DEV_BLOCK *block = dcr->block;
+   JCR *jcr = dcr->jcr;
 
    hdr.FirstIndex = block->FirstIndex;
    hdr.LastIndex = block->LastIndex;
@@ -520,11 +528,12 @@ static bool write_spool_header(DCR *dcr)
       stat = write(dcr->spool_fd, (char*)&hdr, sizeof(hdr));
       if (stat == -1) {
          berrno be;
-         Jmsg(dcr->jcr, M_FATAL, 0, _("Error writing header to spool file. \
ERR=%s\n"), +         Jmsg(jcr, M_FATAL, 0, _("Error writing header to spool file. \
ERR=%s\n"),  be.bstrerror());
+         jcr->forceJobStatus(JS_FatalError);  /* override any Incomplete */
       }
       if (stat != (ssize_t)sizeof(hdr)) {
-         Jmsg(dcr->jcr, M_ERROR, 0, _("Error writing header to spool file."
+         Jmsg(jcr, M_ERROR, 0, _("Error writing header to spool file."
               " Disk probably full. Attempting recovery. Wanted to write=%d \
got=%d\n"),  (int)stat, (int)sizeof(hdr));
          /* If we wrote something, truncate it, then despool */
@@ -542,14 +551,16 @@ static bool write_spool_header(DCR *dcr)
             }
          }
          if (!despool_data(dcr, false)) {
-            Jmsg(dcr->jcr, M_FATAL, 0, _("Fatal despooling error."));
+            Jmsg(jcr, M_FATAL, 0, _("Fatal despooling error."));
+            jcr->forceJobStatus(JS_FatalError);  /* override any Incomplete */
             return false;
          }
          continue;                    /* try again */
       }
       return true;
    }
-   Jmsg(dcr->jcr, M_FATAL, 0, _("Retrying after header spooling error failed.\n"));
+   Jmsg(jcr, M_FATAL, 0, _("Retrying after header spooling error failed.\n"));
+   jcr->forceJobStatus(JS_FatalError);  /* override any Incomplete */
    return false;
 }
 
@@ -557,14 +568,16 @@ static bool write_spool_data(DCR *dcr)
 {
    ssize_t stat;
    DEV_BLOCK *block = dcr->block;
+   JCR *jcr = dcr->jcr;
 
    /* Write data */
    for (int retry=0; retry<=1; retry++) {
       stat = write(dcr->spool_fd, block->buf, (size_t)block->binbuf);
       if (stat == -1) {
          berrno be;
-         Jmsg(dcr->jcr, M_FATAL, 0, _("Error writing data to spool file. ERR=%s\n"),
+         Jmsg(jcr, M_FATAL, 0, _("Error writing data to spool file. ERR=%s\n"),
               be.bstrerror());
+         jcr->forceJobStatus(JS_FatalError);  /* override any Incomplete */
       }
       if (stat != (ssize_t)block->binbuf) {
          /*
@@ -584,7 +597,8 @@ static bool write_spool_data(DCR *dcr)
             }
          }
          if (!despool_data(dcr, false)) {
-            Jmsg(dcr->jcr, M_FATAL, 0, _("Fatal despooling error."));
+            Jmsg(jcr, M_FATAL, 0, _("Fatal despooling error."));
+            jcr->forceJobStatus(JS_FatalError);  /* override any Incomplete */
             return false;
          }
          if (!write_spool_header(dcr)) {
@@ -594,7 +608,8 @@ static bool write_spool_data(DCR *dcr)
       }
       return true;
    }
-   Jmsg(dcr->jcr, M_FATAL, 0, _("Retrying after data spooling error failed.\n"));
+   Jmsg(jcr, M_FATAL, 0, _("Retrying after data spooling error failed.\n"));
+   jcr->forceJobStatus(JS_FatalError);  /* override any Incomplete */
    return false;
 }
 
@@ -664,6 +679,7 @@ static bool blast_attr_spool_file(JCR *jcr, boffset_t size)
    
    if (jcr->dir_bsock->recv() <= 0) {
       Jmsg(jcr, M_FATAL, 0, _("Network error on BlastAttributes.\n"));
+      jcr->forceJobStatus(JS_FatalError);  /* override any Incomplete */
       return false;
    }
    
@@ -688,6 +704,7 @@ bool commit_attribute_spool(JCR *jcr)
          berrno be;
          Jmsg(jcr, M_FATAL, 0, _("Fseek on attributes file failed: ERR=%s\n"),
               be.bstrerror());
+         jcr->forceJobStatus(JS_FatalError);  /* override any Incomplete */
          goto bail_out;
       }
       size = ftello(dir->m_spool_fd);
@@ -699,6 +716,7 @@ bool commit_attribute_spool(JCR *jcr)
                berrno be;
                Jmsg(jcr, M_FATAL, 0, _("Truncate on attributes file failed: \
ERR=%s\n"),  be.bstrerror());
+               jcr->forceJobStatus(JS_FatalError);  /* override any Incomplete */
                goto bail_out;
             }
             Dmsg2(100, "=== Attrib spool truncated from %lld to %lld\n", 
@@ -710,6 +728,7 @@ bool commit_attribute_spool(JCR *jcr)
          berrno be;
          Jmsg(jcr, M_FATAL, 0, _("Fseek on attributes file failed: ERR=%s\n"),
               be.bstrerror());
+         jcr->forceJobStatus(JS_FatalError);  /* override any Incomplete */
          goto bail_out;
       }
       P(mutex);
@@ -718,7 +737,7 @@ bool commit_attribute_spool(JCR *jcr)
       }
       spool_stats.attr_size += size;
       V(mutex);
-      set_jcr_job_status(jcr, JS_AttrDespooling);
+      jcr->setJobStatus(JS_AttrDespooling);
       dir_send_job_status(jcr);
       Jmsg(jcr, M_INFO, 0, _("Sending spooled attrs to the Director. Despooling %s \
bytes ...\n"),  edit_uint64_with_commas(size, ec1));
@@ -748,6 +767,7 @@ static bool open_attr_spool_file(JCR *jcr, BSOCK *bs)
       berrno be;
       Jmsg(jcr, M_FATAL, 0, _("fopen attr spool file %s failed: ERR=%s\n"), name,
            be.bstrerror());
+      jcr->forceJobStatus(JS_FatalError);  /* override any Incomplete */
       free_pool_memory(name);
       return false;
    }
diff --git a/bacula/src/stored/stored.c b/bacula/src/stored/stored.c
index e9f4d15..4c485ad 100644
--- a/bacula/src/stored/stored.c
+++ b/bacula/src/stored/stored.c
@@ -523,7 +523,7 @@ void *device_initialization(void *arg)
 
    pthread_detach(pthread_self());
    jcr = new_jcr(sizeof(JCR), stored_free_jcr);
-   jcr->set_JobType(JT_SYSTEM);
+   jcr->setJobType(JT_SYSTEM);
    /* Initialize FD start condition variable */
    int errstat = pthread_cond_init(&jcr->job_start_wait, NULL);
    if (errstat != 0) {
@@ -612,7 +612,7 @@ void terminate_stored(int sig)
             free_jcr(jcr);
             continue;                 /* ignore console */
          }
-         set_jcr_job_status(jcr, JS_Canceled);
+         jcr->setJobStatus(JS_Canceled);
          fd = jcr->file_bsock;
          if (fd) {
             fd->set_timed_out();
diff --git a/bacula/src/tools/bbatch.c b/bacula/src/tools/bbatch.c
index 61f57ae..00244f0 100644
--- a/bacula/src/tools/bbatch.c
+++ b/bacula/src/tools/bbatch.c
@@ -131,10 +131,10 @@ int main (int argc, char *argv[])
          restore_list=bstrdup(optarg);
          break;
       case 'B':
-	 disable_batch = true;
+         disable_batch = true;
          break;
       case 'b':
-	 disable_batch = false;
+         disable_batch = false;
          break;
       case 'd':                    /* debug level */
          if (*optarg == 't') {
@@ -231,8 +231,8 @@ int main (int argc, char *argv[])
       bjcr->NumReadVolumes = 0;
       bjcr->NumWriteVolumes = 0;
       bjcr->JobId = getpid();
-      bjcr->set_JobType(JT_CONSOLE);
-      bjcr->set_JobLevel(L_FULL);
+      bjcr->setJobType(JT_CONSOLE);
+      bjcr->setJobLevel(L_FULL);
       bjcr->JobStatus = JS_Running;
       bjcr->where = bstrdup(files[i]);
       bjcr->job_name = get_pool_memory(PM_FNAME);
diff --git a/bacula/src/tools/bvfs_test.c b/bacula/src/tools/bvfs_test.c
index 2cfbd13..545591c 100644
--- a/bacula/src/tools/bvfs_test.c
+++ b/bacula/src/tools/bvfs_test.c
@@ -204,8 +204,8 @@ int main (int argc, char *argv[])
    }
    JCR *bjcr = new_jcr(sizeof(JCR), NULL);
    bjcr->JobId = getpid();
-   bjcr->set_JobType(JT_CONSOLE);
-   bjcr->set_JobLevel(L_FULL);
+   bjcr->setJobType(JT_CONSOLE);
+   bjcr->setJobLevel(L_FULL);
    bjcr->JobStatus = JS_Running;
    bjcr->client_name = get_pool_memory(PM_FNAME);
    pm_strcpy(bjcr->client_name, "Dummy.Client.Name");


hooks/post-receive
-- 
Bacula

------------------------------------------------------------------------------
Free Software Download: Index, Search & Analyze Logs and other IT data in 
Real-Time with Splunk. Collect, index and harness all the fast moving IT data 
generated by your applications, servers and devices whether physical, virtual
or in the cloud. Deliver compliance at lower cost and gain new business 
insights. http://p.sf.net/sfu/splunk-dev2dev 
_______________________________________________
Bacula-commits mailing list
Bacula-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-commits


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic