From abe0087ecb50db0f2370041667fe86f0115bcffa Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Wed, 24 Nov 2010 11:23:15 +0100 Subject: [PATCH] Move accurate test in BackupCommand for delta and delta-test plugins --- bacula/src/plugins/fd/delta-test-fd.c | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/bacula/src/plugins/fd/delta-test-fd.c b/bacula/src/plugins/fd/delta-test-fd.c index 507f46e3d4..5138e6b515 100644 --- a/bacula/src/plugins/fd/delta-test-fd.c +++ b/bacula/src/plugins/fd/delta-test-fd.c @@ -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: -- 2.39.5