]> git.sur5r.net Git - bacula/bacula/commitdiff
kes Make WritePartAfterJob the default so that the last DVD part
authorKern Sibbald <kern@sibbald.com>
Mon, 20 Nov 2006 08:02:15 +0000 (08:02 +0000)
committerKern Sibbald <kern@sibbald.com>
Mon, 20 Nov 2006 08:02:15 +0000 (08:02 +0000)
     always gets written to the DVD by default.
kes  Add additional error messages in migration.
kes  Suppress redundant error messages in migration (possibly more to do).
kes  Apply Martin's fix (updated to 1.39) that takes into account
     run storage overrides in the Director status display.
kes  Implement, but turn off the submitted code that sets the EOT
     model on FreeBSD machines. Turning on this code is too risky at
     this point in the development.

git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@3661 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/AUTHORS
bacula/src/dird/dird_conf.c
bacula/src/dird/migrate.c
bacula/src/dird/next_vol.c
bacula/src/dird/ua_output.c
bacula/src/dird/ua_status.c
bacula/src/stored/dev.c
bacula/src/version.h
bacula/technotes-1.39

index 30e592b8f853b89b77f758f49a42733327e1fc9e..182b6ec899211732a401c6e34a3b02ee030b177d 100644 (file)
@@ -10,6 +10,7 @@ name on this list, please send a note to me: kern@sibbald.com
 
 Contributors:
 
+Adam Thorton
 Adrew J. Millar
 Adrian Close
 Aleksandar Milivojevic
index 9021d8b6fd94fd8ba2f8f8b19a67076306fb6b4a..843211ef753dc60646874a960e813fd60c8bcbd2 100644 (file)
@@ -285,7 +285,7 @@ RES_ITEM job_items[] = {
    {"rescheduleinterval", store_time, ITEM(res_job.RescheduleInterval), 0, ITEM_DEFAULT, 60 * 30},
    {"rescheduletimes", store_pint, ITEM(res_job.RescheduleTimes), 0, 0, 0},
    {"priority",   store_pint, ITEM(res_job.Priority), 0, ITEM_DEFAULT, 10},
-   {"writepartafterjob",   store_bool, ITEM(res_job.write_part_after_job), 0, ITEM_DEFAULT, false},
+   {"writepartafterjob",   store_bool, ITEM(res_job.write_part_after_job), 0, ITEM_DEFAULT, true},
    {"selectionpattern", store_str, ITEM(res_job.selection_pattern), 0, 0, 0},
    {"selectiontype", store_migtype, ITEM(res_job.selection_type), 0, 0, 0},
    {"runscript", store_runscript, ITEM(res_job.RunScripts), 0, ITEM_NO_EQUALS, 0},
index 2ddba5ccc0ae8bfe03965519b86c0a300d4d0628..e810bcdd4017dafa71b1d52ecbf06062502584c2 100644 (file)
@@ -65,11 +65,13 @@ bool do_migration_init(JCR *jcr)
 
    if (jcr->previous_jr.JobId == 0) {
       Dmsg1(dbglevel, "JobId=%d no previous JobId\n", (int)jcr->JobId);
+      Jmsg(jcr, M_INFO, 0, _("No previous Job found to migrate.\n"));
       return true;                    /* no work */
    }
 
    if (!get_or_create_fileset_record(jcr)) {
       Dmsg1(dbglevel, "JobId=%d no FileSet\n", (int)jcr->JobId);
+      Jmsg(jcr, M_FATAL, 0, _("Could not get or create the FileSet record.\n"));
       return false;
    }
 
@@ -78,6 +80,7 @@ bool do_migration_init(JCR *jcr)
    jcr->jr.PoolId = get_or_create_pool_record(jcr, jcr->pool->hdr.name);
    if (jcr->jr.PoolId == 0) {
       Dmsg1(dbglevel, "JobId=%d no PoolId\n", (int)jcr->JobId);
+      Jmsg(jcr, M_FATAL, 0, _("Could not get or create a Pool record.\n"));
       return false;
    }
 
@@ -127,6 +130,11 @@ bool do_migration(JCR *jcr)
    if (jcr->previous_jr.JobId == 0 || jcr->ExpectedFiles == 0) {
       set_jcr_job_status(jcr, JS_Terminated);
       Dmsg1(dbglevel, "JobId=%d expected files == 0\n", (int)jcr->JobId);
+      if (jcr->previous_jr.JobId == 0) {
+         Jmsg(jcr, M_INFO, 0, _("No previous Job found to migrate.\n"));
+      } else {
+         Jmsg(jcr, M_INFO, 0, _("Previous Job has no data to migrate.\n"));
+      }
       migration_cleanup(jcr, jcr->JobStatus);
       return true;                    /* no work */
    }
@@ -277,6 +285,7 @@ bool do_migration(JCR *jcr)
    if (((STORE *)jcr->rstorage->first())->name() == ((STORE *)jcr->wstorage->first())->name()) {
       Jmsg(jcr, M_FATAL, 0, _("Read storage \"%s\" same as write storage.\n"),
            ((STORE *)jcr->rstorage->first())->name());
+      return false;
    }
    if (!start_storage_daemon_job(jcr, jcr->rstorage, jcr->wstorage)) {
       return false;
@@ -701,6 +710,10 @@ static bool get_job_to_migrate(JCR *jcr)
     *  for each of them.  For the last JobId, we handle it below.
     */
    p = ids.list;
+   if (ids.count == 0) {
+      Jmsg(jcr, M_INFO, 0, _("No JobIds found to migrate.\n"));
+      goto ok_out;
+   }
    Jmsg(jcr, M_INFO, 0, _("The following %u JobId%s will be migrated: %s\n"),
       ids.count, ids.count==0?"":"s", ids.list);
    Dmsg2(dbglevel, "Before loop count=%d ids=%s\n", ids.count, ids.list);
@@ -716,7 +729,7 @@ static bool get_job_to_migrate(JCR *jcr)
          goto bail_out;
       } else if (stat == 0) {
          Jmsg(jcr, M_INFO, 0, _("No JobIds found to migrate.\n"));
-         goto ok_out;
+         goto bail_out;
       }
    }
    
