]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/dird/next_vol.c
ebl Add new ScratchPool directive to Pool. Thanks to Graham
[bacula/bacula] / bacula / src / dird / next_vol.c
index 904f4cf0cab4e79eed6b0b1f1620d21f30789ccc..462d4550237e8e14cc04d0e105fd4197fe8c62a4 100644 (file)
@@ -43,6 +43,7 @@
  *  Items needed:
  *   mr.PoolId must be set
  *   mr.StorageId should also be set
+ *   mr.ScratchPoolId could be set (used if create==true)
  *   jcr->wstore
  *   jcr->db
  *   jcr->pool
@@ -347,9 +348,13 @@ bool get_scratch_volume(JCR *jcr, bool InChanger, MEDIA_DBR *mr)
    P(mutex);
    /* 
     * Get Pool record for Scratch Pool
+    * choose between ScratchPoolId and Scratch
+    * db_get_pool_record will first try ScratchPoolId, 
+    * and then try the pool named Scratch
     */
    memset(&spr, 0, sizeof(spr));
    bstrncpy(spr.Name, "Scratch", sizeof(spr.Name));
+   spr.PoolId = mr->ScratchPoolId;
    if (db_get_pool_record(jcr, jcr->db, &spr)) {
       memset(&smr, 0, sizeof(smr));
       smr.PoolId = spr.PoolId;