Skip to content

Commit

Permalink
ua_run: add allowmixedpriority override flag
Browse files Browse the repository at this point in the history
  • Loading branch information
SamuelBoerlin authored and arogge committed Oct 19, 2023
1 parent d5db698 commit cad30ca
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
2 changes: 2 additions & 0 deletions core/src/dird/ua.h
Expand Up @@ -280,6 +280,8 @@ class RunContext {
bool nextpool_set = false;
bool accurate_set = false;
bool ignoreduplicatecheck_set = false;
bool allow_mixed_priority = false;
bool allow_mixed_priority_set = false;

RunContext();
~RunContext();
Expand Down
16 changes: 16 additions & 0 deletions core/src/dird/ua_run.cc
Expand Up @@ -1008,6 +1008,9 @@ static bool ResetRestoreContext(UaContext* ua,
jcr->dir_impl->IgnoreDuplicateJobChecking = rc.ignoreduplicatecheck;
}

// Used by consolidate jobs to make spawned virtualfulls inherit the AllowMixedPriority flag
if (rc.allow_mixed_priority_set) { jcr->allow_mixed_priority = rc.allow_mixed_priority; }

return true;
}

Expand Down Expand Up @@ -1767,6 +1770,7 @@ static bool ScanCommandLineArguments(UaContext* ua, RunContext& rc)
"ignoreduplicatecheck", /* 29 */
"accurate", /* 30 */
"backupformat", /* 31 */
"allowmixedpriority", /* 32 */
NULL};

#define YES_POS 14
Expand Down Expand Up @@ -2054,6 +2058,18 @@ static bool ScanCommandLineArguments(UaContext* ua, RunContext& rc)
rc.backup_format = ua->argv[i];
kw_ok = true;
break;
case 32: /* allowmixedpriority */
if (rc.allow_mixed_priority_set) {
ua->SendMsg(_("AllowMixedPriority flag specified twice.\n"));
return false;
}
if (IsYesno(ua->argv[i], &rc.allow_mixed_priority)) {
rc.allow_mixed_priority_set = true;
kw_ok = true;
} else {
ua->SendMsg(_("Invalid AllowMixedPriority flag.\n"));
}
break;
default:
break;
}
Expand Down

0 comments on commit cad30ca

Please sign in to comment.