]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/dird/catreq.c
migrate
[bacula/bacula] / bacula / src / dird / catreq.c
index e599bd95f2f1d5d79a06afa20f1057dac967cc22..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
@@ -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;
       }