From: Kern Sibbald Date: Thu, 12 Jun 2014 08:39:58 +0000 (+0200) Subject: Display correct NextPool overrides + use Job NextPool in restore if available X-Git-Tag: Release-7.0.5~58 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=a89da071b364c13c1d9e9d3913c56ee37cbf53cc;p=bacula%2Fbacula Display correct NextPool overrides + use Job NextPool in restore if available --- diff --git a/bacula/src/dird/job.c b/bacula/src/dird/job.c index fa667d40db..9854699267 100644 --- a/bacula/src/dird/job.c +++ b/bacula/src/dird/job.c @@ -945,13 +945,13 @@ bool apply_wstorage_overrides(JCR *jcr, POOL *opool) if (jcr->run_next_pool_override) { pm_strcpy(jcr->next_pool_source, _("Run NextPool override")); pm_strcpy(jcr->pool_source, _("Run NextPool override")); - source = _("Storage from Run NextPool override"); + source = _("Run NextPool override"); } else if (jcr->job->next_pool) { /* Use Job Next Pool */ jcr->next_pool = jcr->job->next_pool; pm_strcpy(jcr->next_pool_source, _("Job's NextPool resource")); pm_strcpy(jcr->pool_source, _("Job's NextPool resource")); - source = _("Storage from Job's NextPool resource"); + source = _("Job's NextPool resource"); } else { /* Default to original pool->NextPool */ jcr->next_pool = opool->NextPool; @@ -961,7 +961,7 @@ bool apply_wstorage_overrides(JCR *jcr, POOL *opool) } pm_strcpy(jcr->next_pool_source, _("Job Pool's NextPool resource")); pm_strcpy(jcr->pool_source, _("Job Pool's NextPool resource")); - source = _("Storage from Pool's NextPool resource"); + source = _("Pool's NextPool resource"); } /* @@ -1353,8 +1353,15 @@ void set_jcr_defaults(JCR *jcr, JOB *job) pm_strcpy(jcr->client_name, jcr->client->name()); jcr->pool = job->pool; pm_strcpy(jcr->pool_source, _("Job resource")); - jcr->next_pool = job->pool->NextPool; - pm_strcpy(jcr->next_pool_source, _("Job's NextPool resource")); + if (job->next_pool) { + /* Use Job's Next Pool */ + jcr->next_pool = job->next_pool; + pm_strcpy(jcr->next_pool_source, _("Job's NextPool resource")); + } else { + /* Default to original pool->NextPool */ + jcr->next_pool = job->pool->NextPool; + pm_strcpy(jcr->next_pool_source, _("Job Pool's NextPool resource")); + } jcr->full_pool = job->full_pool; jcr->inc_pool = job->inc_pool; jcr->diff_pool = job->diff_pool; diff --git a/bacula/src/dird/ua_run.c b/bacula/src/dird/ua_run.c index 4a31ac66d3..3ea04a8d97 100644 --- a/bacula/src/dird/ua_run.c +++ b/bacula/src/dird/ua_run.c @@ -269,7 +269,7 @@ static bool get_pool(UAContext *ua, run_ctx &rc) static bool get_next_pool(UAContext *ua, run_ctx &rc) { if (rc.next_pool_name) { - Dmsg1(100, "Have next pool override=%s\n", rc.next_pool_name); + Dmsg1(100, "Have next pool=%s\n", rc.next_pool_name); rc.next_pool = GetPoolResWithName(rc.next_pool_name); if (!rc.next_pool) { if (*rc.next_pool_name != 0) { @@ -954,7 +954,7 @@ static bool set_run_context_in_jcr(UAContext *ua, JCR *jcr, run_ctx &rc) if (jcr->is_JobType(JT_MIGRATE) || jcr->is_JobType(JT_COPY) || (jcr->is_JobType(JT_BACKUP) && jcr->is_JobLevel(L_VIRTUAL_FULL))) { if (!set_mac_wstorage(ua, jcr, rc.pool, rc.next_pool, - _("Storage from NextPool override"))) { + jcr->next_pool_source)) { return false; } }