Skip to content
Permalink
Browse files

Merge pull request #326 from bareos/dev/franku/master/reduce-warnings

dev/franku/master/reduce warnings
  • Loading branch information...
franku committed Nov 8, 2019
2 parents ce6a9e0 + aa92714 commit 3f2b5fbb51e017d0c140c8a1fb4132c06cf068f5
Showing with 4,077 additions and 3,342 deletions.
  1. +9 −8 core/src/dird/admin.cc
  2. +9 −8 core/src/dird/archive.cc
  3. +7 −8 core/src/dird/authenticate.cc
  4. +7 −6 core/src/dird/autoprune.cc
  5. +143 −125 core/src/dird/backup.cc
  6. +10 −7 core/src/dird/bsr.cc
  7. +22 −16 core/src/dird/catreq.cc
  8. +37 −33 core/src/dird/consolidate.cc
  9. +32 −29 core/src/dird/dir_plugins.cc
  10. +15 −8 core/src/dird/dird_conf.cc
  11. +12 −11 core/src/dird/expand.cc
  12. +87 −77 core/src/dird/fd_cmds.cc
  13. +3 −2 core/src/dird/getmsg.cc
  14. +3 −2 core/src/dird/inc_conf.cc
  15. +155 −0 core/src/dird/jcr_private.h
  16. +305 −267 core/src/dird/job.cc
  17. +1 −0 core/src/dird/job.h
  18. +135 −107 core/src/dird/jobq.cc
  19. +236 −204 core/src/dird/migrate.cc
  20. +49 −45 core/src/dird/msgchan.cc
  21. +29 −24 core/src/dird/ndmp_dma_backup_NDMP_BAREOS.cc
  22. +31 −25 core/src/dird/ndmp_dma_backup_NDMP_NATIVE.cc
  23. +18 −13 core/src/dird/ndmp_dma_backup_common.cc
  24. +28 −22 core/src/dird/ndmp_dma_generic.cc
  25. +37 −34 core/src/dird/ndmp_dma_restore_NDMP_BAREOS.cc
  26. +12 −10 core/src/dird/ndmp_dma_restore_NDMP_NATIVE.cc
  27. +10 −5 core/src/dird/ndmp_dma_restore_common.cc
  28. +5 −4 core/src/dird/ndmp_dma_storage.cc
  29. +1 −0 core/src/dird/ndmp_fhdb_helpers.cc
  30. +3 −2 core/src/dird/newvol.cc
  31. +12 −11 core/src/dird/next_vol.cc
  32. +86 −75 core/src/dird/quota.cc
  33. +3 −2 core/src/dird/recycle.cc
  34. +61 −51 core/src/dird/restore.cc
  35. +23 −17 core/src/dird/scheduler.cc
  36. +36 −32 core/src/dird/sd_cmds.cc
  37. +15 −9 core/src/dird/stats.cc
  38. +132 −113 core/src/dird/storage.cc
  39. +4 −4 core/src/dird/testfind.cc
  40. +24 −21 core/src/dird/ua_cmds.cc
  41. +2 −1 core/src/dird/ua_db.cc
  42. +3 −1 core/src/dird/ua_dotcmds.cc
  43. +15 −11 core/src/dird/ua_label.cc
  44. +19 −15 core/src/dird/ua_output.cc
  45. +4 −2 core/src/dird/ua_purge.cc
  46. +3 −1 core/src/dird/ua_restore.cc
  47. +253 −222 core/src/dird/ua_run.cc
  48. +10 −8 core/src/dird/ua_select.cc
  49. +4 −3 core/src/dird/ua_server.cc
  50. +19 −17 core/src/dird/ua_status.cc
  51. +2 −1 core/src/dird/ua_update.cc
  52. +77 −69 core/src/dird/vbackup.cc
  53. +86 −74 core/src/dird/verify.cc
  54. +32 −29 core/src/filed/accurate.cc
  55. +2 −1 core/src/filed/authenticate.cc
  56. +61 −58 core/src/filed/backup.cc
  57. +2 −1 core/src/filed/compression.cc
  58. +64 −56 core/src/filed/crypto.cc
  59. +143 −125 core/src/filed/dir_cmd.cc
  60. +8 −5 core/src/filed/estimate.cc
  61. +20 −19 core/src/filed/fd_plugins.cc
  62. +20 −17 core/src/filed/fileset.cc
  63. +36 −32 core/src/filed/heartbeat.cc
  64. +89 −0 core/src/filed/jcr_private.h
  65. +81 −74 core/src/filed/restore.cc
  66. +3 −2 core/src/filed/sd_cmds.cc
  67. +16 −11 core/src/filed/status.cc
  68. +16 −14 core/src/filed/verify.cc
  69. +4 −3 core/src/filed/verify_vol.cc
  70. +2 −0 core/src/findlib/match.h
  71. +35 −0 core/src/include/auth_protocol_types.h
  72. +35 −0 core/src/include/auth_types.h
  73. +45 −0 core/src/include/compression_context.h
  74. +113 −539 core/src/include/jcr.h
  75. +44 −0 core/src/include/job_level.h
  76. +58 −0 core/src/include/job_status.h
  77. +44 −0 core/src/include/job_types.h
  78. +40 −0 core/src/include/migration_selection_types.h
  79. +34 −0 core/src/include/protocol_types.h
  80. +13 −10 core/src/lib/jcr.cc
  81. +3 −2 core/src/plugins/stored/scsicrypto-sd.cc
  82. +12 −11 core/src/stored/acquire.cc
  83. +4 −3 core/src/stored/append.cc
  84. +4 −3 core/src/stored/authenticate.cc
  85. +14 −13 core/src/stored/bcopy.cc
  86. +4 −3 core/src/stored/bextract.cc
  87. +6 −5 core/src/stored/bls.cc
  88. +36 −27 core/src/stored/bscan.cc
  89. +15 −13 core/src/stored/bsr.cc
  90. +16 −13 core/src/stored/btape.cc
  91. +34 −27 core/src/stored/butil.cc
  92. +18 −12 core/src/stored/dev.cc
  93. +10 −9 core/src/stored/device.cc
  94. +29 −25 core/src/stored/dir_cmd.cc
  95. +28 −21 core/src/stored/fd_cmds.cc
  96. +103 −0 core/src/stored/jcr_private.h
  97. +63 −53 core/src/stored/job.cc
  98. +2 −0 core/src/stored/job.h
  99. +10 −9 core/src/stored/label.cc
  100. +78 −72 core/src/stored/mac.cc
  101. +5 −3 core/src/stored/mount.cc
  102. +28 −26 core/src/stored/ndmp_tape.cc
  103. +5 −4 core/src/stored/read.cc
  104. +14 −0 core/src/stored/read_ctx.h
  105. +14 −11 core/src/stored/read_record.cc
  106. +3 −1 core/src/stored/record.cc
  107. +0 −13 core/src/stored/record.h
  108. +35 −31 core/src/stored/reserve.cc
  109. +7 −6 core/src/stored/sd_cmds.cc
  110. +15 −14 core/src/stored/sd_plugins.cc
  111. +3 −2 core/src/stored/sd_stats.cc
  112. +16 −14 core/src/stored/spool.cc
  113. +5 −4 core/src/stored/status.cc
  114. +14 −12 core/src/stored/stored.cc
  115. +1 −0 core/src/stored/stored_conf.cc
  116. +1 −0 core/src/tests/job_control_record.cc
  117. +3 −2 core/src/tests/sd_reservation.cc
  118. +1 −1 core/src/tools/btestls.cc
  119. +14 −19 core/src/win32/filed/vss.cc
