]> git.sur5r.net Git - bacula/bacula/commitdiff
es Apply new dvd-handler patch from Richard Mortimer.
authorKern Sibbald <kern@sibbald.com>
Fri, 1 Sep 2006 11:56:23 +0000 (11:56 +0000)
committerKern Sibbald <kern@sibbald.com>
Fri, 1 Sep 2006 11:56:23 +0000 (11:56 +0000)
kes  Tweak so that debug level 20 shows only DVD commands.
kes  Correct spooled_part flag in dev.c close() so that it is cleared
     when the spool file is deleted or does not exist.
kes  Print part number in read_records when eof hit (restore).

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

bacula/scripts/dvd-handler.in
bacula/src/stored/append.c
bacula/src/stored/dev.c
bacula/src/stored/dvd.c
bacula/src/stored/label.c
bacula/src/stored/read_record.c
bacula/src/version.h
bacula/technotes-1.39

index 14bce276ab471d69e2a598059ac24fdca1af4a49..487598abed666a3b5d20e0cd86c363d76be902e2 100644 (file)
@@ -266,10 +266,10 @@ class disk:
       
       cmd = self.growcmd + self.growparams
       if newvol:
-        cmd += " -Z "
         # Ignore any existing iso9660 filesystem - used for truncate
         if newvol == 2:
-            cmd += "-use-the-force-luke=tty "
+            cmd += " -use-the-force-luke=tty"
+        cmd += " -Z "
       else:
         cmd += " -M "
       cmd += self.device + " " + str(partfile)
index d972e76d5cd482092d4db517b9a76e276d549fe1..9910ce1c0e54584170d2a431a9b441c830839dee 100644 (file)
@@ -80,7 +80,7 @@ bool do_append_data(JCR *jcr)
    if (dev->VolCatInfo.VolCatName[0] == 0) {
       Pmsg0(000, _("NULL Volume name. This shouldn't happen!!!\n"));
    }
-   Dmsg1(20, "Begin append device=%s\n", dev->print_name());
+   Dmsg1(50, "Begin append device=%s\n", dev->print_name());
 
    begin_data_spool(dcr);
    begin_attribute_spool(jcr);
index c053980bb33fd0731d734f5e6da3df342497c379..920a4ea01e9311531047dd42eca92f968259c5bf 100644 (file)
@@ -1782,16 +1782,21 @@ void DEVICE::close()
       struct stat statp;
       int part_save = part;
       POOL_MEM archive_name(PM_FNAME);
+      int status;
 
       part = num_dvd_parts;
       Dmsg3(100, "Remove empty part in close call make_dvd_filename. part=%d num=%d vol=%s\n", 
          part, num_dvd_parts, VolCatInfo.VolCatName);
       make_spooled_dvd_filename(this, archive_name);
       /* Check that the part file is empty */
-      if ((stat(archive_name.c_str(), &statp) == 0) && (statp.st_size == 0)) {
+      status = stat(archive_name.c_str(), &statp);
+      if (status == 0 && statp.st_size == 0) {
          Dmsg1(100, "unlink(%s)\n", archive_name.c_str());
          unlink(archive_name.c_str());
-      }
+         set_part_spooled(false);        /* no spooled part left */
+      } else if (status < 0) {                         
+         set_part_spooled(false);        /* spool doesn't exit */
+      }       
       part = part_save;               /* restore part number */
    }
    
@@ -1900,7 +1905,9 @@ bool DEVICE::do_mount(int mount, int dotimeout)
    }
    results = get_memory(2000);
    results[0] = 0;
+
    /* If busy retry each second */
