]> git.sur5r.net Git - bacula/bacula/commitdiff
Move accurate test in BackupCommand for delta and delta-test plugins
authorEric Bollengier <eric@eb.homelinux.org>
Wed, 24 Nov 2010 10:23:15 +0000 (11:23 +0100)
committerKern Sibbald <kern@sibbald.com>
Sat, 20 Apr 2013 12:37:11 +0000 (14:37 +0200)
bacula/src/plugins/fd/delta-test-fd.c

index 507f46e3d437252fcec7a3b51839373c77409538..5138e6b515cc82da0142c1557a1490d236f7bd04 100644 (file)
@@ -248,16 +248,6 @@ static bRC handlePluginEvent(bpContext *ctx, bEvent *event, void *value)
    case bEventLevel:
 //    Dmsg(ctx, dbglvl, "delta-test-fd: JobLevel=%c %d\n", (int)value, (int)value);
       self->level = (int)(intptr_t)value;
-      if (self->level == 'I' || self->level == 'D') {
-         bfuncs->getBaculaValue(ctx, bVarAccurate, (void *)&accurate);
-         if (!accurate) {       /* can be changed to FATAL */
-            Jmsg(ctx, M_FATAL, 
-                 "Accurate mode should be turned on when using the "
-                 "delta-test plugin\n");
-            return bRC_Error;
-         }
-      }
-
       break;
    case bEventSince:
 //    Dmsg(ctx, dbglvl, "delta-test-fd: since=%d\n", (int)value);
@@ -275,9 +265,18 @@ static bRC handlePluginEvent(bpContext *ctx, bEvent *event, void *value)
    case bEventRestoreCommand:
 //    Dmsg(ctx, dbglvl, "delta-test-fd: EventRestoreCommand cmd=%s\n", (char *)value);
       /* Fall-through wanted */
+      break;
    case bEventBackupCommand:
       Dmsg(ctx, dbglvl, "delta-test-fd: pluginEvent cmd=%s\n", (char *)value);
-      /* TODO: analyse plugin command here */
+      if (self->level == 'I' || self->level == 'D') {
+         bfuncs->getBaculaValue(ctx, bVarAccurate, (void *)&accurate);
+         if (!accurate) {       /* can be changed to FATAL */
+            Jmsg(ctx, M_FATAL, 
+                 "Accurate mode should be turned on when using the "
+                 "delta-test plugin\n");
+            return bRC_Error;
+         }
+      }
       break;
 
    default: