]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/stored/mac.c
kes Define a machine dependent ioctl request type for use with
[bacula/bacula] / bacula / src / stored / mac.c
index a1ad6a3a89d3575c5fb08e244762d284ef661ba7..f2435e7838a7b9f7a3f10eff7b21407d8b2d036f 100644 (file)
@@ -1,15 +1,7 @@
-/*
- * SD -- mac.c --  responsible for doing
- *     migration, archive, and copy jobs.
- *
- *     Kern Sibbald, January MMVI
- *
- *   Version $Id$
- */
 /*
    Bacula® - The Network Backup Solution
 
-   Copyright (C) 2006-2006 Free Software Foundation Europe e.V.
+   Copyright (C) 2006-2008 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.
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   Bacula® is a registered trademark of John Walker.
+   Bacula® is a registered trademark of Kern Sibbald.
    The licensor of Bacula is the Free Software Foundation Europe
    (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
    Switzerland, email:ftf@fsfeurope.org.
 */
+/*
+ * SD -- mac.c --  responsible for doing
+ *     migration, archive, copy, and virtual backup jobs.
+ *
+ *     Kern Sibbald, January MMVI
+ *
+ *   Version $Id$
+ */
 
 #include "bacula.h"
 #include "stored.h"
@@ -57,7 +57,7 @@ bool do_mac(JCR *jcr)
    char ec1[50];
    DEVICE *dev;
 
-   switch(jcr->JobType) {
+   switch(jcr->get_JobType()) {
    case JT_MIGRATE:
       Type = "Migration";
       break;
@@ -67,6 +67,9 @@ bool do_mac(JCR *jcr)
    case JT_COPY:
       Type = "Copy";
       break;
+   case JT_BACKUP:
+      Type = "Virtual Backup";
+      break;
    default:
       Type = "Unknown";
       break;
@@ -108,6 +111,7 @@ bool do_mac(JCR *jcr)
 
    jcr->dcr->VolFirstIndex = jcr->dcr->VolLastIndex = 0;
    jcr->run_time = time(NULL);
+   set_start_vol_position(jcr->dcr);
 
    ok = read_records(jcr->read_dcr, record_cb, mount_next_read_volume);
    goto ok_out;
@@ -167,7 +171,7 @@ ok_out:
       set_jcr_job_status(jcr, JS_Terminated);
    }
    generate_daemon_event(jcr, "JobEnd");
-   bnet_fsend(dir, Job_end, jcr->Job, jcr->JobStatus, jcr->JobFiles,
+   dir->fsend(Job_end, jcr->Job, jcr->JobStatus, jcr->JobFiles,
       edit_uint64(jcr->JobBytes, ec1));
    Dmsg4(200, Job_end, jcr->Job, jcr->JobStatus, jcr->JobFiles, ec1); 
        
@@ -239,17 +243,18 @@ static bool record_cb(DCR *dcr, DEV_RECORD *rec)
    if (stream == STREAM_UNIX_ATTRIBUTES || stream == STREAM_UNIX_ATTRIBUTES_EX ||
        crypto_digest_stream_type(stream) != CRYPTO_DIGEST_NONE) {
       if (!jcr->no_attributes) {
+         BSOCK *dir = jcr->dir_bsock;
          if (are_attributes_spooled(jcr)) {
-            jcr->dir_bsock->m_spool = true;
+            dir->set_spooling();
          }
          Dmsg0(850, "Send attributes to dir.\n");
          if (!dir_update_file_attributes(jcr->dcr, rec)) {
-            jcr->dir_bsock->m_spool = false;
+            dir->clear_spooling();
             Jmsg(jcr, M_FATAL, 0, _("Error updating file attributes. ERR=%s\n"),
-               bnet_strerror(jcr->dir_bsock));
+               dir->bstrerror());
             return false;
          }
-         jcr->dir_bsock->m_spool = false;
+         dir->clear_spooling();
       }
    }