int index, ok, label, writing;
POOLMEM *omsg;
POOL_DBR pr;
+ uint32_t Stripe;
memset(&mr, 0, sizeof(mr));
memset(&sdmr, 0, sizeof(sdmr));
ok = db_get_pool_record(jcr, jcr->db, &pr);
if (ok) {
mr.PoolId = pr.PoolId;
- if (jcr->store->StorageId) {
- mr.StorageId = jcr->store->StorageId;
- }
+ mr.StorageId = jcr->wstore->StorageId;
ok = find_next_volume_for_append(jcr, &mr, index, true /*permit create new vol*/);
+ Dmsg3(100, "find_media idx=%d ok=%d vol=%s\n", index, ok, mr.VolumeName);
}
/*
* Send Find Media response to Storage daemon
* Pool matches, and it is either Append or Recycle
* and Media Type matches and Pool allows any volume.
*/
- if (mr.PoolId != jcr->PoolId) {
+ if (mr.PoolId != jcr->jr.PoolId) {
reason = _("not in Pool");
- } else if (strcmp(mr.MediaType, jcr->store->media_type) != 0) {
+ } else if (strcmp(mr.MediaType, jcr->wstore->media_type) != 0) {
reason = _("not correct MediaType");
} else {
/*
if (label || mr.LabelDate == 0) {
mr.LabelDate = jcr->start_time;
mr.set_label_date = true;
+ if (mr.InitialWrite == 0) {
+ mr.InitialWrite = jcr->start_time;
+ }
Dmsg2(400, "label=%d labeldate=%d\n", label, mr.LabelDate);
} else {
/*
mr.VolWriteTime = sdmr.VolWriteTime;
mr.VolParts = sdmr.VolParts;
bstrncpy(mr.VolStatus, sdmr.VolStatus, sizeof(mr.VolStatus));
- if (jcr->store->StorageId) {
- mr.StorageId = jcr->store->StorageId;
+ if (jcr->wstore->StorageId) {
+ mr.StorageId = jcr->wstore->StorageId;
}
Dmsg2(400, "db_update_media_record. Stat=%s Vol=%s\n", mr.VolStatus, mr.VolumeName);
*/
} else if (sscanf(bs->msg, Create_job_media, &Job,
&jm.FirstIndex, &jm.LastIndex, &jm.StartFile, &jm.EndFile,
- &jm.StartBlock, &jm.EndBlock, &jm.Copy, &jm.Stripe) == 9) {
+ &jm.StartBlock, &jm.EndBlock, &jm.Copy, &Stripe) == 9) {
- if (jcr->target_jcr) {
- jm.JobId = jcr->target_jcr->JobId;
+ if (jcr->mig_jcr) {
+ jm.JobId = jcr->mig_jcr->JobId;
jm.MediaId = jcr->MediaId;
} else {
jm.JobId = jcr->JobId;
ar->FileIndex = FileIndex;
ar->Stream = Stream;
ar->link = NULL;
- if (jcr->target_jcr) {
- ar->JobId = jcr->target_jcr->JobId;
+ if (jcr->mig_jcr) {
+ ar->JobId = jcr->mig_jcr->JobId;
} else {
ar->JobId = jcr->JobId;
}
Jmsg(jcr, M_WARNING, 0, _("Got %s but not same File as attributes\n"), stream_to_ascii(Stream));
} else {
/* Update digest in catalog */
- char digestbuf[CRYPTO_DIGEST_MAX_SIZE];
+ char digestbuf[BASE64_SIZE(CRYPTO_DIGEST_MAX_SIZE)];
int len = 0;
int type = CRYPTO_DIGEST_NONE;
Stream);
}
- bin_to_base64(digestbuf, fname, len);
+ bin_to_base64(digestbuf, sizeof(digestbuf), fname, len, true);
Dmsg3(400, "DigestLen=%d Digest=%s type=%d\n", strlen(digestbuf), digestbuf, Stream);
if (jcr->cached_attribute) {
ar->Digest = digestbuf;