va_list arg_ptr;
int len;
MSGS *msgs;
- const char *job;
+ uint32_t JobId = 0;
Dmsg1(850, "Enter Jmsg type=%d\n", type);
}
msgs = NULL;
- job = NULL;
if (!jcr) {
jcr = get_jcr_from_tsd();
}
if (jcr) {
msgs = jcr->jcr_msgs;
- job = jcr->Job;
+ JobId = jcr->JobId;
}
if (!msgs) {
msgs = daemon_msgs; /* if no jcr, we use daemon handler */
}
- if (!job) {
- job = ""; /* Set null job name if none */
- }
/*
* Check if we have a message destination defined.
len = bsnprintf(rbuf, sizeof(rbuf), _("%s ERROR TERMINATION\n"), my_name);
break;
case M_FATAL:
- len = bsnprintf(rbuf, sizeof(rbuf), _("%s: %s Fatal error: "), my_name, job);
+ len = bsnprintf(rbuf, sizeof(rbuf), _("%s JobId %u: Fatal error: "), my_name, JobId);
if (jcr) {
set_jcr_job_status(jcr, JS_FatalError);
}
break;
case M_ERROR:
- len = bsnprintf(rbuf, sizeof(rbuf), _("%s: %s Error: "), my_name, job);
+ len = bsnprintf(rbuf, sizeof(rbuf), _("%s JobId %u: Error: "), my_name, JobId);
if (jcr) {
jcr->Errors++;
}
break;
case M_WARNING:
- len = bsnprintf(rbuf, sizeof(rbuf), _("%s: %s Warning: "), my_name, job);
+ len = bsnprintf(rbuf, sizeof(rbuf), _("%s JobId %u: Warning: "), my_name, JobId);
break;
case M_SECURITY:
- len = bsnprintf(rbuf, sizeof(rbuf), _("%s: %s Security violation: "), my_name, job);
+ len = bsnprintf(rbuf, sizeof(rbuf), _("%s JobId %u: Security violation: "),
+ my_name, JobId);
break;
default:
- len = bsnprintf(rbuf, sizeof(rbuf), "%s: ", my_name);
+ len = bsnprintf(rbuf, sizeof(rbuf), "%s JobId %u: ", my_name, JobId);
break;
}
if (!have_vol &&
!(dir_find_next_appendable_volume(dcr) &&
strcmp(dev->VolHdr.VolumeName, dcr->VolumeName) == 0)) { /* wrong tape mounted */
- Dmsg2(190, "Wrong tape mounted: %s. wants:%s\n", dev->VolHdr.VolumeName,
- dcr->VolumeName);
- if (dev->num_writers != 0) {
- Jmsg3(jcr, M_FATAL, 0, _("Wanted to append to Volume \"%s\", but device %s is busy writing on \"%s\" .\n"),
- dcr->VolumeName, dev->print_name(), dev->VolHdr.VolumeName);
- Dmsg3(200, "Wanted to append to Volume \"%s\", but device %s is busy writing on \"%s\" .\n",
- dcr->VolumeName, dev->print_name(), dev->VolHdr.VolumeName);
- /* Release volume reserved by dir_find_next_appendable_volume() */
- if (dcr->VolumeName[0]) {
- volume_unused(dcr);
- }
- goto get_out;
- }
/* Wrong tape mounted, release it, then fall through to get correct one */
- Dmsg1(190, "jid=%u Wrong tape mounted, release and try mount.\n",
- (uint32_t)jcr->JobId);
+ Dmsg0(50, "Wrong tape mounted, release and try mount.\n");
release = true;
do_mount = true;
} else {
}
break;
default:
- Jmsg1(jcr, M_ABORT, 0, _("Bad session label = %d\n"), label);
+ Jmsg1(jcr, M_ABORT, 0, _("Bad Volume session label = %d\n"), label);
break;
}
create_session_label(dcr, rec, label);
Dmsg1(dbglvl, "OK, vol=%s on device.\n", VolumeName);
goto get_out; /* Volume already on this device */
} else {
- Dmsg2(dbglvl, "reserve_vol free vol=%s at %p\n",
- vol->vol_name, vol->vol_name);
+ Dmsg2(dbglvl, "reserve_vol free vol=%s at %p\n", vol->vol_name, vol->vol_name);
debug_list_volumes("reserve_vol free");
vol_list->remove(vol);
free_vol_item(vol);
/* Drive Pool not suitable for us */
Mmsg(jcr->errmsg, _(
"3608 JobId=%u wants Pool=\"%s\" but have Pool=\"%s\" nreserve=%d on drive %s.\n"),
- jcr->JobId, dcr->pool_name, dev->pool_name,
+ (uint32_t)jcr->JobId, dcr->pool_name, dev->pool_name,
dev->reserved_device, dev->print_name());
queue_reserve_message(jcr);
Dmsg2(dbglvl, "failed: busy num_writers=0, reserved, pool=%s wanted=%s\n",
rctx.PreferMountedVols, rctx.exact_match, rctx.suitable_device,
rctx.autochanger_only, rctx.any_drive);
+ /* Check for max jobs on this Volume */
+ if (!is_max_jobs_ok(dcr)) {
+ return 0;
+ }
+
/* setting any_drive overrides PreferMountedVols flag */
if (!rctx.any_drive) {
/*
if (dev->num_writers == 0) {
/* Now check if there are any reservations on the drive */
if (dev->reserved_device) {
- if (!is_max_jobs_ok(dcr)) {
- return 0;
- }
return is_pool_ok(dcr);
} else if (dev->can_append()) {
if (is_pool_ok(dcr)) {
* available if pool is the same).
*/
if (dev->can_append() || dev->num_writers > 0) {
- if (!is_max_jobs_ok(dcr)) {
- return 0;
- }
return is_pool_ok(dcr);
} else {
Pmsg1(000, _("Logic error!!!! JobId=%u Should not get here.\n"), (int)jcr->JobId);
Technical notes on version 2.3
General:
+07Oct07
+kes Make maxvol-test and new more strict maxvol2-test work.
+kes Print JobId in all Jmsg() job output.
06Oct07
kes Add new SD despooling attributes and Dir inserting attributes
job status codes. This fixes bug 961.