@@ -729,7 +742,7 @@ static bool get_job_to_migrate(JCR *jcr)
       goto bail_out;
    } else if (stat == 0) {
       Jmsg(jcr, M_INFO, 0, _("No JobIds found to migrate.\n"));
-      goto ok_out;
+      goto bail_out;
    }
 
    jcr->previous_jr.JobId = JobId;
index 82675a2246c12094d098fd53d0f35fb582075261..ac4bb9ce96154e6cfa50a8c1b96aba881733c14a 100644 (file)
@@ -32,7 +32,7 @@ static bool get_scratch_volume(JCR *jcr, MEDIA_DBR *mr, bool InChanger);
 /*
  *  Items needed:
  *   mr.PoolId must be set
- *   jcr->store
+ *   jcr->wstore
  *   jcr->db
  *   jcr->pool
  *   MEDIA_DBR mr (zeroed out)
index b0e261ba49a40abe185879869b4e1f5ee4f45f65..c0e3779b03b1a56d45f3cd899230b172762ce9b3 100644 (file)
@@ -588,6 +588,7 @@ RUN *find_next_run(RUN *run, JOB *job, time_t &runtime, int ndays)
    /* Nothing found */
    return NULL;
 }
+
 /*
  * Fill in the remaining fields of the jcr as if it
  *  is going to run the job.
index 16b82cba5b5e462ac85deb1fb56ac864465a7cf3..13c3ff38f767f36420bdaa3ca93c40a2ca60e291 100644 (file)
@@ -377,6 +377,7 @@ static void prt_runtime(UAContext *ua, sched_pkt *sp)
       if (ok) {
          mr.PoolId = jcr->jr.PoolId;
          mr.StorageId = sp->store->StorageId;
+         jcr->wstore = sp->store;
          ok = find_next_volume_for_append(jcr, &mr, 1, false/*no create*/);
       }
       if (!ok) {
@@ -400,7 +401,6 @@ static void prt_runtime(UAContext *ua, sched_pkt *sp)
       db_close_database(jcr, jcr->db);
    }
    jcr->db = ua->db;                  /* restore ua db to jcr */
