]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/dird/catreq.c
Turn off debug
[bacula/bacula] / bacula / src / dird / catreq.c
index 1d19a5a26fd053aa1ed47e93845862a2ea6357a9..23e3795f2180261cf2b123ae1fff3098d1cca5cc 100644 (file)
@@ -1,21 +1,7 @@
-/*
- *
- *   Bacula Director -- catreq.c -- handles the message channel
- *    catalog request from the Storage daemon.
- *
- *     Kern Sibbald, March MMI
- *
- *    This routine runs as a thread and must be thread reentrant.
- *
- *  Basic tasks done here:
- *      Handle Catalog services.
- *
- *   Version $Id$
- */
 /*
    Bacula® - The Network Backup Solution
 
-   Copyright (C) 2001-2006 Free Software Foundation Europe e.V.
+   Copyright (C) 2001-2007 Free Software Foundation Europe e.V.
 
    The main author of Bacula is Kern Sibbald, with contributions from
    many others, a complete list can be found in the file AUTHORS.
    (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
    Switzerland, email:ftf@fsfeurope.org.
 */
+/*
+ *
+ *   Bacula Director -- catreq.c -- handles the message channel
+ *    catalog request from the Storage daemon.
+ *
+ *     Kern Sibbald, March MMI
+ *
+ *    This routine runs as a thread and must be thread reentrant.
+ *
+ *  Basic tasks done here:
+ *      Handle Catalog services.
+ *
+ *   Version $Id$
+ */
 
 #include "bacula.h"
 #include "dird.h"
@@ -90,8 +90,8 @@ static int send_volume_info_to_storage_daemon(JCR *jcr, BSOCK *sd, MEDIA_DBR *mr
       edit_uint64(mr->VolCapacityBytes, ed3),
       mr->VolStatus, mr->Slot, mr->MaxVolJobs, mr->MaxVolFiles,
       mr->InChanger,
-      edit_uint64(mr->VolReadTime, ed4),
-      edit_uint64(mr->VolWriteTime, ed5),
+      edit_int64(mr->VolReadTime, ed4),
+      edit_int64(mr->VolWriteTime, ed5),
       mr->EndFile, mr->EndBlock,
       mr->VolParts,
       mr->LabelType,
@@ -141,8 +141,8 @@ void catalog_request(JCR *jcr, BSOCK *bs)
       if (ok) {
          mr.PoolId = pr.PoolId;
          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);
+         ok = find_next_volume_for_append(jcr, &mr, index, fnv_create_vol, fnv_prune);
+         Dmsg3(050, "find_media ok=%d idx=%d vol=%s\n", ok, index, mr.VolumeName);
       }
       /*
        * Send Find Media response to Storage daemon
@@ -189,6 +189,9 @@ void catalog_request(JCR *jcr, BSOCK *bs)
                check_if_volume_valid_or_recyclable(jcr, &mr, &reason);
             }
          }
+         if (!reason && mr.Enabled != 1) {
+            reason = _("is not Enabled");
+         }
          if (reason == NULL) {
             /*
              * Send Find Media response to Storage daemon
@@ -277,7 +280,7 @@ void catalog_request(JCR *jcr, BSOCK *bs)
       mr.VolWriteTime = sdmr.VolWriteTime;
       mr.VolParts     = sdmr.VolParts;
       bstrncpy(mr.VolStatus, sdmr.VolStatus, sizeof(mr.VolStatus));
-      if (jcr->wstore->StorageId) {
+      if (jcr->wstore && jcr->wstore->StorageId) {
          mr.StorageId = jcr->wstore->StorageId;
       }