+   Dmsg1(20, "do_mount run_prog=%s\n", ocmd.c_str());
    while ((status = run_program_full_output(ocmd.c_str(), 
                        max_open_wait/2, results)) != 0) {
       /* Doesn't work with internationalisation (This is not a problem) */
index 3a7bb90c1f764d5d0f2a15bfe896e693d0ebc33d..298668240ddde8e329d4ca4347ccc6f3a9f6323c 100644 (file)
@@ -135,11 +135,11 @@ static bool do_mount_dvd(DEVICE* dev, int mount, int dotimeout)
    results = get_memory(2000);
    results[0] = 0;
    /* If busy retry each second */
-   Dmsg1(100, "Run prog=%s\n", ocmd.c_str());
+   Dmsg1(20, "Run mount prog=%s\n", ocmd.c_str());
    while ((status = run_program_full_output(ocmd.c_str(), 
                        dev->max_open_wait/2, results)) != 0) {
       Dmsg2(99, "Mount status=%d result=%s\n", status, results);
-      /* Doesn't work with internationalisation (This is not a problem) */
+      /* Doesn't work with internationalization (This is not a problem) */
       if (mount && fnmatch("*is already mounted on*", results, 0) == 0) {
          break;
       }
@@ -290,7 +290,7 @@ bool update_free_space_dev(DEVICE* dev)
    
    while (1) {
       berrno be;
-      Dmsg1(100, "Run prog=%s\n", ocmd.c_str());
+      Dmsg1(20, "Run freespace prog=%s\n", ocmd.c_str());
       status = run_program_full_output(ocmd.c_str(), dev->max_open_wait/2, results);
       if (status == 0) {
          free = str_to_int64(results);
@@ -414,8 +414,7 @@ bool dvd_write_part(DCR *dcr)
    else
       timeout = dev->max_open_wait + (dev->part_size/(1350*1024/4));
 
-   Dmsg2(29, "dvd_write_part: cmd=%s timeout=%d\n", ocmd.c_str(), timeout);
-      
+   Dmsg2(20, "dvd_write_part: cmd=%s timeout=%d\n", ocmd.c_str(), timeout);
    status = run_program_full_output(ocmd.c_str(), timeout, results.c_str());
 
    if (status != 0) {
@@ -431,6 +430,9 @@ bool dvd_write_part(DCR *dcr)
       return false;
    }
    Jmsg(dcr->jcr, M_INFO, 0, _("Part %d written to DVD.\n"), dev->part);
+   Dmsg2(400, "dvd_write_part: Part %d written to DVD\nResults: %s\n",
+            dev->part, results.c_str());
+    
    if (dev->truncated_dvd) {
       dev->truncated_dvd = false;   /* turn off flag */
    } else {                         /* DVD part written */
index 5734f4369082aff3a21fbdd39fb69f7f3375562c..b51ec456618c677baa8f41d436ba309d26279887 100644 (file)
@@ -704,14 +704,14 @@ bool write_session_label(DCR *dcr, int label)
       return false;
    }
 
-   Dmsg6(20, "Write sesson_label record JobId=%d FI=%s SessId=%d Strm=%s len=%d "
+   Dmsg6(50, "Write sesson_label record JobId=%d FI=%s SessId=%d Strm=%s len=%d "
              "remainder=%d\n", jcr->JobId,
       FI_to_ascii(buf1, rec->FileIndex), rec->VolSessionId,
       stream_to_ascii(buf2, rec->Stream, rec->FileIndex), rec->data_len,
       rec->remainder);
 
    free_record(rec);
-   Dmsg2(20, "Leave write_session_label Block=%d File=%d\n",
+   Dmsg2(50, "Leave write_session_label Block=%d File=%d\n",
       dev->block_num, dev->file);
    return true;
 }
index 3fb788987e0d94c8c7da6e7f7a2930024cb134c7..9ca1a1f4ea016c43be800ff3f7e14af18ee39c4e 100644 (file)
@@ -109,8 +109,14 @@ bool read_records(DCR *dcr,
 
          } else if (dev->at_eof()) {
             if (verbose) {
-               Jmsg(jcr, M_INFO, 0, _("End of file %u  on device %s, Volume \"%s\"\n"),
-                  dev->file, dev->print_name(), dcr->VolumeName);
+               char dvdpart[100];
+               if (dev->is_dvd()) {
+                  bsnprintf(dvdpart, sizeof(dvdpart), _("part %d "), dev->part);
+               } else {
+                  dvdpart[0] = 0;
+               }
+               Jmsg(jcr, M_INFO, 0, _("End of file %u %son device %s, Volume \"%s\"\n"),
+                  dev->file, dvdpart, dev->print_name(), dcr->VolumeName);
             }
             Dmsg3(200, "End of file %u  on device %s, Volume \"%s\"\n",
                   dev->file, dev->print_name(), dcr->VolumeName);
index b5a461f1b6296228fc8895d72511006417480041..a4a6aa51dfce4e7dd4082f715c88c5cdf3ec5ec1 100644 (file)
@@ -4,8 +4,8 @@
 
 #undef  VERSION
 #define VERSION "1.39.21"
-#define BDATE   "31 August 2006"
-#define LSMDATE "31Aug06"
+#define BDATE   "01 Septermber 2006"
+#define LSMDATE "01Sep06"
 #define BYEAR "2006"       /* year for copyright messages in progs */
 
 /* Debug flags */
index d4e5056b1e469f3556c1e362a856960d8d4ef611..76063d427d12e6030fd296e93e128c57db1de30e 100644 (file)
@@ -1,6 +1,12 @@
               Technical notes on version 1.39  
 
 General:
+01Sep06
+kes  Apply new dvd-handler patch from Richard Mortimer.
+kes  Tweak so that debug level 20 shows only DVD commands.
+kes  Correct spooled_part flag in dev.c close() so that it is cleared
+     when the spool file is deleted or does not exist.
+kes  Print part number in read_records when eof hit (restore).
 31Aug06
 kes  Make find with no args in tree restore return error rather than
      stopping the selection. Fixes bug #665