From 3cd7f14201e385fe8025a58a07dd151bb27c13e3 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Sun, 12 Jan 2003 22:23:16 +0000 Subject: [PATCH] Fix newvol.c git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@283 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/kernstodo | 4 ++-- bacula/src/dird/catreq.c | 1 - bacula/src/dird/newvol.c | 6 ++---- bacula/src/dird/protos.h | 1 + bacula/src/dird/ua_cmds.c | 2 +- 5 files changed, 6 insertions(+), 8 deletions(-) diff --git a/bacula/kernstodo b/bacula/kernstodo index 778e24907e..666a5d3271 100644 --- a/bacula/kernstodo +++ b/bacula/kernstodo @@ -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. diff --git a/bacula/src/dird/catreq.c b/bacula/src/dird/catreq.c index 1c0d6799ea..523532b789 100644 --- a/bacula/src/dird/catreq.c +++ b/bacula/src/dird/catreq.c @@ -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); } } diff --git a/bacula/src/dird/newvol.c b/bacula/src/dird/newvol.c index 6b3cec4216..64d83847e4 100644 --- a/bacula/src/dird/newvol.c +++ b/bacula/src/dird/newvol.c @@ -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); diff --git a/bacula/src/dird/protos.h b/bacula/src/dird/protos.h index 23fbbefe93..4f09c43fee 100644 --- a/bacula/src/dird/protos.h +++ b/bacula/src/dird/protos.h @@ -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); diff --git a/bacula/src/dird/ua_cmds.c b/bacula/src/dird/ua_cmds.c index af742f86ea..b5c91b5b86 100644 --- a/bacula/src/dird/ua_cmds.c +++ b/bacula/src/dird/ua_cmds.c @@ -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"); -- 2.39.5