From 5d98572ebaafcf75069e587f63a891db2b70e9c7 Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Thu, 25 Nov 2010 12:39:33 +0100 Subject: [PATCH] Add MaximumBandwidth to Director Job resource --- bacula/src/dird/dird_conf.c | 10 ++++++++++ bacula/src/dird/dird_conf.h | 2 ++ 2 files changed, 12 insertions(+) diff --git a/bacula/src/dird/dird_conf.c b/bacula/src/dird/dird_conf.c index a82289878c..a3d9639aec 100644 --- a/bacula/src/dird/dird_conf.c +++ b/bacula/src/dird/dird_conf.c @@ -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); } diff --git a/bacula/src/dird/dird_conf.h b/bacula/src/dird/dird_conf.h index 48bb7703d5..4b67ac7a9a 100644 --- a/bacula/src/dird/dird_conf.h +++ b/bacula/src/dird/dird_conf.h @@ -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; -- 2.39.5