]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/dird/catreq.c
migrate
[bacula/bacula] / bacula / src / dird / catreq.c
index 62e4400077efb2f31f91f7e2f28b4864b0768f6f..8477d8bbc854ee076e5e91a843fa662aae3eece5 100644 (file)
@@ -122,10 +122,9 @@ void catalog_request(JCR *jcr, BSOCK *bs)
       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->store->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
@@ -160,7 +159,7 @@ void catalog_request(JCR *jcr, BSOCK *bs)
              *   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");
@@ -279,8 +278,8 @@ void catalog_request(JCR *jcr, BSOCK *bs)
       &jm.FirstIndex, &jm.LastIndex, &jm.StartFile, &jm.EndFile,
       &jm.StartBlock, &jm.EndBlock, &jm.Copy, &jm.Stripe) == 9) {
 
-      if (jcr->target_jcr) {
-         jm.JobId = jcr->target_jcr->JobId;
+      if (jcr->previous_jcr) {
+         jm.JobId = jcr->previous_jcr->JobId;
          jm.MediaId = jcr->MediaId;
       } else {
          jm.JobId = jcr->JobId;
@@ -394,8 +393,8 @@ void catalog_update(JCR *jcr, BSOCK *bs)
       ar->FileIndex = FileIndex;
       ar->Stream = Stream;
       ar->link = NULL;
-      if (jcr->target_jcr) {
-         ar->JobId = jcr->target_jcr->JobId;
+      if (jcr->previous_jcr) {
+         ar->JobId = jcr->previous_jcr->JobId;
       } else {
          ar->JobId = jcr->JobId;
       }