]> git.sur5r.net Git - bacula/bacula/commitdiff
ebl verify MaxVols when moving recycled volumes to RecyclePool
authorEric Bollengier <eric@eb.homelinux.org>
Tue, 20 Feb 2007 16:39:46 +0000 (16:39 +0000)
committerEric Bollengier <eric@eb.homelinux.org>
Tue, 20 Feb 2007 16:39:46 +0000 (16:39 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@4226 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/src/dird/ua_purge.c

index 14c77edafe38d8b130fc7cf5166257d51da8d0d8..f41156558d9c5eb7918adf7128ef422a91450bd4 100644 (file)
@@ -614,8 +614,18 @@ bool mark_media_purged(UAContext *ua, MEDIA_DBR *mr)
          memset(&newpr, 0, sizeof(POOL_DBR));
          newpr.PoolId = mr->RecyclePoolId;
          oldpr.PoolId = mr->PoolId;
-         if (db_get_pool_record(jcr, ua->db, &oldpr) && db_get_pool_record(jcr, ua->db, &newpr)) {
-            update_vol_pool(ua, newpr.Name, mr, &oldpr);
+         if (   db_get_pool_record(jcr, ua->db, &oldpr) 
+             && db_get_pool_record(jcr, ua->db, &newpr)) 
+         {
+            /* check if destination pool size is ok */
+            if (newpr.MaxVols > 0 && newpr.NumVols >= newpr.MaxVols) {
+               bsendmsg(ua, _("Unable move recycled Volume in full " 
+                              "Pool \"%s\" MaxVols=%d\n"),
+                        newpr.Name, newpr.MaxVols);
+
+            } else {            /* move media */
+               update_vol_pool(ua, newpr.Name, mr, &oldpr);
+            }
          } else {
             bsendmsg(ua, "%s", db_strerror(ua->db));
          }