]> git.sur5r.net Git - bacula/bacula/commitdiff
Fix newvol.c
authorKern Sibbald <kern@sibbald.com>
Sun, 12 Jan 2003 22:23:16 +0000 (22:23 +0000)
committerKern Sibbald <kern@sibbald.com>
Sun, 12 Jan 2003 22:23:16 +0000 (22:23 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@283 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/kernstodo
bacula/src/dird/catreq.c
bacula/src/dird/newvol.c
bacula/src/dird/protos.h
bacula/src/dird/ua_cmds.c

index 778e24907e803cdfc6b9f9060dccaaeac5486088..666a5d327137c9252d071eb4a3d84e869cf5b6f4 100644 (file)
@@ -1,5 +1,5 @@
                  Kern's ToDo List
-                 11 January 2003 
+                 12 January 2003 
 
 Documentation to do: (a little bit at a time)
 - Document running a test version.
@@ -16,8 +16,8 @@ Testing to do: (painful)
 - test and fix < code and | code.
 
 For 1.29 release:
+- Write Unix emulator for Windows.
 - Why is catreq.c:111 Find vol called twice for a job?
-- Why is FirstWritten = -1 after label?
 - Add include list to end of chain in findlib
 - Fix cancel in find_one -- need jcr.
 - Write SetJobStatus() function so cancel status not lost.
index 1c0d6799ea2c692ecc7e162146f28e129401ada2..523532b78972e1357df97036238adee8db154ba5 100644 (file)
@@ -103,7 +103,6 @@ next_volume:
             Dmsg1(100, "find_recycled_volume2 %d\n", ok);
            if (!ok) {
               /* See if we can create a new Volume */
-              mr.LabelDate = 0;
               ok = newVolume(jcr, &mr);
            }
         }
index 6b3cec4216ac4942d7b7b3f84c511c17eb29422f..64d83847e452bf0e8c1c5fbfbe2c3d5a70cf9991 100644 (file)
@@ -51,14 +51,12 @@ int newVolume(JCR *jcr, MEDIA_DBR *mr)
    if (db_get_pool_record(jcr->db, &pr) && pr.LabelFormat[0] &&
        pr.LabelFormat[0] != '*') {
       if (pr.MaxVols == 0 || pr.NumVols < pr.MaxVols) {
-        mr->PoolId = jcr->PoolId;
+        set_pool_dbr_defaults_in_media_dbr(mr, &pr);
+        mr->LabelDate = 0;
         strcpy(mr->MediaType, jcr->store->media_type);
         strcpy(name, pr.LabelFormat);   
          strcat(name, "%04d");
         sprintf(mr->VolumeName, name, ++pr.NumVols);
-         strcpy(mr->VolStatus, "Append");
-        mr->Recycle = pr.Recycle;
-        mr->VolRetention = pr.VolRetention;
         if (db_create_media_record(jcr->db, mr) &&
            db_update_pool_record(jcr->db, &pr) == 1) {
             Dmsg1(90, "Created new Volume=%s\n", mr->VolumeName);
index 23fbbefe936ba5ad99eaa6f58bf5e56d4895303c..4f09c43feed023abf58bf6fe1f101d890064fdd0 100644 (file)
@@ -77,3 +77,4 @@ extern int newVolume(JCR *jcr, MEDIA_DBR *mr);
 
 /* ua_cmd.c */
 extern int create_pool(B_DB *db, POOL *pool);
+extern void set_pool_dbr_defaults_in_media_dbr(MEDIA_DBR *mr, POOL_DBR *pr);
index af742f86ea3faf08533ebf3cf8df5b65511fc19c..b5c91b5b86fbad2a78b40957fa62d0038de45977 100644 (file)
@@ -138,7 +138,7 @@ int do_a_command(UAContext *ua, char *cmd)
  *   into the Media DB record just before creating a media (Volume) 
  *   record.
  */
-static void set_pool_dbr_defaults_in_media_dbr(MEDIA_DBR *mr, POOL_DBR *pr)
+void set_pool_dbr_defaults_in_media_dbr(MEDIA_DBR *mr, POOL_DBR *pr)
 {
    mr->PoolId = pr->PoolId;
    strcpy(mr->VolStatus, "Append");