@@ -32,6 +32,7 @@
#include "include/bareos.h"
#include "dird.h"
#include "dird/admin.h"
#include "dird/jcr_private.h"
#include "dird/job.h"
#include "dird/storage.h"

@@ -53,9 +54,9 @@ bool DoAdminInit(JobControlRecord* jcr)
*/
bool do_admin(JobControlRecord* jcr)
{
jcr->jr.JobId = jcr->JobId;
jcr->impl->jr.JobId = jcr->JobId;

jcr->fname = (char*)GetPoolMemory(PM_FNAME);
jcr->impl->fname = (char*)GetPoolMemory(PM_FNAME);

/*
* Print Job Start message
@@ -83,7 +84,7 @@ void AdminCleanup(JobControlRecord* jcr, int TermCode)

UpdateJobEnd(jcr, TermCode);

if (!jcr->db->GetJobRecord(jcr, &jcr->jr)) {
if (!jcr->db->GetJobRecord(jcr, &jcr->impl->jr)) {
Jmsg(jcr, M_WARNING, 0,
_("Error getting Job record for Job report: ERR=%s"),
jcr->db->strerror());
@@ -108,9 +109,9 @@ void AdminCleanup(JobControlRecord* jcr, int TermCode)
sprintf(term_code, _("Inappropriate term code: %c\n"), jcr->JobStatus);
break;
}
bstrftimes(schedt, sizeof(schedt), jcr->jr.SchedTime);
bstrftimes(sdt, sizeof(sdt), jcr->jr.StartTime);
bstrftimes(edt, sizeof(edt), jcr->jr.EndTime);
bstrftimes(schedt, sizeof(schedt), jcr->impl->jr.SchedTime);
bstrftimes(sdt, sizeof(sdt), jcr->impl->jr.StartTime);
bstrftimes(edt, sizeof(edt), jcr->impl->jr.EndTime);

Jmsg(jcr, msg_type, 0,
_("BAREOS " VERSION " (" LSMDATE "): %s\n"
@@ -121,8 +122,8 @@ void AdminCleanup(JobControlRecord* jcr, int TermCode)
" End time: %s\n"
" Bareos binary info: %s\n"
" Termination: %s\n\n"),
edt, jcr->jr.JobId, jcr->jr.Job, schedt, sdt, edt, BAREOS_JOBLOG_MESSAGE,
TermMsg);
edt, jcr->impl->jr.JobId, jcr->impl->jr.Job, schedt, sdt, edt,
BAREOS_JOBLOG_MESSAGE, TermMsg);

Dmsg0(debuglevel, "Leave AdminCleanup()\n");
}
@@ -32,6 +32,7 @@
#include "dird.h"
#include "dird/archive.h"
#include "dird/job.h"
#include "dird/jcr_private.h"
#include "dird/storage.h"

namespace directordaemon {
@@ -52,9 +53,9 @@ bool DoArchiveInit(JobControlRecord* jcr)
*/
bool DoArchive(JobControlRecord* jcr)
{
jcr->jr.JobId = jcr->JobId;
jcr->impl->jr.JobId = jcr->JobId;

jcr->fname = (char*)GetPoolMemory(PM_FNAME);
jcr->impl->fname = (char*)GetPoolMemory(PM_FNAME);

/*
* Print Job Start message
@@ -82,7 +83,7 @@ void ArchiveCleanup(JobControlRecord* jcr, int TermCode)

UpdateJobEnd(jcr, TermCode);

if (!jcr->db->GetJobRecord(jcr, &jcr->jr)) {
if (!jcr->db->GetJobRecord(jcr, &jcr->impl->jr)) {
Jmsg(jcr, M_WARNING, 0,
_("Error getting Job record for Job report: ERR=%s"),
jcr->db->strerror());
@@ -108,9 +109,9 @@ void ArchiveCleanup(JobControlRecord* jcr, int TermCode)
break;
}

bstrftimes(schedt, sizeof(schedt), jcr->jr.SchedTime);
bstrftimes(sdt, sizeof(sdt), jcr->jr.StartTime);
bstrftimes(edt, sizeof(edt), jcr->jr.EndTime);
bstrftimes(schedt, sizeof(schedt), jcr->impl->jr.SchedTime);
bstrftimes(sdt, sizeof(sdt), jcr->impl->jr.StartTime);
bstrftimes(edt, sizeof(edt), jcr->impl->jr.EndTime);

Jmsg(jcr, msg_type, 0,
_("BAREOS " VERSION " (" LSMDATE "): %s\n"
@@ -121,8 +122,8 @@ void ArchiveCleanup(JobControlRecord* jcr, int TermCode)
" End time: %s\n"
" Bareos binary info: %s\n"
" Termination: %s\n\n"),
edt, jcr->jr.JobId, jcr->jr.Job, schedt, sdt, edt, BAREOS_JOBLOG_MESSAGE,
TermMsg);
edt, jcr->impl->jr.JobId, jcr->impl->jr.Job, schedt, sdt, edt,
BAREOS_JOBLOG_MESSAGE, TermMsg);

Dmsg0(debuglevel, "Leave ArchiveCleanup()\n");
}
@@ -39,6 +39,7 @@
#include "dird/fd_cmds.h"
#include "dird/client_connection_handshake_mode.h"
#include "dird/dird_globals.h"
#include "dird/jcr_private.h"
#include "lib/bnet.h"
#include "lib/qualified_resource_name_type_converter.h"
#include "lib/bstringlist.h"
@@ -72,8 +73,7 @@ bool AuthenticateWithStorageDaemon(BareosSocket* sd,
bstrncpy(dirname, me->resource_name_, sizeof(dirname));
BashSpaces(dirname);

sd->InitBnetDump(
my_config->CreateOwnQualifiedNameForNetworkDump());
sd->InitBnetDump(my_config->CreateOwnQualifiedNameForNetworkDump());
if (!sd->fsend(hello, dirname)) {
Dmsg1(debuglevel, _("Error sending Hello to Storage daemon. ERR=%s\n"),
BnetStrerror(sd));
@@ -126,9 +126,9 @@ bool AuthenticateWithFileDaemon(JobControlRecord* jcr)
if (jcr->authenticated) { return true; }

BareosSocket* fd = jcr->file_bsock;
ClientResource* client = jcr->res.client;
ClientResource* client = jcr->impl->res.client;

if (jcr->connection_handshake_try_ ==
if (jcr->impl->connection_handshake_try_ ==
ClientConnectionHandshakeMode::kTlsFirst) {
std::string qualified_resource_name;
if (!my_config->GetQualifiedResourceNameTypeConverter()->ResourceToString(
@@ -151,8 +151,7 @@ bool AuthenticateWithFileDaemon(JobControlRecord* jcr)
bstrncpy(dirname, me->resource_name_, sizeof(dirname));
BashSpaces(dirname);

fd->InitBnetDump(
my_config->CreateOwnQualifiedNameForNetworkDump());
fd->InitBnetDump(my_config->CreateOwnQualifiedNameForNetworkDump());
if (!fd->fsend(hello, dirname)) {
Jmsg(jcr, M_FATAL, 0,
_("Error sending Hello to File daemon at \"%s:%d\". ERR=%s\n"),
@@ -193,9 +192,9 @@ bool AuthenticateWithFileDaemon(JobControlRecord* jcr)
}

Dmsg1(110, "<filed: %s", fd->msg);
jcr->FDVersion = 0;
jcr->impl->FDVersion = 0;
if (!bstrncmp(fd->msg, FDOKhello, sizeof(FDOKhello)) &&
sscanf(fd->msg, FDOKnewHello, &jcr->FDVersion) != 1) {
sscanf(fd->msg, FDOKnewHello, &jcr->impl->FDVersion) != 1) {
Dmsg0(debuglevel, _("File daemon rejected Hello command\n"));
Jmsg(jcr, M_FATAL, 0,
_("File daemon at \"%s:%d\" rejected Hello command\n"), fd->host(),
@@ -30,6 +30,7 @@

#include "include/bareos.h"
#include "dird.h"
#include "dird/jcr_private.h"
#include "dird/next_vol.h"
#include "dird/ua_server.h"
#include "dird/ua_prune.h"
@@ -50,14 +51,14 @@ void DoAutoprune(JobControlRecord* jcr)
PoolResource* pool;
bool pruned;

if (!jcr->res.client) { /* temp -- remove me */
if (!jcr->impl->res.client) { /* temp -- remove me */
return;
}

ua = new_ua_context(jcr);
job = jcr->res.job;
client = jcr->res.client;
pool = jcr->res.pool;
job = jcr->impl->res.job;
client = jcr->impl->res.client;
pool = jcr->impl->res.pool;

if (job->PruneJobs || client->AutoPrune) {
PruneJobs(ua, client, pool, jcr->getJobType());
@@ -93,8 +94,8 @@ void PruneVolumes(JobControlRecord* jcr,
PoolMem query(PM_MESSAGE);
char ed1[50], ed2[100], ed3[50];

Dmsg1(100, "Prune volumes PoolId=%d\n", jcr->jr.PoolId);
if (!jcr->res.job->PruneVolumes && !jcr->res.pool->AutoPrune) {
Dmsg1(100, "Prune volumes PoolId=%d\n", jcr->impl->jr.PoolId);
if (!jcr->impl->res.job->PruneVolumes && !jcr->impl->res.pool->AutoPrune) {
Dmsg0(100, "AutoPrune not set in Pool.\n");
return;
}

0 comments on commit 3f2b5fb

Please sign in to comment.
You can’t perform that action at this time.