]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/dird/ua_status.c
kes Apply Eric's patch to ensure that autoprune does not return
[bacula/bacula] / bacula / src / dird / ua_status.c
index 92b3eba8537ad546c51d2f3b44b07a409ce47b3e..81bf553ade9cacbd30cd0532f9bbbb89ec3b5d6c 100644 (file)
@@ -47,6 +47,7 @@ static void do_storage_status(UAContext *ua, STORE *store, char *cmd);
 static void do_client_status(UAContext *ua, CLIENT *client, char *cmd);
 static void do_director_status(UAContext *ua);
 static void do_all_status(UAContext *ua);
+void status_slots(UAContext *ua, STORE *store);
 
 static char OKqstatus[]   = "1000 OK .status\n";
 static char DotStatusJob[] = "JobId=%s JobStatus=%c JobErrors=%d\n";
@@ -157,7 +158,11 @@ int status_cmd(UAContext *ua, const char *cmd)
       } else {
          store = get_storage_resource(ua, false/*no default*/);
          if (store) {
-            do_storage_status(ua, store, NULL);
+           if (find_arg(ua, NT_("slots")) > 0) {
+              status_slots(ua, store);
+           } else {
+              do_storage_status(ua, store, NULL);
+           }
          }
          return 1;
       }
@@ -432,7 +437,9 @@ static void prt_runtime(UAContext *ua, sched_pkt *sp)
    bool close_db = false;
    JCR *jcr = ua->jcr;
    MEDIA_DBR mr;
+   int orig_jobtype;
 
+   orig_jobtype = jcr->JobType;
    memset(&mr, 0, sizeof(mr));
    if (sp->job->JobType == JT_BACKUP) {
       jcr->db = NULL;
@@ -475,6 +482,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->JobType = orig_jobtype;
 }
 
 /*