* Version $Id$
*/
/*
- Copyright (C) 2001-2005 Kern Sibbald
+ Copyright (C) 2001-2006 Kern Sibbald
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
ok = db_get_pool_record(jcr, jcr->db, &pr);
if (ok) {
mr.PoolId = pr.PoolId;
- ok = find_next_volume_for_append(jcr, &mr, true /*permit create new vol*/);
+ if (jcr->store->StorageId) {
+ mr.StorageId = jcr->store->StorageId;
+ }
+ ok = find_next_volume_for_append(jcr, &mr, index, true /*permit create new vol*/);
}
/*
* 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) {
reason = _("not correct MediaType");
} else {
- /*
- * ****FIXME***
- * This test (accept_any_volume) is turned off
- * because it doesn't properly check if the volume
- * really is out of sequence!
- *
- * } else if (!jcr->pool->accept_any_volume) {
- * reason = "Volume not in sequence";
- */
-
/*
* Now try recycling if necessary
* reason set non-NULL if we cannot use it
&jm.FirstIndex, &jm.LastIndex, &jm.StartFile, &jm.EndFile,
&jm.StartBlock, &jm.EndBlock, &jm.Copy, &jm.Stripe) == 9) {
- jm.JobId = jcr->JobId;
- jm.MediaId = jcr->MediaId;
+ if (jcr->target_jcr) {
+ jm.JobId = jcr->target_jcr->JobId;
+ jm.MediaId = jcr->MediaId;
+ } else {
+ jm.JobId = jcr->JobId;
+ jm.MediaId = jcr->MediaId;
+ }
Dmsg6(400, "create_jobmedia JobId=%d MediaId=%d SF=%d EF=%d FI=%d LI=%d\n",
jm.JobId, jm.MediaId, jm.StartFile, jm.EndFile, jm.FirstIndex, jm.LastIndex);
if (!db_create_jobmedia_record(jcr, jcr->db, &jm)) {
ar->FileIndex = FileIndex;
ar->Stream = Stream;
ar->link = NULL;
- ar->JobId = jcr->JobId;
+ if (jcr->target_jcr) {
+ ar->JobId = jcr->target_jcr->JobId;
+ } else {
+ ar->JobId = jcr->JobId;
+ }
ar->Digest = NULL;
ar->DigestType = CRYPTO_DIGEST_NONE;
jcr->cached_attribute = true;
Dmsg2(400, "dird<filed: stream=%d %s\n", Stream, fname);
Dmsg1(400, "dird<filed: attr=%s\n", attr);
-#ifdef xxx_old_code
- if (!db_create_file_attributes_record(jcr, jcr->db, ar)) {
- Jmsg1(jcr, M_FATAL, 0, _("Attribute create error. %s"), db_strerror(jcr->db));
- }
-#endif
} else if (crypto_digest_stream_type(Stream) != CRYPTO_DIGEST_NONE) {
fname = p;
if (ar->FileIndex != FileIndex) {