]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/dird/ua_status.c
Ensure that StorageId is updated after write
[bacula/bacula] / bacula / src / dird / ua_status.c
index b6d2b0d93490ff566c3f8e1e115e96acb4e78033..c2a2053e758f7c82e69092c5bfe215dea753d321 100644 (file)
@@ -1,7 +1,7 @@
 /*
    Bacula® - The Network Backup Solution
 
-   Copyright (C) 2001-2008 Free Software Foundation Europe e.V.
+   Copyright (C) 2001-2012 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.
@@ -31,7 +31,6 @@
  *
  *     Kern Sibbald, August MMI
  *
- *   Version $Id$
  */
 
 
@@ -295,8 +294,9 @@ void list_dir_status_header(UAContext *ua)
    ua->send_msg(_("%s Version: %s (%s) %s %s %s\n"), my_name, VERSION, BDATE,
             HOST_OS, DISTNAME, DISTVER);
    bstrftime_nc(dt, sizeof(dt), daemon_start_time);
-   ua->send_msg(_("Daemon started %s. Jobs: run=%d, running=%d\n"), dt,
-                   num_jobs_run, job_count());
+   ua->send_msg(_("Daemon started %s. Jobs: run=%d, running=%d "
+                  "mode=%d,%d\n"), dt,
+                num_jobs_run, job_count(), (int)DEVELOPER_MODE, (int)BEEF);
    ua->send_msg(_(" Heap: heap=%s smbytes=%s max_bytes=%s bufs=%s max_bufs=%s\n"),
             edit_uint64_with_commas((char *)sbrk(0)-(char *)start_heap, b1),
             edit_uint64_with_commas(sm_bytes, b2),
@@ -305,12 +305,12 @@ void list_dir_status_header(UAContext *ua)
             edit_uint64_with_commas(sm_max_buffers, b5));
 
    /* TODO: use this function once for all daemons */
-   if (debug_level > 0 && plugin_list->size() > 0) {
+   if (debug_level > 0 && bplugin_list->size() > 0) {
       int len;
       Plugin *plugin;
       POOL_MEM msg(PM_FNAME);
       pm_strcpy(msg, " Plugin: ");
-      foreach_alist(plugin, plugin_list) {
+      foreach_alist(plugin, bplugin_list) {
          len = pm_strcat(msg, plugin->file);
          if (len > 80) {
             pm_strcat(msg, "\n   ");
@@ -453,7 +453,6 @@ static void prt_runtime(UAContext *ua, sched_pkt *sp)
    int orig_jobtype;
 
    orig_jobtype = jcr->getJobType();
-   memset(&mr, 0, sizeof(mr));
    if (sp->job->JobType == JT_BACKUP) {
       jcr->db = NULL;
       ok = complete_jcr_for_job(jcr, sp->job, sp->pool);
@@ -463,8 +462,8 @@ static void prt_runtime(UAContext *ua, sched_pkt *sp)
       }
       if (ok) {
          mr.PoolId = jcr->jr.PoolId;
-         mr.StorageId = sp->store->StorageId;
          jcr->wstore = sp->store;
+         set_storageid_in_mr(jcr->wstore, &mr);
          Dmsg0(250, "call find_next_volume_for_append\n");
          /* no need to set ScratchPoolId, since we use fnv_no_create_vol */
          ok = find_next_volume_for_append(jcr, &mr, 1, fnv_no_create_vol, fnv_no_prune);
@@ -496,7 +495,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);
 }
 
 /*
@@ -678,9 +677,9 @@ static void list_running_jobs(UAContext *ua)
       case JS_WaitSD:
          emsg = (char *) get_pool_memory(PM_FNAME);
          if (jcr->wstore) {
-            Mmsg(emsg, _("is waiting on Storage %s"), jcr->wstore->name());
+            Mmsg(emsg, _("is waiting on Storage \"%s\""), jcr->wstore->name());
          } else if (jcr->rstore) {
-            Mmsg(emsg, _("is waiting on Storage %s"), jcr->rstore->name());
+            Mmsg(emsg, _("is waiting on Storage \"%s\""), jcr->rstore->name());
          } else {
             Mmsg(emsg, _("is waiting on Storage"));
          }