-
 }
 
 /*
index c0cc13822d825c2edac9fc42c5276df24b6649a5..231f3c15666bb04996475c792d83ff7044505a36 100644 (file)
@@ -80,7 +80,7 @@
 #endif
 
 /* Forward referenced functions */
-void set_os_device_parameters(DEVICE *dev);
+void set_os_device_parameters(DCR *dcr);   
 static bool dev_get_os_pos(DEVICE *dev, struct mtget *mt_stat);
 static char *mode_to_str(int mode);
 
@@ -392,7 +392,7 @@ void DEVICE::open_tape_device(DCR *dcr, int omode)
             }
             dev_errno = 0;
             lock_door();
-            set_os_device_parameters(this);      /* do system dependent stuff */
+            set_os_device_parameters(dcr);       /* do system dependent stuff */
             break;                               /* Successfully opened and rewound */
          }
       }
@@ -2282,8 +2282,10 @@ bool double_dev_wait_time(DEVICE *dev)
 }
 
 
-void set_os_device_parameters(DEVICE *dev)
+void set_os_device_parameters(DCR *dcr)
 {
+   DEVICE *dev = dcr->dev;
+
 #if defined(HAVE_LINUX_OS) || defined(HAVE_WIN32)
    struct mtop mt_com;
 
@@ -2347,6 +2349,22 @@ void set_os_device_parameters(DEVICE *dev)
          dev->clrerror(MTSETBSIZ);
       }
    }
+/* Turn this on later when fully tested */
+#if defined(xxxMTIOCSETEOTMODEL) 
+   uint32_t neof;
+   if (dev_cap(dev, CAP_TWOEOF)) {
+      neof = 2;
+   } else {
+      neof = 1;
+   }
+   if (ioctl(dev->fd, MTIOCSETEOTMODEL, (caddr_t)&neof) < 0) {
+      berrno be;
+      dev->dev_errno = errno;         /* save errno */
+      Mmsg2(dev->errmsg, _("Unable to set eotmodel on device %s: ERR=%s\n"),
+            dev->print_name(), be.strerror(dev->dev_errno));
+      Jmsg(dcr->jcr, M_FATAL, 0, dev->errmsg);
+   }
+#endif
    return;
 #endif
 
index 2f280e8ca642bed78ce5c091c9996c78bf582653..841198c32f12e1fa23a0fb6b4ffc26e85b583de6 100644 (file)
@@ -4,8 +4,8 @@
 
 #undef  VERSION
 #define VERSION "1.39.29"
-#define BDATE   "19 November 2006"
-#define LSMDATE "19Nov06"
+#define BDATE   "20 November 2006"
+#define LSMDATE "20Nov06"
 #define BYEAR "2006"       /* year for copyright messages in progs */
 
 /* Debug flags */
index 08758fe02a5bad1c31c33ff646f4ccaafaa11f6d..71b8a06119e632e46629723cb664eb8364ed685d 100644 (file)
@@ -1,6 +1,16 @@
               Technical notes on version 1.39  
 
 General:
+20Nov06
+kes  Make WritePartAfterJob the default so that the last DVD part 
+     always gets written to the DVD by default.
+kes  Add additional error messages in migration. 
+kes  Suppress redundant error messages in migration (possibly more to do).
+kes  Apply Martin's fix (updated to 1.39) that takes into account
+     run storage overrides in the Director status display.
+kes  Implement, but turn off the submitted code that sets the EOT
+     model on FreeBSD machines. Turning on this code is too risky at
+     this point in the development.
 19Nov06
 kes  Implement unique dbid routine for migration to prevent the same
      JobId from being migrated twice. This should fix bug #709.