]> git.sur5r.net Git - bacula/bacula/commitdiff
Add MaximumBandwidth to Director Job resource
authorEric Bollengier <eric@eb.homelinux.org>
Thu, 25 Nov 2010 11:39:33 +0000 (12:39 +0100)
committerEric Bollengier <eric@eb.homelinux.org>
Thu, 25 Nov 2010 14:21:58 +0000 (15:21 +0100)
bacula/src/dird/dird_conf.c
bacula/src/dird/dird_conf.h

index a82289878cc61072b36201c6f2b208bc8dc7145c..a3d9639aec8baad39b631f7f028b8ca519ae7bdb 100644 (file)
@@ -202,6 +202,7 @@ static RES_ITEM cli_items[] = {
    {"tlscertificate",       store_dir,       ITEM(res_client.tls_certfile), 0, 0, 0},
    {"tlskey",               store_dir,       ITEM(res_client.tls_keyfile), 0, 0, 0},
    {"tlsallowedcn",         store_alist_str, ITEM(res_client.tls_allowed_cns), 0, 0, 0},
+   {"maximumbandwidth",     store_speed, ITEM(res_client.max_bandwidth), 0, 0, 0},
    {NULL, NULL, {0}, 0, 0, 0}
 };
 
@@ -294,6 +295,7 @@ RES_ITEM job_items[] = {
    {"writebootstrap",store_dir, ITEM(res_job.WriteBootstrap), 0, 0, 0},
    {"writeverifylist",store_dir,ITEM(res_job.WriteVerifyList), 0, 0, 0},
    {"replace",  store_replace,  ITEM(res_job.replace), 0, ITEM_DEFAULT, REPLACE_ALWAYS},
+   {"maximumbandwidth", store_speed, ITEM(res_job.max_bandwidth), 0, 0, 0},
    {"maxrunschedtime", store_time, ITEM(res_job.MaxRunSchedTime), 0, 0, 0},
    {"maxruntime",   store_time, ITEM(res_job.MaxRunTime), 0, 0, 0},
    /* xxxMaxWaitTime are deprecated */
@@ -604,6 +606,10 @@ void dump_resource(int type, RES *reshdr, void sendit(void *sock, const char *fm
          edit_utime(res->res_client.JobRetention, ed1, sizeof(ed1)),
          edit_utime(res->res_client.FileRetention, ed2, sizeof(ed2)),
          res->res_client.AutoPrune);
+      if (res->res_client.max_bandwidth) {
+         sendit(sock, _("     MaximumBandwidth=%lld\n"), 
+                res->res_client.max_bandwidth);
+      }
       if (res->res_client.catalog) {
          sendit(sock, _("  --> "));
          dump_resource(-R_CATALOG, (RES *)res->res_client.catalog, sendit, sock);
@@ -660,6 +666,10 @@ void dump_resource(int type, RES *reshdr, void sendit(void *sock, const char *fm
       if (res->res_job.JobType == JT_BACKUP) {
          sendit(sock, _("     Accurate=%d\n"), res->res_job.accurate);
       }
+      if (res->res_job.max_bandwidth) {
+         sendit(sock, _("     MaximumBandwidth=%lld\n"), 
+                res->res_job.max_bandwidth);
+      }
       if (res->res_job.JobType == JT_MIGRATE || res->res_job.JobType == JT_COPY) {
          sendit(sock, _("     SelectionType=%d\n"), res->res_job.selection_type);
       }
index 48bb7703d54ba2d7d53da6a22c1b156e1cad8913..4b67ac7a9adeca01bc3787ab3e0c0eebc16e138b 100644 (file)
@@ -270,6 +270,7 @@ public:
    bool tls_enable;                   /* Enable TLS */
    bool tls_require;                  /* Require TLS */
    bool AutoPrune;                    /* Do automatic pruning? */
+   int64_t max_bandwidth;             /* Limit speed on this client */
 
    /* Methods */
    char *name() const;
@@ -437,6 +438,7 @@ public:
    bool CancelQueuedDuplicates;       /* Cancel queued jobs */
    bool CancelRunningDuplicates;      /* Cancel Running jobs */
    alist *base;                       /* Base jobs */   
+   int64_t max_bandwidth;             /* Speed limit on this job */
 
    /* Methods */
    char *name() const;